CGAL 6.1.2 - Polygon Mesh Processing: Corefinement and Boolean Operations

CGAL 6.1.2 - Polygon Mesh Processing

Loading...
Searching...
No Matches
Classes | Enumerations | Functions
Corefinement and Boolean Operations
Reference Manual

##

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::Autorefinement::Default_visitor
struct | CGAL::Polygon_mesh_processing::Corefinement::Default_visitor< TriangleMesh >
struct | CGAL::Polygon_mesh_processing::Corefinement::Non_manifold_output_visitor< TriangleMesh, VPM1, VPM2 >

## Enumerations
enum | CGAL::Polygon_mesh_processing::Corefinement::Boolean_operation_type { UNION = 0 , INTERSECTION =1 , TM1_MINUS_TM2 =2 , TM2_MINUS_TM1 =3 , NONE }
| Integer identifiers to refer to a particular Boolean operation in the function `corefine_and_compute_boolean_operations()`.

## Functions
template<class PointRange , class TriangleRange , class NamedParameters = parameters::Default_named_parameters>
bool | CGAL::Polygon_mesh_processing::autorefine_triangle_soup (PointRange &soup_points, TriangleRange &soup_triangles, const NamedParameters &np=parameters::default_values())
| refines a soup of triangles so that no pair of triangles intersects.
template<class TriangleMesh , class NamedParameters = parameters::Default_named_parameters>
void | CGAL::Polygon_mesh_processing::autorefine (TriangleMesh &tm, const NamedParameters &np=parameters::default_values())
| refines a triangle mesh so that no triangles intersects in their interior.
template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>
bool | CGAL::Polygon_mesh_processing::clip (TriangleMesh &tm, TriangleMesh &clipper, const NamedParameters1 &np_tm=parameters::default_values(), const NamedParameters2 &np_c=parameters::default_values())
| clips `tm` by keeping the part that is inside the volume bounded by `clipper`.
template<class PolygonMesh , class NamedParameters = parameters::Default_named_parameters>
bool | CGAL::Polygon_mesh_processing::clip (PolygonMesh &pm, const Plane_3 &plane, const NamedParameters &np=parameters::default_values())
| clips `pm` by keeping the part that is on the negative side of `plane` (the side opposite to its normal vector).
template<class TriangleMesh , class NamedParameters = parameters::Default_named_parameters>
bool | CGAL::Polygon_mesh_processing::clip (TriangleMesh &tm, const Iso_cuboid_3 &iso_cuboid, const NamedParameters &np=parameters::default_values())
| clips `tm` by keeping the part that is inside `iso_cuboid`.
template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>
void | CGAL::Polygon_mesh_processing::split (TriangleMesh &tm, TriangleMesh &splitter, const NamedParameters1 &np_tm=parameters::default_values(), const NamedParameters2 &np_s=parameters::default_values())
| corefines `tm` and `splitter` and duplicates edges in `tm` that are on the intersection with `splitter`.
template<class PolygonMesh , class NamedParameters = parameters::Default_named_parameters>
void | CGAL::Polygon_mesh_processing::split (PolygonMesh &pm, const Plane_3 &plane, const NamedParameters &np=parameters::default_values())
| splits a polygon mesh with a plane.
template<class TriangleMesh , class NamedParameters = parameters::Default_named_parameters>
void | CGAL::Polygon_mesh_processing::split (TriangleMesh &tm, const Iso_cuboid_3 &iso_cuboid, const NamedParameters &np=parameters::default_values())
| adds intersection edges of `iso_cuboid` and `tm` in `tm` and duplicates those edges.
template<class TriangleMesh , class NPIn1 = parameters::Default_named_parameters, class NPIn2 = parameters::Default_named_parameters, class NPOut0 = parameters::Default_named_parameters, class NPOut1 = parameters::Default_named_parameters, class NPOut2 = parameters::Default_named_parameters, class NPOut3 = parameters::Default_named_parameters>
std::array< bool, 4 > | CGAL::Polygon_mesh_processing::corefine_and_compute_boolean_operations (TriangleMesh &tm1, TriangleMesh &tm2, const std::array< std::optional< TriangleMesh * >, 4 > &output, const NPIn1 &np1=parameters::default_values(), const NPIn2 &np2=parameters::default_values(), const std::tuple< NPOut0, NPOut1, NPOut2, NPOut3 > &nps_out=std::tuple< NPOut0, NPOut1, NPOut2, NPOut3 >())
| corefines `tm1` and `tm2` and for each triangle mesh `tm_out` passed as an optional in `output` different from `std::nullopt`, 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.
template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters, class NamedParametersOut = parameters::Default_named_parameters>
bool | CGAL::Polygon_mesh_processing::corefine_and_compute_union (TriangleMesh &tm1, TriangleMesh &tm2, TriangleMesh &tm_out, const NamedParameters1 &np1=parameters::default_values(), const NamedParameters2 &np2=parameters::default_values(), const NamedParametersOut &np_out=parameters::default_values())
| corefines `tm1` and `tm2` and puts in `tm_out` a triangulated surface mesh bounding the union of the volumes bounded by `tm1` and `tm2`.
template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters, class NamedParametersOut = parameters::Default_named_parameters>
bool | CGAL::Polygon_mesh_processing::corefine_and_compute_intersection (TriangleMesh &tm1, TriangleMesh &tm2, TriangleMesh &tm_out, const NamedParameters1 &np1=parameters::default_values(), const NamedParameters2 &np2=parameters::default_values(), const NamedParametersOut &np_out=parameters::default_values())
| corefines `tm1` and `tm2` and puts in `tm_out` a triangulated surface mesh bounding the intersection of the volumes bounded by `tm1` and `tm2`.
template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters, class NamedParametersOut = parameters::Default_named_parameters>
bool | CGAL::Polygon_mesh_processing::corefine_and_compute_difference (TriangleMesh &tm1, TriangleMesh &tm2, TriangleMesh &tm_out, const NamedParameters1 &np1=parameters::default_values(), const NamedParameters2 &np2=parameters::default_values(), const NamedParametersOut &np_out=parameters::default_values())
| 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`.
template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>
void | CGAL::Polygon_mesh_processing::corefine (TriangleMesh &tm1, TriangleMesh &tm2, const NamedParameters1 &np1=parameters::default_values(), const NamedParameters2 &np2=parameters::default_values())
| corefines `tm1` and `tm2`.
template<class OutputIterator , class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>
OutputIterator | CGAL::Polygon_mesh_processing::surface_intersection (const TriangleMesh &tm1, const TriangleMesh &tm2, OutputIterator polyline_output, const NamedParameters1 &np1=parameters::default_values(), const NamedParameters2 &np2=parameters::default_values())
| computes the intersection of triangles of `tm1` and `tm2`.
template<class PolygonMesh , class Plane_3 , class NamedParameters = parameters::Default_named_parameters>
void | CGAL::Polygon_mesh_processing::refine_with_plane (PolygonMesh &pm, const Plane_3 &plane, const NamedParameters &np=parameters::default_values())
| refines `pm` by inserting new vertices and new edges at the intersection of `plane` with `pm`.

## Function Documentation

## ◆ autorefine()

template<class TriangleMesh , class NamedParameters = parameters::Default_named_parameters>

void CGAL::Polygon_mesh_processing::autorefine | ( | TriangleMesh & | tm,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/Polygon_mesh_processing/autorefinement.h>`

refines a triangle mesh so that no triangles intersects in their interior.

Note that this function is only provided as a shortcut for calling `autorefine_triangle_soup()` with a mesh. For any advance usage the aforementioned function should be called directly.

Template Parameters

  TriangleMesh | a model of `HalfedgeListGraph`, `FaceListGraph`, and `MutableFaceGraph`
  NamedParameters | a sequence of Named Parameters

Parameters

  tm | input triangulated surface mesh
  np | an optional sequence of Named Parameters among the ones listed below

Warning
  `clear(tm)` will be called before filling `tm` with the refined mesh.

Optional Named Parameters

  a tag indicating if the task should be done using one or several threads. Type: Either `CGAL::Sequential_tag`, or `CGAL::Parallel_tag`, or `CGAL::Parallel_if_available_tag` Default: `CGAL::Sequential_tag` |
  an instance of a geometric traits class Type: a class model of `PMPSelfIntersectionTraits` Default: a CGAL Kernel deduced from the point type, using `CGAL::Kernel_traits` Extra: The geometric traits class must be compatible with the vertex point type. |
  a property map associating points to the vertices of `tm` Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm)` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |

## ◆ autorefine_triangle_soup()

template<class PointRange , class TriangleRange , class NamedParameters = parameters::Default_named_parameters>

bool CGAL::Polygon_mesh_processing::autorefine_triangle_soup | ( | PointRange & | soup_points,
|  | TriangleRange & | soup_triangles,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/Polygon_mesh_processing/autorefinement.h>`

refines a soup of triangles so that no pair of triangles intersects.

Output triangles may share a common edge or a common vertex (but with the same indexed position in `points`). Note that if `apply_iterative_snap_rounding` option is set to `false`, points in `soup_points` can only be added (intersection points) at the end of the container, with the initial order preserved. Note that if `soup_points` contains two or more identical points then only the first copy (following the order in the `soup_points`) will be used in `soup_triangles`. if `apply_iterative_snap_rounding` is set to `true`, all duplicates points are removed. `soup_triangles` will be updated to contain both the input triangles and the new subdivided triangles. Degenerate triangles will be removed. Also if `apply_iterative_snap_rounding` option is set to `false`, triangles in `soup_triangles` will be triangles without intersection first, followed by triangles coming from a subdivision induced by an intersection. The named parameter `visitor()` can be used to track the creation and removal of triangles independently of the `apply_iterative_snap_rounding` option. If the `apply_iterative_snap_rounding` parameter is set to `true`, the coordinates of the vertices are rounded to fit within the precision of a double-precision floating point, while trying to make the triangle soup free of intersections. The `snap_grid_size()` parameter limits the drift of the snapped vertices. A smaller value is more likely to output an intersection free output and perform more vertex collapses, but it may increase the Hausdorff distance from the input.

Template Parameters

  PointRange | a model of the concept `RandomAccessContainer` whose value type is the point type
  TriangleRange | a model of the concepts `RandomAccessContainer`, `BackInsertionSequence` and `Swappable`, whose value type is a model of the concept `RandomAccessContainer` whose value type is convertible to `std::size_t` and that is constructible from an `std::initializer_list<std::size_t>` of size 3.
  NamedParameters | a sequence of Named Parameters

Parameters

  soup_points | points of the soup of polygons
  soup_triangles | each element in the range describes a triangle using the indexed position of the points in `soup_points`
  np | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a tag indicating if the task should be done using one or several threads. Type: Either `CGAL::Sequential_tag`, or `CGAL::Parallel_tag`, or `CGAL::Parallel_if_available_tag` Default: `CGAL::Sequential_tag` |
  a property map associating points to the elements of the range `soup_points` Type: a model of `ReadWritePropertyMap` whose value type is a point type Default: `CGAL::Identity_property_map` |
  an instance of a geometric traits class Type: a class model of `Kernel` Default: a CGAL Kernel deduced from the point type, using `CGAL::Kernel_traits` Extra: The geometric traits class must be compatible with the point type. |
  a visitor used to track the creation of new faces Type: a class model of `PMPAutorefinementVisitor` Default: `Autorefinement::Default_visitor` Extra: The visitor will be copied. |
  Enable the rounding of the coordinates so that they fit in doubles. Type: Boolean Default: false |
  A value `gs` used to scale the points to `[-2^gs, 2^gs]` before rounding them on integers. Used only if `apply_iterative_snap_rounding()` is set to `true` Type: `unsigned int` Default: 23 Extra: Must be lower than 52. |
  Maximum number of iterations performed by the snap rounding algorithm. Used only if `apply_iterative_snap_rounding` is true. Type: unsigned int Default: 5 |

Returns
  `true` if `apply_iterative_snap_rounding` is set to `false`. Otherwise, returns `true` if the modified triangle soup is free of self-intersections, or `false` if the algorithm was unable to produce such a result within the allowed number of iterations. In the latter case, the output triangle soup represents a partial result from the final iteration, with no guarantee of its validity.

## ◆ clip() [1/3]

template<class PolygonMesh , class NamedParameters = parameters::Default_named_parameters>

bool CGAL::Polygon_mesh_processing::clip | ( | PolygonMesh & | pm,
|  | const Plane_3 & | plane,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/Polygon_mesh_processing/clip.h>`

clips `pm` by keeping the part that is on the negative side of `plane` (the side opposite to its normal vector).

If `pm` is closed, the clipped part can be kept closed by setting the named parameter `clip_volume`to `true`. See Subsection Clipping for more details.

Template Parameters

  PolygonMesh | a model of `MutableFaceGraph`, `HalfedgeListGraph` and `FaceListGraph`. An internal property map for `CGAL::vertex_point_t` must be available.
  NamedParameters | a sequence of Named Parameters

Parameters

  pm | input surface mesh
  plane | plane whose negative side defines the halfspace to intersect `pm` with. `Plane_3` is the plane type for the same CGAL kernel as the point of the vertex point map of `pm`.
  np | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a tag indicating if the task should be performed using one or several threads. Type: Either `CGAL::Sequential_tag`, or `CGAL::Parallel_tag`, or `CGAL::Parallel_if_available_tag` Default: `CGAL::Sequential_tag` |
  a property map associating points to the vertices of `pm` Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, pm)` |
  a visitor used to track the creation of new faces, edges, and faces. Note that as there are no mesh associated with `plane`, `boost::graph_traits<PolygonMesh>::null_halfedge()` and `boost::graph_traits<PolygonMesh>::null_face()` will be used when calling functions of the visitor expecting a halfedge or a face from `plane`. Similarly, `pm` will be used as the mesh of `plane`. Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<PolygonMesh>` |
  If `true`, the set of triangles close to the intersection of `pm` and `plane` will be checked for self-intersections and `CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception` will be thrown if at least one self-intersection is found. This option is only taken into account if `pm` is a triangle mesh. Type: Boolean Default: `false` |
  If `true`, self-intersections in `pm` are accepted. Type: Boolean Default: `false` Extra: If this option is set to `true`, `pm` is no longer required to be without self-intersection. Setting this option to `true` will automatically set `throw_on_self_intersection` to `false` and `clip_volume` to `false` (overwriting any value provided) |
  If `true`, and if `pm` is closed, the clipping will be done on the volume bounded by `pm` rather than on its surface (i.e., `pm` will remain closed). Type: Boolean Default: `false` |
  If `false`, the parts of `pm` coplanar with `plane` will not be part of the output. Always `true` if `clip_volume` is `true`. Type: Boolean Default: `true` |
  If the input mesh is triangulated and this parameter is set to `false`, the mesh will be kept triangulated. Always `true` if `pm` is not a triangle mesh. Type: Boolean Default: `false` |

Returns
  `true`

See also
  `split()`

## ◆ clip() [2/3]

template<class TriangleMesh , class NamedParameters = parameters::Default_named_parameters>

bool CGAL::Polygon_mesh_processing::clip | ( | TriangleMesh & | tm,
|  | const Iso_cuboid_3 & | iso_cuboid,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#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 kept closed by setting the named parameter `clip_volume` to `true`. See Subsection Clipping for more details.

Note
  `Iso_cuboid_3` must be from the same kernel as the point of the internal vertex point map of `TriangleMesh`.
  `Iso_cuboid_3` must be from the same kernel as the point of the vertex point map of `tm`.

Precondition
  `!CGAL::Polygon_mesh_processing::does_self_intersect(tm)`

Template Parameters

  TriangleMesh | a model of `MutableFaceGraph`, `HalfedgeListGraph` and `FaceListGraph`. An internal property map for `CGAL::vertex_point_t` must be available.
  NamedParameters | a sequence of Named Parameters

Parameters

  tm | input triangulated surface mesh
  iso_cuboid | iso-cuboid used to clip `tm`.
  np | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a visitor used to track the creation of new faces Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<TriangleMesh>` |
  If `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). Type: Boolean Default: `false` |
  if `false` the parts of `tm` coplanar with `iso_cuboid` will not be part of the output Type: Boolean Default: `true` |
  If `true`, the set of triangles close 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 self-intersection is found. Type: Boolean Default: `false` |
  If `true`, self-intersections in `tm` are accepted. Type: Boolean Default: `false` Extra: If this option is set to `true`, `tm` is no longer required to be without self-intersection. Setting this option to `true` will automatically set `throw_on_self_intersection` to `false` and `clip_volume` to `false`. |

Returns
  `true` if the output surface mesh is manifold. If `false` is returned `tm` is only refined by the intersection with `iso_cuboid`.

See also
  `split()`

## ◆ clip() [3/3]

template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>

bool CGAL::Polygon_mesh_processing::clip | ( | TriangleMesh & | tm,
|  | TriangleMesh & | clipper,
|  | const NamedParameters1 & | np_tm = `parameters::default_values()`,
|  | const NamedParameters2 & | np_c = `parameters::default_values()`
| ) |  |

`#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 kept closed by setting the named parameter `clip_volume` 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

  TriangleMesh | a model of `MutableFaceGraph`, `HalfedgeListGraph` and `FaceListGraph`.
  NamedParameters1 | a sequence of Named Parameters
  NamedParameters2 | a sequence of Named Parameters

Parameters

  tm | input triangulated surface mesh
  clipper | triangulated surface mesh used to clip `tm`
  np_tm | an optional sequence of Named Parameters among the ones listed below
  np_c | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm` (resp. `clipper`) Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm (resp. clipper))` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  a property map associating to each face of `tm` (`clipper`) a unique index between `0` and `num_faces(tm (resp. clipper)) - 1` Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::face_descriptor` as key type and `std::size_t` as value type Default: an automatically indexed internal map Extra: if the property map is writable, the indices of the faces of `tm` and `clipper` will be set after refining `tm` with the intersection with `clipper` |
  a visitor used to track the creation of new faces Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<TriangleMesh>` |
  If `true`, the set of triangles close to the intersection of `tm` and `clipper` will be checked for self-intersections and `Corefinement::Self_intersection_exception` will be thrown if at least one self-intersection is found. Type: Boolean Default: `false` |
  If `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). Type: Boolean Default: `false` |
  if `false`, the parts of `tm` coplanar with `clipper` will not be part of the output. Type: Boolean Default: `true` Extra: This option has an effect only if a surface and not a volume is clipped, (i.e., if `clip_volume` is `false` or if `tm` is open). |
  (`np_c` only) if `true`, `clipper` will not be modified. Type: Boolean Default: `false` Extra: If this option is set to `true`, `tm` is no longer required to be without self-intersection. Setting this option to `true` will automatically set `throw_on_self_intersection` to `false` and `clip_volume` to `false`. |

Returns
  `true` if the output surface mesh is manifold. If `false` is returned `tm` and `clipper` are only corefined.

See also
  `split()`

## ◆ corefine()

template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>

void CGAL::Polygon_mesh_processing::corefine | ( | TriangleMesh & | tm1,
|  | TriangleMesh & | tm2,
|  | const NamedParameters1 & | np1 = `parameters::default_values()`,
|  | const NamedParameters2 & | np2 = `parameters::default_values()`
| ) |  |

`#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

  TriangleMesh | a model of `HalfedgeListGraph`, `FaceListGraph`, and `MutableFaceGraph`
  NamedParameters1 | a sequence of Named Parameters
  NamedParameters2 | a sequence of Named Parameters

Parameters

  tm1 | first input triangulated surface mesh
  tm2 | second input triangulated surface mesh
  np1 | an optional sequence of Named Parameters among the ones listed below
  np2 | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm1 (tm2))` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  a property map containing the constrained-or-not status of each edge of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::edge_descriptor` as key type and `bool` as value type Default: a constant property map returning `false` for any edge |
  a visitor used to track the creation of new faces Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<TriangleMesh>` Extra: `np1` only |
  If `true` the set of triangles close to the intersection of `tm1` and `tm2` will be checked for self-intersections and `Corefinement::Self_intersection_exception` will be thrown if at least one self-intersection is found. Type: Boolean Default: `false` Extra: `np1` only |
  if `true`, the corresponding mesh will not be updated. Type: Boolean Default: `false` Extra: If this parameter is set to `true` for both meshes nothing will be done. If this option is set to `true` for one mesh, the other mesh is no longer required to be without self-intersection. |

## ◆ corefine_and_compute_boolean_operations()

template<class TriangleMesh , class NPIn1 = parameters::Default_named_parameters, class NPIn2 = parameters::Default_named_parameters, class NPOut0 = parameters::Default_named_parameters, class NPOut1 = parameters::Default_named_parameters, class NPOut2 = parameters::Default_named_parameters, class NPOut3 = parameters::Default_named_parameters>

std::array< bool, 4 > CGAL::Polygon_mesh_processing::corefine_and_compute_boolean_operations | ( | TriangleMesh & | tm1,
|  | TriangleMesh & | tm2,
|  | const std::array< std::optional< TriangleMesh * >, 4 > & | output,
|  | const NPIn1 & | np1 = `parameters::default_values()`,
|  | const NPIn2 & | np2 = `parameters::default_values()`,
|  | const std::tuple< NPOut0, NPOut1, NPOut2, NPOut3 > & | nps_out = `std::tuple<NPOut0,NPOut1,NPOut2,NPOut3>()`
| ) |  |

`#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 `std::nullopt`, 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

  TriangleMesh | a model of `HalfedgeListGraph`, `FaceListGraph`, and `MutableFaceGraph`
  NPIn1 | a sequence of Named Parameters
  NPIn2 | a sequence of Named Parameters
  NPOut0 | a sequence of Named Parameters for computing the union of the volumes bounded by `tm1` and `tm2`
  NPOut1 | a sequence of Named Parameters for computing the intersection of the volumes bounded by `tm1` and `tm2`
  NPOut2 | a sequence of Named Parameters for computing the difference of the volumes bounded by `tm1` and `tm2`
  NPOut3 | a sequence of Named Parameters for computing the difference of the volumes bounded by `tm2` and `tm1`

Parameters

  tm1 | first input triangulated surface mesh
  tm2 | second input triangulated surface mesh
  output | an array of output surface meshes
  np1 | an optional sequence of Named Parameters among the ones listed below
  np2 | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm1 (tm2))` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  a property map containing the constrained-or-not status of each edge of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::edge_descriptor` as key type and `bool` as value type Default: a constant property map returning `false` for any edge |
  a property map associating to each face of `tm1` (`tm2`) a unique index between `0` and `num_faces(tm1) - 1` (`num_faces(tm2) - 1`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::face_descriptor` as key type and `std::size_t` as value type Default: an automatically indexed internal map Extra: If the property map is writable, the indices of the faces of `tm1` and `tm2` will be set after the corefinement is done. |
  a visitor used to track the creation of new faces Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<TriangleMesh>` Extra: `np1` only |
  If `true`, the set of triangles close to the intersection of `tm1` and `tm2` will be checked for self-intersections and `Corefinement::Self_intersection_exception` will be thrown if at least one self-intersection is found. Type: Boolean Default: `false` Extra: `np1` only |

Parameters

  nps_out | an optional tuple of 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)

Optional Named Parameters

  a property map associating points to the vertices of `tm_out` Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm_out)` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  a 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`. Type: a class model of `WritablePropertyMap` with `boost::graph_traits<TriangleMesh>::edge_descriptor` as key type and `bool` as value type |

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.

## ◆ corefine_and_compute_difference()

template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters, class NamedParametersOut = parameters::Default_named_parameters>

bool CGAL::Polygon_mesh_processing::corefine_and_compute_difference | ( | TriangleMesh & | tm1,
|  | TriangleMesh & | tm2,
|  | TriangleMesh & | tm_out,
|  | const NamedParameters1 & | np1 = `parameters::default_values()`,
|  | const NamedParameters2 & | np2 = `parameters::default_values()`,
|  | const NamedParametersOut & | np_out = `parameters::default_values()`
| ) |  |

`#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`.

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

  TriangleMesh | a model of `HalfedgeListGraph`, `FaceListGraph`, and `MutableFaceGraph`
  NamedParameters1 | a sequence of Named Parameters
  NamedParameters2 | a sequence of Named Parameters
  NamedParametersOut | a sequence of Named Parameters

Parameters

  tm1 | first input triangulated surface mesh
  tm2 | second input triangulated surface mesh
  tm_out | output surface mesh
  np1 | an optional sequence of Named Parameters among the ones listed below
  np2 | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm1 (tm2))` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  a property map containing the constrained-or-not status of each edge of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::edge_descriptor` as key type and `bool` as value type Default: a constant property map returning `false` for any edge |
  a property map associating to each face of `tm1` (`tm2`) a unique index between `0` and `num_faces(tm1) - 1` (`num_faces(tm2) - 1`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::face_descriptor` as key type and `std::size_t` as value type Default: an automatically indexed internal map Extra: If the property map is writable, the indices of the faces of `tm1` and `tm2` will be set after the corefinement is done. |
  a visitor used to track the creation of new faces Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<TriangleMesh>` Extra: `np1` only |
  If `true` the set of triangles close to the intersection of `tm1` and `tm2` will be checked for self-intersections and `Corefinement::Self_intersection_exception` will be thrown if at least one self-intersection is found. Type: Boolean Default: `false` Extra: `np1` only |

Parameters

  np_out | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm_out` Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm_out)` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  a 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`. Type: a class model of `WritablePropertyMap` with `boost::graph_traits<TriangleMesh>::edge_descriptor` as key type and `bool` as value type |

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.

## ◆ corefine_and_compute_intersection()

template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters, class NamedParametersOut = parameters::Default_named_parameters>

bool CGAL::Polygon_mesh_processing::corefine_and_compute_intersection | ( | TriangleMesh & | tm1,
|  | TriangleMesh & | tm2,
|  | TriangleMesh & | tm_out,
|  | const NamedParameters1 & | np1 = `parameters::default_values()`,
|  | const NamedParameters2 & | np2 = `parameters::default_values()`,
|  | const NamedParametersOut & | np_out = `parameters::default_values()`
| ) |  |

`#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`.

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

  TriangleMesh | a model of `HalfedgeListGraph`, `FaceListGraph`, and `MutableFaceGraph`
  NamedParameters1 | a sequence of Named Parameters
  NamedParameters2 | a sequence of Named Parameters
  NamedParametersOut | a sequence of Named Parameters

Parameters

  tm1 | first input triangulated surface mesh
  tm2 | second input triangulated surface mesh
  tm_out | output surface mesh
  np1 | an optional sequence of Named Parameters among the ones listed below
  np2 | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm1 (tm2))` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  a property map containing the constrained-or-not status of each edge of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::edge_descriptor` as key type and `bool` as value type Default: a constant property map returning `false` for any edge |
  a property map associating to each face of `tm1` (`tm2`) a unique index between `0` and `num_faces(tm1) - 1` (`num_faces(tm2) - 1`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::face_descriptor` as key type and `std::size_t` as value type Default: an automatically indexed internal map Extra: If the property map is writable, the indices of the faces of `tm1` and `tm2` will be set after the corefinement is done. |
  a visitor used to track the creation of new faces Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<TriangleMesh>` Extra: `np1` only |
  If `true` the set of triangles close to the intersection of `tm1` and `tm2` will be checked for self-intersections and `Corefinement::Self_intersection_exception` will be thrown if at least one self-intersection is found. Type: Boolean Default: `false` Extra: `np1` only |

Parameters

  np_out | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm_out` Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm_out)` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  a 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`. Type: a class model of `WritablePropertyMap` with `boost::graph_traits<TriangleMesh>::edge_descriptor` as key type and `bool` as value type |

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.

## ◆ corefine_and_compute_union()

template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters, class NamedParametersOut = parameters::Default_named_parameters>

bool CGAL::Polygon_mesh_processing::corefine_and_compute_union | ( | TriangleMesh & | tm1,
|  | TriangleMesh & | tm2,
|  | TriangleMesh & | tm_out,
|  | const NamedParameters1 & | np1 = `parameters::default_values()`,
|  | const NamedParameters2 & | np2 = `parameters::default_values()`,
|  | const NamedParametersOut & | np_out = `parameters::default_values()`
| ) |  |

`#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

  TriangleMesh | a model of `HalfedgeListGraph`, `FaceListGraph`, and `MutableFaceGraph`
  NamedParameters1 | a sequence of Named Parameters
  NamedParameters2 | a sequence of Named Parameters
  NamedParametersOut | a sequence of Named Parameters

Parameters

  tm1 | first input triangulated surface mesh
  tm2 | second input triangulated surface mesh
  tm_out | output surface mesh
  np1 | an optional sequence of Named Parameters among the ones listed below
  np2 | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm1 (tm2))` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  a property map containing the constrained-or-not status of each edge of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::edge_descriptor` as key type and `bool` as value type Default: a constant property map returning `false` for any edge |
  a property map associating to each face of `tm1` (`tm2`) a unique index between `0` and `num_faces(tm1) - 1` (`num_faces(tm2) - 1`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::face_descriptor` as key type and `std::size_t` as value type Default: an automatically indexed internal map Extra: If the property map is writable, the indices of the faces of `tm1` and `tm2` will be set after the corefinement is done. |
  a visitor used to track the creation of new faces Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<TriangleMesh>` Extra: `np1` only |
  If `true` the set of triangles close to the intersection of `tm1` and `tm2` will be checked for self-intersections and `Corefinement::Self_intersection_exception` will be thrown if at least one self-intersection is found. Type: Boolean Default: `false` Extra: `np1` only |

Parameters

  np_out | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm_out` Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm_out)` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  a 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`. Type: a class model of `WritablePropertyMap` with `boost::graph_traits<TriangleMesh>::edge_descriptor` as key type and `bool` as value type |

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.

## ◆ refine_with_plane()

template<class PolygonMesh , class Plane_3 , class NamedParameters = parameters::Default_named_parameters>

void CGAL::Polygon_mesh_processing::refine_with_plane | ( | PolygonMesh & | pm,
|  | const Plane_3 & | plane,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/Polygon_mesh_processing/refine_with_plane.h>`

refines `pm` by inserting new vertices and new edges at the intersection of `plane` with `pm`.

Template Parameters

  PolygonMesh | a model of `HalfedgeListGraph`, `FaceListGraph`, and `MutableFaceGraph`
  Plane_3 | plane type, equal to `GeomTraits::Plane_3`, `GeomTraits` being the type of the parameter `geom_traits`.
  NamedParameters | a sequence of Named Parameters

Parameters

  pm | input mesh to be refined
  plane | the plane used to refine the mesh
  np | an optional sequence of Named Parameters among the ones listed below:

Optional Named Parameters

  a property map containing the constrained-or-not status of each edge of `pm`. If an edge marked as constrained is split, the two resulting edges will be marked as constrained. Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::edge_descriptor` as key type and `bool` as value type Default: unused |
  a property map filled by this function with `true` for all intersection edges of faces of `pm` and `plane`, and `false` for all other edges. Type: a class model of `WritablePropertyMap` with `boost::graph_traits<PolygonMesh>::edge_descriptor` as key type and `bool` as value type Default: unused |
  a property map filled by this function containing the position of each vertex relative to the oriented plane `plane`. Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::vertex_descriptor` as key type and `Oriented_side` as value type Default: Dynamic vertex property map |
  If the input mesh is triangulated and this parameter is set to `false`, the mesh will be kept triangulated. Type: Boolean Default: `true` Extra: The function `triangulate_faces()` can be used to triangule faces before calling this function. |
  a property map associating points to the vertices of `pm` Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::vertex_descriptor` as key type and `GeomTraits::Point_3` as value type, `GeomTraits` being the type of the parameter `geom_traits` Default: `boost::get(CGAL::vertex_point, pm)` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `PolygonMesh`. |
  an instance of a geometric traits class Type: a class model of `Kernel` Default: a CGAL kernel deduced from the point type, using `CGAL::Kernel_traits` Extra: The geometric traits class must be compatible with the vertex point type. |

See also
  `split()`
  `clip()`

## ◆ split() [1/3]

template<class PolygonMesh , class NamedParameters = parameters::Default_named_parameters>

void CGAL::Polygon_mesh_processing::split | ( | PolygonMesh & | pm,
|  | const Plane_3 & | plane,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/Polygon_mesh_processing/clip.h>`

splits a polygon mesh with a plane.

The polygon mesh is refined with the intersection edges, and those edges are duplicated as to create a boundary, and thus separate connected components on either side of the plane.

Template Parameters

  PolygonMesh | a model of `MutableFaceGraph`, `HalfedgeListGraph`, and `FaceListGraph`. An internal property map for `CGAL::vertex_point_t` must be available.
  NamedParameters | a sequence of Named Parameters

Parameters

  pm | input surface mesh
  plane | the plane that will be used to split `pm`. `Plane_3` is the plane type for the same CGAL kernel as the point of the vertex point map of `pm`.
  np | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `pm` Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, pm)` |
  a visitor used to track the creation of new faces, edges, and vertices. Note that as there are no mesh associated with `plane`, `boost::graph_traits<PolygonMesh>::null_halfedge()` and `boost::graph_traits<PolygonMesh>::null_face()` will be used when calling functions of the visitor expecting a halfedge or a face from `plane`. Similarly, `pm` will be used as the mesh of `plane`.} Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<TriangleMesh>` |
  If `true`, the set of triangles close to the intersection of `pm` and `plane` will be checked for self-intersections and `CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception` will be thrown if at least one self-intersection is found. This option is only taken into account if `pm` is a triangle mesh. Type: Boolean Default: `false` |
  If the input mesh is triangulated and this parameter is set to `false`, the mesh will be kept triangulated. Always `true` if `pm` is not a triangle mesh. Type: Boolean Default: `false` |

See also
  `clip()`

## ◆ split() [2/3]

template<class TriangleMesh , class NamedParameters = parameters::Default_named_parameters>

void CGAL::Polygon_mesh_processing::split | ( | TriangleMesh & | tm,
|  | const Iso_cuboid_3 & | iso_cuboid,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/Polygon_mesh_processing/clip.h>`

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

Note
  `Iso_cuboid_3` must be from the same kernel as the point of the internal vertex point map of `TriangleMesh`.
  `Iso_cuboid_3` must be from the same kernel as the point of the vertex point map of `tm`.

Precondition
  `!CGAL::Polygon_mesh_processing::does_self_intersect(tm)`

Template Parameters

  TriangleMesh | a model of `MutableFaceGraph`, `HalfedgeListGraph`, and `FaceListGraph`. An internal property map for `CGAL::vertex_point_t` must be available.
  NamedParameters | a sequence of Named Parameters

Parameters

  tm | input triangulated surface mesh
  iso_cuboid | iso-cuboid used to split `tm`.
  np | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm` Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm)` |
  a visitor used to track the creation of new faces Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<TriangleMesh>` |
  If `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). Type: Boolean Default: `false` |
  if `false`, the parts of `tm` coplanar with `iso_cuboid` will not be part of the output. Type: Boolean Default: `true` |
  If `true`, the set of triangles close 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 self-intersection is found. Type: Boolean Default: `false` |
  If `true`, self-intersections in `tm` are accepted. Type: Boolean Default: `false` Extra: If this option is set to `true`, `tm` is no longer required to be without self-intersection. Setting this option to `true` will automatically set `throw_on_self_intersection` to `false` and `clip_volume` to `false`. |

See also
  `clip()`

## ◆ split() [3/3]

template<class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>

void CGAL::Polygon_mesh_processing::split | ( | TriangleMesh & | tm,
|  | TriangleMesh & | splitter,
|  | const NamedParameters1 & | np_tm = `parameters::default_values()`,
|  | const NamedParameters2 & | np_s = `parameters::default_values()`
| ) |  |

`#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

  TriangleMesh | a model of `MutableFaceGraph`, `HalfedgeListGraph`, and `FaceListGraph`.
  NamedParameters1 | a sequence of Named Parameters
  NamedParameters2 | a sequence of Named Parameters

Parameters

  tm | input triangulated surface mesh
  splitter | triangulated surface mesh used to split `tm`
  np_tm | an optional sequence of Named Parameters among the ones listed below
  np_s | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm` (`splitter`) Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm)` Default: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `TriangleMesh`. |
  (`np_tm` only) a visitor used to track a series of events such as the creation of new faces, edges... in both `tm` and `splitter`. Type: a class model of `PMPCorefinementVisitor` Default: `Corefinement::Default_visitor<TriangleMesh>` |
  If `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 self-intersection is found. Type: Boolean Default: `false` |
  (`np_s` only) if `true`, `splitter` will not be modified. Type: Boolean Default: `false` Extra: If this option is set to `true`, `tm` is no longer required to be without self-intersection. Setting this option to `true` will automatically set `throw_on_self_intersection` to `false` and `clip_volume` to `false`. |

See also
  `clip()`

## ◆ surface_intersection()

template<class OutputIterator , class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>

OutputIterator CGAL::Polygon_mesh_processing::surface_intersection | ( | const TriangleMesh & | tm1,
|  | const TriangleMesh & | tm2,
|  | OutputIterator | polyline_output,
|  | const NamedParameters1 & | np1 = `parameters::default_values()`,
|  | const NamedParameters2 & | np2 = `parameters::default_values()`
| ) |  |

`#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

  TriangleMesh | a model of `MutableFaceGraph`, `HalfedgeListGraph` and `FaceListGraph`
  NamedParameters1 | a sequence of Named Parameters
  NamedParameters2 | a sequence of Named Parameters
  OutputIterator | an output iterator in which `std::vector` of points can be put. The point type is the one from the vertex property map

Parameters

  tm1 | first input triangulated surface mesh
  tm2 | second input triangulated surface mesh
  polyline_output | output iterator of polylines. Each polyline will be given as a vector of points
  np1 | an optional sequence of Named Parameters among the ones listed below
  np2 | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the vertices of `tm1` (`tm2`) Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<TriangleMesh>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, tm1 (tm2))` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` should be available for the vertices of `tm1` (`tm2`) Extra: Both vertex point maps must have the same value type |
  If `true`, the set of triangles close to the intersection of `tm1` and `tm2` will be checked for self-intersections and `Corefinement::Self_intersection_exception` will be thrown if at least one self-intersection is found. Type: Boolean Default: `false` Extra: `np1` only |

See also
  `do_intersect()`