Implicit domain meshing

The mmgs application allows to discretize and optimize an implicitly defined line (which means a line defined by a level-set function). It takes a 3D surface mesh (i.e. a set of triangles) and the values of the level-set function at the mesh nodes and returns another 3D surface mesh (that represents the same underlying geometry) with the explicit discretization of the wanted isovalue and the two new domains defined by this isovalue (conformingly connected).

Example

We start from the teapot.mesh mesh and the distance function to a cube discretized at the mesh nodes (cube-distance.sol file). The input mesh and the distance function are displayed figure 1.

Figure 1: Surface mesh of a teapot (it contains only triangles, no tetrahedra) and distance function to a cube inscribed in the teapot.

Figure 1: Surface mesh of a teapot (it contains only triangles, no tetrahedra) and distance function to a cube inscribed in the teapot.

To split the domain on the 0 value of the level-set function:

mmgs_O3 teapot -sol cube-distance.sol -ls

 

  • we specify the name of the .sol file, that contains here the level-set function values at mesh nodes, using the -sol option (more infos about the -sol option).
  • The -ls option states that the input .sol file is in fact a level-set file and that we want to discretize the implicit line defined by the 0 level of the level-set. You can specifiy another value than 0 by providing it as argument of the -ls argument.

We obtain two domains conformingly connected and separated by a line that is a discretization of the initial 0 level-set (see figure 2).

Note that by default Mmg imposes the reference (=color) of the isosurface and of the domains :

  • The isoline is created with the ref 10;
  • Triangles in the negative part of the distance function have the ref 3;
  • Triangles in the positive part of the distance function have the ref 2.

Figure 2: Final teapot mesh: the yellow line represents the isovalue 0 of the distance function, the green domain its positive part, the yellow one its negative part. Red lines are ridges added by the automatic sharp angle detection.

Preservation of input references (colors)

By default, Mmgs resets the references (colors) of the input mesh. In the previous example, the input teapot has multiple colors (see figure 3).

Figure 3: Colors (or references) of the input teapot mesh.

Figure 3: Colors (or references) of the input teapot mesh.

It is possible to ask Mmgs to preserve its:

mmgs_O3 teapot -sol cube-distance.sol -ls -keep-ref

The result is displayed figure 4.

Figure 4: output mesh after isovalue discretization with preservation of input references. The newly discretized isoline is still depicted in yellow.

Figure 4: Output mesh after isovalue discretization with preservation of input references. The newly discretized isoline is still depicted in yellow.

Note that the way to preserve input references is not the same for mmgs than for mmg2d and mmg3d (where a parameter file must be used). It will probably be homogenized in the future so the -keep-ref  option will be removed to be replaced by the parameter file compatibility (more generic).

 

 

Comments are closed.