Reputation: 475
I am trying to implement a mesh generation algorithm. I am representing Delaunay tetrahedralization using CGAL::Delaunay_triangulation_3
class.
In one stage of the algorithm(section 7: Facet recovery), I have a Delaunay tetrahedralization(say DT0
), I need to create a cavity(or hole)C
inside the Delaunay tetrahedralization(thereby transforming it to say DT1
) and fill it again with new tetrahedrons by performing Delaunay tetrahedralization(say DT2
) on the vertices of the cavity. Resulting tetrahedralization need not be purely Delaunay(i.e, it may have some cells not satisfying empty sphere criteria). More details on why such cavity needs to be created and refilled again are mentioned below in the context section.
Question:
Is it possible in CGAL to create such a cavity inside an existing Delaunay tetrahedralization and fill it with another tetrahedralization?
Relevent details:
C
is a polyhedron with all of its facets shared with that of cells in DT0
. DT2
does not represent complete Delaunay tetrahedralization of vertices of C
. It contains only those tetrahedrons which are inside C
, rest of the tetrahedrons are discarded.Context:
The purpose for creating the cavity and refilling it is the following:
Algorithm(mentioned above) is for computing a constraint preserving Delaunay tetrahedralization. Input to the algorithm is a set of vertices,segments(a segment connects 2 vertices) and facets(in my case these are triangles) given as constraints that must be preserved in the final tetrahedralization. In this question, I am discussing about implementation of facet preservation part of the algorithm. To recover any missing constraint facet in the final tetrahedralization, algorithm creates a cavity and refills it with tetrahedrons(or cells) in such way that combination of the facets of some of these cells recover the constraint facet(i.e., f1+f2+...+fn=f
where f1,f2..fn
are facets of some newly created cells in the cavity and f
is the constraint facet, or in other words, f1,f2..fn
are sub-facets of f
) in the output tetrahedralization. Output tetrahedralization is called Constrained Delaunay tetrahedralization in literature and it may or may not be Delaunay.
My attempt:
Currently, I do not find any relevant CGAL class to directly solve this issue so I am thinking of doing the following:
DT0
using CGAL::Delaunay_triangulation_3
.C
inside DT0
following the algorithm and representing C
as a separate Polyhedron_3
object. Remaining set of tetrahedrons are collectively denoted by DT1
. DT2'
of the vertices of C
.DT2'
(as per algorithm) to compute DT2
.DT1
and DT2
. Since both share facets of C
(guaranteed by the algorithm), so they can be connected in principle. Right now I am thinking of representing DT1
and DT2
as std::list<Tetrahedron_3>
object but how to merge them to create a tetrahedralization?
Upvotes: 3
Views: 660
Reputation: 475
After reading CGAL documentation, I realized that I can represent my output mesh in form of Linear cell complex instead. I can now do the following:
import_from_triangulation_3()
.remove_cell()
.sew3_same_facets()
(undocumented function). I have got reference for sew3_same_facets()
from CGAL discussion forum. Right now, I am not accepting my response as the answer since I am still in process of implementing it. But I thought of sharing it meanwhile.
Upvotes: 1
Reputation: 221
This is the way that the point removal is implemented in CGAL. You may want to look at the code for remove.
Upvotes: 3