… back working with mmg after some while
I’m trying to solve a similar situation as the one described in this recent thread: to go from a surface mesh to a tetrahedral mesh.
Starting from a set of points with triangles, in other words from a surface mesh, I would like to generate a tetrahedral mesh such that those triangles occur as faces of some of the generated tetrahedra.
The strategy is to:
generate the Delaunay tetrahedralization of the points, because that seems to be the simplest way to draw sort-of well-behaved tetrahedra between the points. The union of the all these tetrahedra is equal to the convex hull of all input points. Moreover, good implementations of the Delaunay tetrahedralization can be found on the web. We don’t need to use mmg3d for this step.
use mmg3d to require the given triangles from the surface mesh. This step should amount to turning the unconstrained Delaunay tetrahedralization into a constrained Delaunay tetrahedralization. Since the triangles cut the tetrahedra in potentially awful ways, this step amounts to asking mmg3d to do a lot of remesing of all those tetrahedra that intersect one of the triangles.
remove the tetrahedra outside the triangles, assuming that the initial surface mesh was a solid in the sense that it was connected, had no non-manifold edges, and no naked edges. This step is done with the help of some BSP-tree or some similar technology.
Question: is part 2 an appropriate usage of mmg3d’s “require triangle” functionality?
Is the strategy described here a proper way to use mmg3d?
Are there input flags that should be used in this particular situation?
I understand that in order to preserve triangles that are not yet faces of tetrahedra, one has to use the opnbdy flag because these triangles are not between two references of tetrahedra.
Even though I get from other answers that such a usage is not what “require triangle” is made for, maybe one can save the situation by applying a good subdivision strategy before step 2?
EDIT: it should be sufficient to assume that the constraints are planar. Maybe one can “manually” intersect all tetrahedra with the plane before applying mmg3d?
Actually, the intersection of a plane with a tetrahedron is either a tetrahedron and a prism, or two prisms (or degenerate and not important), and we can feed the prism or the two prisms into mmg3d.