1

This is a question about the 3D Surface Mesh Generation tool in CGAL.

According to the documentation, I need to provide the surface to be meshed in implicit-form as a zero level-set surface. This seems to place a restriction on the input surface to be manifold.

The Problem

In my use-case, I need to generate mesh for a small 'region' of an otherwise larger 'parent' manifold implicit surface. The 'region' itself is non-manifold because it does not enclose a volume.

enter image description here

A way I can think of for tackling this is :

  • Mesh the entire 'parent' surface, and then
  • Extract the mesh corresponding to the required 'region'.

However, I want to avoid this for performance reasons.

How should I proceed with this ? Is any other module available in CGAL that can help me achieve this ?

johngreen
  • 2,676
  • 5
  • 32
  • 47

1 Answers1

1

As your surface is implicit, you can easily create function that represents the intersection of that implicit surface with an implicit volume, like a sphere, a bounding box, or a half-space.

Let's, for example, that you have the equation of a sphere:

auto sphere(double x, double, y, double z) {
  return x*x + y*y + z*z - 1;
}

then you can compute the intersection with a half-space, like that:

auto half_space(double x, double y, double z) {
  return y - x > 0 ? -1. : -1.;
}

auto intersection(double, x, double y, double z) {
  if(half_space(x, y, z) > 0) return 1.
  else return sphere(x, y,  z);
}
lrineau
  • 6,036
  • 3
  • 34
  • 47