CGAL::Poisson_reconstruction_function<GeomTraits>

转自:http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Surface_reconstruction_points_3_ref/Class_Poisson_reconstruction_function.html#Cross_link_anchor_1498

CGAL::Poisson_reconstruction_function<GeomTraits>

Definition

Given a set of 3D points with oriented normals sampled on the boundary of a 3D solid, the Poisson Surface Reconstruction method [KBH06] solves for an approximate indicator function of the inferred solid, whose gradient best matches the input normals. The output scalar function, represented in an adaptive octree, is then iso-contoured using an adaptive marching cubes.

Poisson_reconstruction_function implements a variant of this algorithm which solves for a piecewise linear function on a 3D Delaunay triangulation instead of an adaptive octree.

#include <CGAL/Poisson_reconstruction_function.h>

Parameters

template<class Gt>
class Poisson_reconstruction_function;

Parameters


Gt: Geometric traits class.

Is Model for the Concepts

Model of the ImplicitFunction concept.

Types

Poisson_reconstruction_function<GeomTraits>::Geom_traits
 Geometric traits class.

Poisson_reconstruction_function<GeomTraits>::FT
 typedef to Geom_traits::FT

Poisson_reconstruction_function<GeomTraits>::Point
 typedef to Geom_traits::Point_3

Poisson_reconstruction_function<GeomTraits>::Vector
 typedef to Geom_traits::Vector_3

Poisson_reconstruction_function<GeomTraits>::Sphere
 typedef to Geom_traits::Sphere_3

Creation

template<typename InputIterator, typename PointPMap, typename NormalPMap>
Poisson_reconstruction_function<GeomTraits> fct (InputIterator first,
InputIterator beyond,
PointPMap point_pmap,
NormalPMap normal_pmap);
 Creates a Poisson implicit function from the [first, beyond) range of points.
Template Parameters: 
InputIterator: iterator over input points. PointPMap: is a model ofboost::ReadablePropertyMap with a value_type = Point_3. It can be omitted ifInputIterator value_type is convertible to Point_3.NormalPMap: is a model of boost::ReadablePropertyMap with a value_type = Vector_3.
Parameters: 
first: iterator over the first input point. beyond: past-the-end iterator over the input points.point_pmap: property map to access the position of an input point. normal_pmap: property map to access theoriented normal of an input point.

Operations

Spherefct.bounding_sphere () constReturns a sphere bounding the inferred surface.
template<classSparseLinearAlgebraTraits_d>
bool
fct.compute_implicit_function (SparseLinearAlgebraTraits_d solver =SparseLinearAlgebraTraits_d())
  The function compute_implicit_function() must be called after the insertion of oriented points. It computes the piecewise linear scalar function operator() by: applying Delaunay refinement, solving for operator() at each vertex of the triangulation with a sparse linear solver, and shifting and orienting operator() such that it is 0 at all input points and negative inside the inferred surface.
Template parameters: 
SparseLinearAlgebraTraits_d: Symmetric definite positive sparse linear solver. IfEigen 3.1 (or greater) is available and CGAL_EIGEN3_ENABLED is defined, the default solver isEigen::ConjugateGradient, otherwise, it is TAUCS Multifrontal Supernodal Cholesky Factorization.
Returns: false if the linear solver fails.
Parameters: 
solver: sparse linear solver.
FT fct.operator() ( const Point& p) const
  ImplicitFunction interface: evaluates the implicit function at a given 3D query point. The functioncompute_implicit_function must be called before the first call to operator().
Pointfct.get_inner_point () constReturns an arbitray point located inside the inferred surface.

Example

See Surface_reconstruction_points_3/poisson_reconstruction_example.cpp.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
int main(int argc, const char** argv) { //****************************************获取数据***************************************************** const std::string input_filename = (argc > 1) ? argv[1] : CGAL::data_file_path("C:\\Users\\lwc\\source\\repos\\Project4\\x64\\Release\\output.xyz"); const char* output_filename = (argc > 2) ? argv[2] : "C:\\Users\\lwc\\source\\repos\\Project4\\x64\\Release\\113.xyz"; //输出文件名称 std::vector<PointVectorPair> points; if (!CGAL::IO::read_points(input_filename, std::back_inserter(points), CGAL::parameters::point_map(CGAL::First_of_pair_property_map<PointVectorPair>()) .normal_map(CGAL::Second_of_pair_property_map<PointVectorPair>()))) { std::cerr << "Error: cannot read file " << input_filename << std::endl; return EXIT_FAILURE; } //****************************************点云平滑************************************************* unsigned int k = 5; //邻近点数 double offset_radius = 0.01; CGAL::vcm_estimate_normals<std::vector<PointVectorPair>>(points, offset_radius, k, CGAL::parameters::point_map(CGAL::First_of_pair_property_map<PointVectorPair>()) .normal_map(CGAL::Second_of_pair_property_map<PointVectorPair>())); //使用vcm算法来获取每个点的法向量,后面的参数指定了我们的点与法向量对于的部分 //********************************************保存数据************************************************* if (!CGAL::IO::write_points(output_filename, points, CGAL::parameters::point_map(CGAL::First_of_pair_property_map<PointVectorPair>()) .normal_map(CGAL::Second_of_pair_property_map<PointVectorPair>()) .stream_precision(17))) return EXIT_FAILURE; std::cout << "计算结束!" << std::endl; return EXIT_SUCCESS; } 我想将此算法改成遍历文件夹应该怎么写
最新发布
07-20

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值