CGAL 5.1 - Polygon Mesh Processing
Corefinement and Boolean Operations

Functions to corefine triangulated surface meshes and compute triangulated surface meshes of the union, difference and intersection of the bounded volumes.

Classes

struct  CGAL::Polygon_mesh_processing::Corefinement::Default_visitor< TriangleMesh >
 

Enumerations

enum  CGAL::Polygon_mesh_processing::Corefinement::Boolean_operation_type {
  UNION = 0, INTERSECTION =1, TM1_MINUS_TM2 =2, TM2_MINUS_TM1 =3,
  NONE
}
 

Functions

template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 >
bool CGAL::Polygon_mesh_processing::clip (TriangleMesh &tm, TriangleMesh &clipper, const NamedParameters1 &np_tm, const NamedParameters2 &np_c)
 
template<class TriangleMesh , class NamedParameters >
bool CGAL::Polygon_mesh_processing::clip (TriangleMesh &tm, const Plane_3 &plane, const NamedParameters &np)
 
template<class TriangleMesh , class NamedParameters >
bool CGAL::Polygon_mesh_processing::clip (TriangleMesh &tm, const Iso_cuboid_3 &iso_cuboid, const NamedParameters &np)
 
template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 >
void CGAL::Polygon_mesh_processing::split (TriangleMesh &tm, TriangleMesh &splitter, const NamedParameters1 &np_tm, const NamedParameters2 &np_s)
 
template<class TriangleMesh , class NamedParameters >
void CGAL::Polygon_mesh_processing::split (TriangleMesh &tm, const Plane_3 &plane, const NamedParameters &np)
 
template<class TriangleMesh , class NamedParameters >
void CGAL::Polygon_mesh_processing::split (TriangleMesh &tm, const Iso_cuboid_3 &iso_cuboid, const NamedParameters &np)
 
template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 , class NamedParametersOut0 , class NamedParametersOut1 , class NamedParametersOut2 , class NamedParametersOut3 >
std::array< bool, 4 > CGAL::Polygon_mesh_processing::corefine_and_compute_boolean_operations (TriangleMesh &tm1, TriangleMesh &tm2, const std::array< boost::optional< TriangleMesh * >, 4 > &output, const NamedParameters1 &np1, const NamedParameters2 &np2, const std::tuple< NamedParametersOut0, NamedParametersOut1, NamedParametersOut2, NamedParametersOut3 > &nps_out)
 
template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 , class NamedParametersOut >
bool CGAL::Polygon_mesh_processing::corefine_and_compute_union (TriangleMesh &tm1, TriangleMesh &tm2, TriangleMesh &tm_out, const NamedParameters1 &np1, const NamedParameters2 &np2, const NamedParametersOut &np_out)
 
template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 , class NamedParametersOut >
bool CGAL::Polygon_mesh_processing::corefine_and_compute_intersection (TriangleMesh &tm1, TriangleMesh &tm2, TriangleMesh &tm_out, const NamedParameters1 &np1, const NamedParameters2 &np2, const NamedParametersOut &np_out)
 
template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 , class NamedParametersOut >
bool CGAL::Polygon_mesh_processing::corefine_and_compute_difference (TriangleMesh &tm1, TriangleMesh &tm2, TriangleMesh &tm_out, const NamedParameters1 &np1, const NamedParameters2 &np2, const NamedParametersOut &np_out)
 
template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 >
void CGAL::Polygon_mesh_processing::corefine (TriangleMesh &tm1, TriangleMesh &tm2, const NamedParameters1 &np1, const NamedParameters2 &np2)
 
template<class OutputIterator , class TriangleMesh , class NamedParameters1 , class NamedParameters2 >
OutputIterator CGAL::Polygon_mesh_processing::surface_intersection (const TriangleMesh &tm1, const TriangleMesh &tm2, OutputIterator polyline_output, const NamedParameters1 &np1, const NamedParameters2 &np2)
 

Enumeration Type Documentation

◆ Boolean_operation_type

#include <CGAL/Polygon_mesh_processing/corefinement.h>

Integer identifiers to refer to a particular Boolean operation in the function corefine_and_compute_boolean_operations().

Function Documentation

◆ clip() [1/3]

template<class TriangleMesh , class NamedParameters >
bool CGAL::Polygon_mesh_processing::clip ( TriangleMesh &  tm,
const Iso_cuboid_3 iso_cuboid,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/clip.h>

clips tm by keeping the part that is inside iso_cuboid. If tm is closed, the clipped part can be closed too if the named parameter clip_volume is set to true. See Subsection Clipping for more details.

Note
In the current implementation it is not possible to set the vertex point map and the default will be used. Iso_cuboid_3 must be from the same Kernel as the point of the vertex point map.
Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph. An internal property map for CGAL::vertex_point_t must be available.
NamedParametersa sequence of Named Parameters
Parameters
tminput triangulated surface mesh
iso_cuboidiso-cuboid used to clip tm.
npoptional sequence of Named Parameters among the ones listed below
Named Parameters
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces.
throw_on_self_intersectionif true, the set of triangles closed to the intersection of tm and iso_cuboid will be checked for self-intersections and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found.
clip_volumeif true and tm is closed, the clipping will be done on the volume bounded by tm rather than on its surface (i.e., tm will be kept closed).
use_compact_clipperif false and clip_volume is false and tm is open, the parts of tm coplanar with is_cuboid will not be part of the output.
Returns
true if the output surface mesh is manifold. If false is returned tm is only refined by the intersection with iso_cuboid.

◆ clip() [2/3]

template<class TriangleMesh , class NamedParameters >
bool CGAL::Polygon_mesh_processing::clip ( TriangleMesh &  tm,
const Plane_3 plane,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/clip.h>

clips tm by keeping the part that is on the negative side of plane (side opposite to its normal vector). If tm is closed, the clipped part can be closed too if the named parameter clip_volume is set to true. See Subsection Clipping for more details.

Note
In the current implementation it is not possible to set the vertex point map and the default will be used. Plane_3 must be from the same Kernel as the point of the vertex point map.
Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph. An internal property map for CGAL::vertex_point_t must be available.
NamedParametersa sequence of Named Parameters
Parameters
tminput triangulated surface mesh
planeplane whose negative side defines the half-space to intersect tm with. Plane_3 is the plane type for the same CGAL kernel as the point of the vertex point map of tm.
npoptional sequence of Named Parameters among the ones listed below
Named Parameters
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces.
throw_on_self_intersectionif true, the set of triangles closed to the intersection of tm and plane will be checked for self-intersections and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found. Default value is false.
clip_volumeif true and tm is closed, the clipping will be done on the volume bounded by tm rather than on its surface (i.e., tm will be kept closed). Default value is false.
use_compact_clipperif false the parts of tm coplanar with plane will not be part of the output. Default value is true.
Returns
true if the output surface mesh is manifold. If false is returned tm is only refined by the intersection with plane.

◆ clip() [3/3]

template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 >
bool CGAL::Polygon_mesh_processing::clip ( TriangleMesh &  tm,
TriangleMesh &  clipper,
const NamedParameters1 &  np_tm,
const NamedParameters2 &  np_c 
)

#include <CGAL/Polygon_mesh_processing/clip.h>

clips tm by keeping the part that is inside the volume bounded by clipper. If tm is closed, the clipped part can be closed too if the named parameter clip_volume is set to true. See Subsection Clipping for more details.

Attention
With the current implementation, clipper will be modified (refined with the intersection with tm).
Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm)
!CGAL::Polygon_mesh_processing::does_self_intersect(clipper)
CGAL::Polygon_mesh_processing::does_bound_a_volume(clipper)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph.
NamedParameters1a sequence of Named Parameters
NamedParameters2a sequence of Named Parameters
Parameters
tminput triangulated surface mesh
clippertriangulated surface mesh used to clip tm
np_tmoptional sequence of Named Parameters among the ones listed below
np_coptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm (clipper). If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh
face_index_mapa property map containing a unique index for each face of tm (clipper).
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces.
throw_on_self_intersectionif true, the set of triangles closed to the intersection of tm and clipper will be checked for self-intersections and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found. Default value is false.
clip_volumeif true and tm is closed, the clipping will be done on the volume bounded by tm rather than on its surface (i.e., tm will be kept closed). Default value is false.
use_compact_clipperif false, the parts of tm coplanar with clipper will not be part of the output. Default value is true.
Returns
true if the output surface mesh is manifold. If false is returned tm and clipper are only corefined.

◆ corefine()

template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 >
void CGAL::Polygon_mesh_processing::corefine ( TriangleMesh &  tm1,
TriangleMesh &  tm2,
const NamedParameters1 &  np1,
const NamedParameters2 &  np2 
)

#include <CGAL/Polygon_mesh_processing/corefinement.h>

corefines tm1 and tm2. For each input triangulated surface mesh, if a constrained edge is provided, intersection edges will be marked as constrained. If an edge that was marked as constrained is split, its sub-edges will be marked as constrained as well.

Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm1)
!CGAL::Polygon_mesh_processing::does_self_intersect(tm2)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph
NamedParameters1a sequence of Named Parameters
NamedParameters2a sequence of Named Parameters
Parameters
tm1first input triangulated surface mesh
tm2second input triangulated surface mesh
np1optional sequence of Named Parameters among the ones listed below
np2optional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm1 (tm2). If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh
edge_is_constrained_mapa property map containing the constrained-or-not status of each edge of tm1 (tm2)
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces (np1 only)
throw_on_self_intersectionif true, for each input triangle mesh, the set of triangles close to the intersection of tm1 and tm2 will be checked for self-intersection and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found (np1 only).

◆ corefine_and_compute_boolean_operations()

template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 , class NamedParametersOut0 , class NamedParametersOut1 , class NamedParametersOut2 , class NamedParametersOut3 >
std::array<bool,4> CGAL::Polygon_mesh_processing::corefine_and_compute_boolean_operations ( TriangleMesh &  tm1,
TriangleMesh &  tm2,
const std::array< boost::optional< TriangleMesh * >, 4 > &  output,
const NamedParameters1 &  np1,
const NamedParameters2 &  np2,
const std::tuple< NamedParametersOut0, NamedParametersOut1, NamedParametersOut2, NamedParametersOut3 > &  nps_out 
)

#include <CGAL/Polygon_mesh_processing/corefinement.h>

corefines tm1 and tm2 and for each triangle mesh tm_out passed as an optional in output different from boost::none, the triangulated surface mesh bounding the result of a particular Boolean operation between the volumes bounded by tm1 and tm2 will be put in the corresponding triangle mesh. The positions of the meshes in the array output are specific to the Boolean operation to compute and Corefinement::Boolean_operation_type encodes and describes the ordering. Constructing the default array means that no Boolean operation will be done. Overwriting a default value will trigger the corresponding operation. In such a case, the address to a valid surface mesh must be provided. The optional named parameters for all output meshes are provided as a tuple and follow the same order as the array output. A call to corefine_and_compute_boolean_operations() with optional named parameters passed for output meshes should be done using make_tuple() as the types of named parameters are unspecified.

If tm1 and/or tm2 are part of the output surface meshes, they will be updated to contain the output (in-place operation), in any other case, the corresponding result will be inserted into the mesh without clearing it first.

Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm1)
!CGAL::Polygon_mesh_processing::does_self_intersect(tm2)
CGAL::Polygon_mesh_processing::does_bound_a_volume(tm1)
CGAL::Polygon_mesh_processing::does_bound_a_volume(tm2)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph
NamedParameters1a sequence of Named Parameters
NamedParameters2a sequence of Named Parameters
NamedParametersOut0a sequence of Named Parameters for computing the union of the volumes bounded by tm1 and tm2
NamedParametersOut1a sequence of Named Parameters for computing the intersection of the volumes bounded by tm1 and tm2
NamedParametersOut2a sequence of Named Parameters for computing the difference of the volumes bounded by tm1 and tm2
NamedParametersOut3a sequence of Named Parameters for computing the difference of the volumes bounded by tm2 and tm1
Parameters
tm1first input triangulated surface mesh
tm2second input triangulated surface mesh
outputan array of output surface meshes
np1optional sequence of Named Parameters among the ones listed below
np2optional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm1 (tm2). If this parameter is omitted, an internal property map for CGAL::vertex_point_t should be available in TriangleMesh
edge_is_constrained_mapa property map containing the constrained-or-not status of each edge of tm1 (tm2).
face_index_mapa property map containing the index of each face of tm1 (tm2). Note that if the property map is writable, the indices of the faces of tm1 and tm2 will be set after the corefinement is done.
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces (np1 only)
throw_on_self_intersectionif true, for each input triangle mesh, the set of triangles close to the intersection of tm1 and tm2 will be checked for self-intersection and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found (np1 only).
Parameters
nps_outtuple of optional sequences of Named Parameters each among the ones listed below (tm_out being used to refer to the output surface mesh in output corresponding to a given named parameter sequence)
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm_out. If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh
edge_is_constrained_mapa property map containing the constrained-or-not status of each edge of tm_out. An edge of tm_out is constrained if it is on the intersection of tm1 and tm2, or if the edge corresponds to a constrained edge in tm1 or tm2.
Returns
an array filled as follows: for each operation computed, the position in the array will contain true iff the output surface mesh is manifold, and it is put in the surface mesh at the same position as in output. Note that if an output surface mesh also was an input mesh but the output operation was generating a non-manifold mesh, the surface mesh will only be corefined.
Examples
Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp.

◆ corefine_and_compute_difference()

template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 , class NamedParametersOut >
bool CGAL::Polygon_mesh_processing::corefine_and_compute_difference ( TriangleMesh &  tm1,
TriangleMesh &  tm2,
TriangleMesh &  tm_out,
const NamedParameters1 &  np1,
const NamedParameters2 &  np2,
const NamedParametersOut &  np_out 
)

#include <CGAL/Polygon_mesh_processing/corefinement.h>

corefines tm1 and tm2 and puts in tm_out a triangulated surface mesh bounding the volume bounded by tm1 minus the volume bounded by tm2. corefines tm1 and tm2 and puts in tm_out a triangulated surface mesh bounding the union of the volumes bounded by tm1 and tm2. If tm_out is one of the input surface meshes, it will be updated to contain the output (in-place operation), otherwise the result will be inserted into tm_out without clearing it first.

Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm1)
!CGAL::Polygon_mesh_processing::does_self_intersect(tm2)
CGAL::Polygon_mesh_processing::does_bound_a_volume(tm1)
CGAL::Polygon_mesh_processing::does_bound_a_volume(tm2)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph
NamedParameters1a sequence of Named Parameters
NamedParameters2a sequence of Named Parameters
NamedParametersOuta sequence of Named Parameters
Parameters
tm1first input triangulated surface mesh
tm2second input triangulated surface mesh
tm_outoutput surface mesh
np1optional sequence of Named Parameters among the ones listed below
np2optional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm1 (tm2). If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh
edge_is_constrained_mapa property map containing the constrained-or-not status of each edge of tm1 (tm2).
face_index_mapa property map containing the index of each face of tm1 (tm2). Note that if the property map is writable, the indices of the faces of tm1 and tm2 will be set after the corefinement is done.
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces (np1 only)
throw_on_self_intersectionif true, for each input triangle mesh, the set of triangles close to the intersection of tm1 and tm2 will be checked for self-intersection and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found (np1 only).
Parameters
np_outoptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm_out. If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh
edge_is_constrained_mapa property map containing the constrained-or-not status of each edge of tm_out. An edge of tm_out is constrained if it is on the intersection of tm1 and tm2, or if the edge corresponds to a constrained edge in tm1 or tm2.
Returns
true if the output surface mesh is manifold and is put into tm_out. If false is returned and if tm_out is one of the input surface meshes, then tm_out is only corefined.
Examples
Polygon_mesh_processing/corefinement_difference_remeshed.cpp.

◆ corefine_and_compute_intersection()

template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 , class NamedParametersOut >
bool CGAL::Polygon_mesh_processing::corefine_and_compute_intersection ( TriangleMesh &  tm1,
TriangleMesh &  tm2,
TriangleMesh &  tm_out,
const NamedParameters1 &  np1,
const NamedParameters2 &  np2,
const NamedParametersOut &  np_out 
)

#include <CGAL/Polygon_mesh_processing/corefinement.h>

corefines tm1 and tm2 and puts in tm_out a triangulated surface mesh bounding the intersection of the volumes bounded by tm1 and tm2. corefines tm1 and tm2 and puts in tm_out a triangulated surface mesh bounding the union of the volumes bounded by tm1 and tm2. If tm_out is one of the input surface meshes, it will be updated to contain the output (in-place operation), otherwise the result will be inserted into tm_out without clearing it first.

Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm1)
!CGAL::Polygon_mesh_processing::does_self_intersect(tm2)
CGAL::Polygon_mesh_processing::does_bound_a_volume(tm1)
CGAL::Polygon_mesh_processing::does_bound_a_volume(tm2)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph
NamedParameters1a sequence of Named Parameters
NamedParameters2a sequence of Named Parameters
NamedParametersOuta sequence of Named Parameters
Parameters
tm1first input triangulated surface mesh
tm2second input triangulated surface mesh
tm_outoutput surface mesh
np1optional sequence of Named Parameters among the ones listed below
np2optional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm1 (tm2). If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh
edge_is_constrained_mapa property map containing the constrained-or-not status of each edge of tm1 (tm2).
face_index_mapa property map containing the index of each face of tm1 (tm2). Note that if the property map is writable, the indices of the faces of tm1 and tm2 will be set after the corefinement is done.
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces (np1 only)
throw_on_self_intersectionif true, for each input triangle mesh, the set of triangles close to the intersection of tm1 and tm2 will be checked for self-intersection and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found (np1 only).
Parameters
np_outoptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm_out. If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh
edge_is_constrained_mapa property map containing the constrained-or-not status of each edge of tm_out. An edge of tm_out is constrained if it is on the intersection of tm1 and tm2, or if the edge corresponds to a constrained edge in tm1 or tm2.
Returns
true if the output surface mesh is manifold and is put into tm_out. If false is returned and if tm_out is one of the input surface meshes, then tm_out is only corefined.
Examples
Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp.

◆ corefine_and_compute_union()

template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 , class NamedParametersOut >
bool CGAL::Polygon_mesh_processing::corefine_and_compute_union ( TriangleMesh &  tm1,
TriangleMesh &  tm2,
TriangleMesh &  tm_out,
const NamedParameters1 &  np1,
const NamedParameters2 &  np2,
const NamedParametersOut &  np_out 
)

#include <CGAL/Polygon_mesh_processing/corefinement.h>

corefines tm1 and tm2 and puts in tm_out a triangulated surface mesh bounding the union of the volumes bounded by tm1 and tm2. If tm_out is one of the input surface meshes, it will be updated to contain the output (in-place operation), otherwise the result will be inserted into tm_out without clearing it first.

Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm1)
!CGAL::Polygon_mesh_processing::does_self_intersect(tm2)
CGAL::Polygon_mesh_processing::does_bound_a_volume(tm1)
CGAL::Polygon_mesh_processing::does_bound_a_volume(tm2)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph
NamedParameters1a sequence of Named Parameters
NamedParameters2a sequence of Named Parameters
NamedParametersOuta sequence of Named Parameters
Parameters
tm1first input triangulated surface mesh
tm2second input triangulated surface mesh
tm_outoutput surface mesh
np1optional sequence of Named Parameters among the ones listed below
np2optional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm1 (tm2). If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh
edge_is_constrained_mapa property map containing the constrained-or-not status of each edge of tm1 (tm2).
face_index_mapa property map containing the index of each face of tm1 (tm2). Note that if the property map is writable, the indices of the faces of tm1 and tm2 will be set after the corefinement is done.
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces (np1 only)
throw_on_self_intersectionif true, for each input triangle mesh, the set of triangles close to the intersection of tm1 and tm2 will be checked for self-intersection and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found (np1 only).
Parameters
np_outoptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm_out. If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh
edge_is_constrained_mapa property map containing the constrained-or-not status of each edge of tm_out. An edge of tm_out is constrained if it is on the intersection of tm1 and tm2, or if the edge corresponds to a constrained edge in tm1 or tm2.
Returns
true if the output surface mesh is manifold and is put into tm_out. If false is returned and if tm_out is one of the input surface meshes, then tm_out is only corefined.
Examples
Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp, and Polygon_mesh_processing/corefinement_mesh_union.cpp.

◆ split() [1/3]

template<class TriangleMesh , class NamedParameters >
void CGAL::Polygon_mesh_processing::split ( TriangleMesh &  tm,
const Iso_cuboid_3 iso_cuboid,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/clip.h>

adds intersection edges of iso_cuboid and tm in tm and duplicates those edges.

Note
In the current implementation it is not possible to set the vertex point map and the default will be used.
Iso_cuboid_3 must be from the same Kernel as the point of the vertex point map.
Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph An internal property map for CGAL::vertex_point_t must be available.
NamedParametersa sequence of Named Parameters
Parameters
tminput triangulated surface mesh
iso_cuboidiso-cuboid used to split tm.
npoptional sequence of Named Parameters among the ones listed below
Named Parameters
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces.
throw_on_self_intersectionif true, the set of triangles closed to the intersection of tm and iso_cuboid will be checked for self-intersections and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found.

◆ split() [2/3]

template<class TriangleMesh , class NamedParameters >
void CGAL::Polygon_mesh_processing::split ( TriangleMesh &  tm,
const Plane_3 plane,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/clip.h>

adds intersection edges of plane and tm in tm and duplicates those edges.

Note
In the current implementation it is not possible to set the vertex point map and the default will be used.
Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph An internal property map for CGAL::vertex_point_t must be available.
NamedParametersa sequence of Named Parameters
Parameters
tminput triangulated surface mesh
planethe plane that will be used to split tm. Plane_3 is the plane type for the same CGAL kernel as the point of the vertex point map of tm.
npoptional sequence of Named Parameters among the ones listed below
Named Parameters
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces.
throw_on_self_intersectionif true, the set of triangles closed to the intersection of tm and plane will be checked for self-intersections and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found.

◆ split() [3/3]

template<class TriangleMesh , class NamedParameters1 , class NamedParameters2 >
void CGAL::Polygon_mesh_processing::split ( TriangleMesh &  tm,
TriangleMesh &  splitter,
const NamedParameters1 &  np_tm,
const NamedParameters2 &  np_s 
)

#include <CGAL/Polygon_mesh_processing/clip.h>

corefines tm and splitter and duplicates edges in tm that are on the intersection with splitter.

Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm)
!CGAL::Polygon_mesh_processing::does_self_intersect(splitter)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph.
NamedParameters1a sequence of Named Parameters
NamedParameters2a sequence of Named Parameters
Parameters
tminput triangulated surface mesh
splittertriangulated surface mesh used to split tm
np_tmoptional sequence of Named Parameters among the ones listed below
np_soptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of tm (splitter). If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh
visitora class model of PMPCorefinementVisitor that is used to track the creation of new faces.
throw_on_self_intersectionif true, the set of triangles closed to the intersection of tm and splitter will be checked for self-intersections and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found.

◆ surface_intersection()

template<class OutputIterator , class TriangleMesh , class NamedParameters1 , class NamedParameters2 >
OutputIterator CGAL::Polygon_mesh_processing::surface_intersection ( const TriangleMesh &  tm1,
const TriangleMesh &  tm2,
OutputIterator  polyline_output,
const NamedParameters1 &  np1,
const NamedParameters2 &  np2 
)

#include <CGAL/Polygon_mesh_processing/intersection.h>

computes the intersection of triangles of tm1 and tm2. The output is a set of polylines with all vertices but endpoints being of degree 2.

Precondition
!CGAL::Polygon_mesh_processing::does_self_intersect(tm1)
!CGAL::Polygon_mesh_processing::does_self_intersect(tm2)
Template Parameters
TriangleMesha model of MutableFaceGraph, HalfedgeListGraph and FaceListGraph
NamedParameters1a sequence of Named Parameters
NamedParameters2a sequence of Named Parameters
OutputIteratoran output iterator in which std::vector of points can be put. The point type is the one from the vertex property map
Parameters
tm1first input triangulated surface mesh
tm2second input triangulated surface mesh
polyline_outputoutput iterator of polylines. Each polyline will be given as a vector of points
np1optional sequence of Named Parameters among the ones listed below
np2optional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapa property map with the points associated to the vertices of tm1 (tm2). The two property map types must be the same.
throw_on_self_intersectionif true, for each input triangle mesh, the set of triangles close to the intersection of tm1 and tm2 will be checked for self-intersection and CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception will be thrown if at least one is found (np1 only).