3
votes

I use CGAL for meshing an implicit surface and up to now this example is close to what I want to accomplish.

However,the implicit surface consists of several connected components among which one may not be detected.

For example, if the number of initial points is set to 800

  // meshing surface
  CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Manifold_with_boundary_tag(),800);

it is possible to find the concrete components.

However, I would rather provide explicit start points, which are easy to find by my program. Unfortunately I do not understand how to accomplish this with CGAL.

From the documentation I found that this method may help

SurfaceMeshTraits_3::Construct_initial_points()

I can not figure out, how to integrate this.

Could someone, who is "in the know" with CGAL template programming give me a rough sketch how to proceed - maybe just the template<...>class XXX public: YYY { Construct_initial_points ... } as would be used in the example code above?

1

1 Answers

1
votes

If I have understood correctly , you actually want to construct a surface from a point set. There is a tutorial just for that.

To help a bit:

CGAL::make_surface_mesh(c2t3,                                 // reconstructed mesh
                        surface,                              // implicit surface
                        criteria,                             // meshing criteria
                        CGAL::Manifold_with_boundary_tag());  // require manifold mesh

the code above shows what you have to provide in order to build the surface. Your result is stored in c2t3 , and you can generate the implicit surface from a set of points as shown in the example by using a poisson function:

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Poisson_reconstruction_function<Kernel> Poisson_reconstruction_function;
Poisson_reconstruction_function function(points.begin(), points.end(),
        CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type()) );

There are two ways to proceed:

  1. include the initial points in the pointset generated from your implicit function and define a poisson reconstruction function on that.

  2. provide that SurfaceMeshTraits_3 traits class model that you can the pass onwards.

In principle two is difficult , and you have to either redefine it from start, modify an existing one, or derive from a current and implement :

construct_initial_points_object()

Tip: concepts in CGAL are abstract classes, models are the concrete implementations.

Once done there you can use

CGAL::Surface_mesh_complex_2_in_triangulation_3< YOUR_NEW_TRAITS >

to use it.

In order to achieve custom reconstruction ( e.g. without