Volume-mesh of a closed Region?

For an examplary given surface mesh (example from documentation DiscretizeRegion )

sf=DiscretizeRegion[ParametricRegion[{Cos[u]/2, 3 Cos[v]/2 + Sin[u]/2, Sin[v]}, {{u, 0, 2 \[Pi]}, {v, 0, 2 \[Pi]}}]]


I would like to mesh the enclosed volume.

I know BoundaryMeshRegion evaluates the surface of a given volume, but couldn't find a "InverseFunction" which meshes the volume enclosed by a closed surface mesh!

Thanks

• Assuming sf is a watertight and self-intersection free mesh, this should work: BoundaryMeshRegion[MeshCoordinates[sf], MeshCells[sf, 2]]. Commented Oct 11, 2022 at 14:01
• @GregHurst Thanks, but BoundaryMeshRegion create a surface mesh again, or am I wrong? Commented Oct 11, 2022 at 14:11
• @GregHurst Thanks again, now I got it! Commented Oct 11, 2022 at 14:16
• It seems that there are two singular bands in this surfaces make the boundary discretize work fail. Commented Oct 11, 2022 at 14:22
• @cvgmt Thanks, I tried MeshRepair[] but didn't succeed Commented Oct 11, 2022 at 14:24

There are issues when converting that parametric object to a mesh. FindMeshDefects finds multiple defect.

Therefore, I created a different parametric object, two interlocked tori. If I needed your specific object, then I believe, with more effort, that I could created the original object correctly.

The illustrations are low-order. I was successful generating objects with more than 100,000 tetrahedrons.

steps = 4
unit = (2*Pi)/steps
p = ({0, Cos[#1], Sin[#1]} & ) /@ (unit*Range[0, steps]);
t1 = TranslationTransform[{0, -3, 0}]
p1 = t1[p];
p2 = (RotationTransform[#1, {0, 0, 1}, {0, 0, 0}][p1] & ) /@
(unit*Range[0, steps]);
Dimensions[p2]
Graphics3D[{Point[Flatten[p2, 1]]}, Boxed -> True,
Axes -> True, AxesLabel ->
(Style[#1, Bold, Red, Large] & ) /@ {"X", "Y", "Z"}]
faces = Rationalize[
N[Flatten[Table[{Triangle[{p2[[i,j]], p2[[i,j + 1]],
p2[[i + 1,j + 1]]}], Triangle[{p2[[i,j]],
p2[[i + 1,j + 1]], p2[[i + 1,j]]}]}, {i, steps},
{j, steps}], 2]]];
coordinates = Sort[Union[Flatten[(#1[[1]] & ) /@ faces, 1]]];
sf1 = BoundaryMeshRegion[coordinates,
{Triangle[Table[Flatten[(Position[coordinates, #1] & ) /@
triangle[[1]]], {triangle, faces}]]}, Boxed -> True,
Axes -> True, AxesLabel ->
(Style[#1, Bold, Red, Large] & ) /@ {"X", "Y", "Z"},
AxesOrigin -> {0, 0, 0}]
FindMeshDefects[sf1]
sf2 = (TranslationTransform[{0, 3, 0}] @*
RotationTransform[Pi/2, {0, 1, 0}, {0, 0, 0}])[sf1]
sf = RegionUnion[sf1, sf2]
Get["NDSolveFEM"]