4

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?

Jürgen Böhm
  • 389
  • 3
  • 11
  • Same problem, but even increasing the initial number of points fails to detect the missing component (my implicit surface is the union of two shapes, each homeomorphic to a torus, they are not small and my bounding sphere is correct) PS: Hi from 7 years later – Arnaud Mar 23 '22 at 13:38

1 Answers1

0

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

Community
  • 1
  • 1
g24l
  • 3,055
  • 15
  • 28
  • No, I do *not* want to construct from a point set, but from an explicitly computable implicit function - as described in the example that I gave. The only problem is, that the zero set of this function in the bounding sphere consists of several components, some of which are not found in the default arrangement of things. It would be sufficient just to supply one point on each component before calling make_surface_mesh(..) and this should and can be done somehow with SurfaceMeshTraits_3::Construct_initial_points(). – Jürgen Böhm Dec 10 '15 at 22:54
  • @JürgenBöhm so why don't you replace the poison reconstruction function with your own? – g24l Dec 11 '15 at 07:57
  • The reconstruction package from point sets computes an implicit reconstruction function and meshes then with marching cubes (so says the documentation). The 3D Surface mesh package takes an implicit function and meshes with another (not marching cube) method, based on Delaunay triangulations. I presume from general considerations that the latter meshing method is superior for my application in terms of speed and accuracy. In fact the results of this Delaunay-meshing look quite good, and if the problem of the components not found can be solved, it would fully suit my needs. – Jürgen Böhm Dec 11 '15 at 08:52
  • I must correct the statement above: The point set reconstruction package uses for meshing the same 3D Surface mesh package that is used in my initial example (I was misled by the statement of "marching cubes"). Nevertheless, after fixing by hand the poisson reconstruction function, I would be just in the situation where my question starts. – Jürgen Böhm Dec 11 '15 at 09:02
  • @JürgenBöhm , so actually you want to provide the start points for the solving the implicit surface onto the mesh generated from your point set . Is that correct? – g24l Dec 11 '15 at 10:11
  • I just want to accomplish what is done in the initial example that I gave: I have an implicit equation that I can compute concrete values of and I want CGAL deliver a mesh in the form of a C2t3 object. This works already quite well, up to the problem of some components not found, which could be solved immediately if one could hand over at least one initial/seed point on each component to CGAL. This is done by SurfaceMeshTraits_3::Construct_initial_points(), the point is that I just do not know to define the necessary classes and templates to integrate that into the example from which I started – Jürgen Böhm Dec 11 '15 at 10:19
  • @JürgenBöhm , This answer suggests that you generate a pointset by sampling your generator , include the so called start_points and pass the to the implicit function. However, you want to actually provide the reconstruction function. SurfaceMeshTraits_3 is a concept , you have to define it yourself, you could possibly do that with inheritance and overloading the initial points constructor. It is cumbersome to work with exact points though. – g24l Dec 11 '15 at 13:34