RSMesh 1.0.0
一个曲面重构的系统,输入为点云,输出为obj,stl等主流格式的网格文件,使用的方法为径向基函数插值,采取了并行优化、Intel-MKL等优化措施,支持百万级别的点云
载入中...
搜索中...
未找到
polynomial_evaluator.h
1//
2// Created by RainSure on 2024/1/21.
3//
4
5#ifndef RSMESH_POLYNOMIAL_EVALUATOR_H
6#define RSMESH_POLYNOMIAL_EVALUATOR_H
7
8#include "Eigen/Core"
9#include "common/macros.h"
10#include "geometry/point3d.h"
11#include "types.h"
12
13namespace rsmesh::polynomial {
14 template <class Basis>
16 public:
17 explicit polynomial_evaluator(int dimension, int degree) :
18 basis_(dimension, degree), weights_(valuesd::Zero(basis_.basis_size())) {}
19 [[nodiscard]] valuesd evaluate() const {
20 Eigen::MatrixXd pt = basis_.evaluate(points_);
21 return pt.transpose() * weights_;
22 }
23
24 void set_field_points(const geometry::points3d& points) {
25 points_ = points;
26 }
27
28 void set_weights(const valuesd& weights) {
29 RSMESH_ASSERT(weights.rows() == basis_.basis_size());
30 weights_ = weights;
31 }
32 private:
33 const Basis basis_;
34
35 geometry::points3d points_;
36 valuesd weights_;
37
38 };
39}// namespace rsmesh::polynomial
40
41
42#endif //RSMESH_POLYNOMIAL_EVALUATOR_H
vectors3d points3d
3维点的集合
Definition point3d.h:48
该命名空间下主要定义了多项式计算相关的类和函数