Free Functions Template for Creating Conforming Constrained Delaunay Triangulations
The following functions create a 3D conforming constrained Delaunay triangulation from either a polygon soup or a polygon mesh.
Input Data
The input data (polygon mesh or polygon soup) represents the polygonal constraints enforced during the triangulation process.
By default, each face of the input is considered a polygonal constraint for the triangulation. The named parameter plc_face_id can be used to describe larger polygonal constraints, possibly with holes. If used, this parameter must be a property map that associates each face of the input with a PLC face identifier. Faces with the same face identifier are considered part of the same surface patch. Each of these surface patches (defined as the union of the input faces with a given patch identifier) is expected to be a polygon or a polygon with holes, with coplanar vertices (or nearly coplanar up to the precision of the number type used).
The generated triangulation will conform to the faces of the input, or to the surface patches described by the plc_face_id property map if provided.
In the case where the input contains a non-planar PLC face, building the triangulation may fail with an exception of type CGAL::Non_planar_plc_facet_exception.
Precondition
The input data must not be coplanar.
The input data must not have self-intersections.
Template Parameters
For both function templates, the template arguments can be deduced from the function arguments, or defaulted.
The first template argument Triangulation defaults to CGAL::Default, and in that case the triangulation type is deduced from the input type and the named parameters (see below).
The following one or two template arguments are deduced from the input data: either a polygon mesh type, or a polygon soup defined by two types (a sequence of points and a sequence of sequences of indices).
The last template argument is the named parameters class, deduced from the function arguments.
Returned Triangulation Type
For both functions, the template parameter Triangulation defines the type of the triangulation that is created and returned by the function.
If Triangulation is CGAL::Default, the geometric traits class type is deduced from the input data and the named parameters. If the named parameter geom_traits is provided, the traits class is deduced from it. Otherwise, the point type of the input data is used to deduce the traits class. Let's call it Traits. The returned triangulation type is then CGAL::Conforming_constrained_Delaunay_triangulation_3<Traits>.
a range of points representing the vertices of the polygon soup
polygons
a range of ranges of indices representing the faces of the polygon soup
np
an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
a property map associating points to the elements of the range points
Type: a model of ReadablePropertyMap whose key type is the value type of PointRange, and value type is convertible to the point type of the geometric traits class
a property map associating a patch identifier to each facet of soup. Each identifier corresponds to a planar surface patch. Each surface patch can be composed of several faces of soup, forming a planar polygon.
Type: a class model of ReadablePropertyMap with std::size_t as key type and with any value type that is a regular type (model of Regular)
Extra: If this parameter is omitted, each facet of the polygon soup is considered a separate PLC face.
Extra: Otherwise facets with the same patch identifier are considered part of the same PLC face.
Default: the default constructed traits object Traits{}
Returns
a 3D constrained Delaunay triangulation conforming to the faces of the polygon soup, of a type described in the section Returned Triangulation Type above.
an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
a property map associating points to the vertices of mesh
Type: a class model of ReadWritePropertyMap with boost::graph_traits<PolygonMesh>::vertex_descriptor as key type and Traits::Point_3 as value type
Default: boost::get(CGAL::vertex_point, mesh)
Extra: If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in PolygonMesh.
a property map associating a patch identifier to each facet of mesh. Each identifier corresponds to a planar surface patch. Each surface patch can be composed of several facets of mesh, forming a planar polygon.
Type: a class model of ReadablePropertyMap with boost::graph_traits<PolygonMesh>::face_descriptor as key type and with any value type that is a regular type (model of Regular)
Extra: If this parameter is omitted, each facet of mesh is considered a separate PLC face. Faces of mesh with the same patch identifier are considered part of the same PLC face.
Default: the default constructed traits object Traits{}
Returns
a 3D constrained Delaunay triangulation conforming to the faces of the polygon mesh, of a type described in the section Returned Triangulation Type above.