RSMesh 1.0.0
一个曲面重构的系统,输入为点云,输出为obj,stl等主流格式的网格文件,使用的方法为径向基函数插值,采取了并行优化、Intel-MKL等优化措施,支持百万级别的点云
载入中...
搜索中...
未找到
biharmonic3d.h
1//
2// Created by RainSure on 2024/2/22.
3//
4
5#ifndef RSMESH_BIHARMONIC3D_H
6#define RSMESH_BIHARMONIC3D_H
7
8#include "rbf_base.h"
9
10namespace rsmesh::rbf {
11 class biharmonic3d final : public rbf_base {
12 public:
13 using rbf_base::rbf_base;
14
15 explicit biharmonic3d(const std::vector<double>& params) { set_parameters(params); }
16
17 [[nodiscard]] std::unique_ptr<rbf_base> clone() const override { return std::make_unique<biharmonic3d>(*this); }
18
19 [[nodiscard]] int cpd_order() const override { return 1; }
20
21 [[nodiscard]] double evaluate_isotropic(const vector3d& diff) const override {
22 auto slope = parameters().at(0);
23 auto r = diff.norm();
24
25 return -slope * r;
26 }
27
28 [[nodiscard]] vector3d evaluate_gradient_isotropic(const vector3d& /*diff*/) const override {
29 throw std::runtime_error("biharmonic3d::evaluate_gradient_isotropic() is not implemented");
30 }
31
32 [[nodiscard]] matrix3d evaluate_hessian_isotropic(const vector3d& /*diff*/) const override {
33 throw std::runtime_error("biharmonic3d::evaluate_hessian_isotropic() is not implemented");
34 }
35
36 [[nodiscard]] int num_parameters() const override { return 1; }
37
38 [[nodiscard]] const std::vector<double>& parameter_lower_bounds() const override {
39 static const std::vector<double> lower_bounds{0.0};
40 return lower_bounds;
41 }
42
43 [[nodiscard]] const std::vector<double>& parameter_upper_bounds() const override {
44 static const std::vector<double> upper_bounds{std::numeric_limits<double>::infinity()};
45 return upper_bounds;
46 }
47 };
48
49} // namespace rsmesh::rbf
50
51#endif //RSMESH_BIHARMONIC3D_H
该命名空间下主要定义了径向基函数相关的类和函数