CGAL 6.2 - Boolean Operations on Meshes

Loading...
Searching...
No Matches
Functions
Mesh Kernel
Reference Manual

##

Functions to compute kernel of polyhedra.

## Functions
template<typename FaceRange , typename PolygonMesh , typename NamedParameters = parameters::Default_named_parameters, typename NamedParametersOut = parameters::Default_named_parameters>
void | CGAL::Polygon_mesh_processing::kernel (const FaceRange &face_range, const PolygonMesh &pm, PolygonMesh &out, const NamedParameters &np=parameters::default_values(), const NamedParametersOut &np_out=parameters::default_values())
| computes the kernel of the given faces of a polygon mesh.
template<typename PolygonMesh , typename NamedParameters = parameters::Default_named_parameters, typename NamedParametersOut = parameters::Default_named_parameters>
void | CGAL::Polygon_mesh_processing::kernel (const PolygonMesh &pm, PolygonMesh &out, const NamedParameters &np=parameters::default_values(), const NamedParametersOut &np_out=parameters::default_values())
| computes the kernel of the given polygon mesh.
template<typename FaceRange , typename PolygonMesh , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool | CGAL::Polygon_mesh_processing::has_empty_kernel (const FaceRange &face_range, const PolygonMesh &pm, const NamedParameters &np=parameters::default_values())
| indicates whether the kernel of the given faces of a polygon mesh is empty.
template<typename PolygonMesh , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool | CGAL::Polygon_mesh_processing::has_empty_kernel (const PolygonMesh &pm, const NamedParameters &np=parameters::default_values())
| indicates whether the kernel of the given polygon mesh is empty.
template<typename FaceRange , typename PolygonMesh , typename NamedParameters = parameters::Default_named_parameters>
std::optional< Point_3 > | CGAL::Polygon_mesh_processing::kernel_point (const FaceRange &face_range, const PolygonMesh &pm, const NamedParameters &np=parameters::default_values())
| returns a point inside the kernel of the given faces of a polygon mesh.
template<typename PolygonMesh , typename NamedParameters = CGAL::parameters::Default_named_parameters>
std::optional< Point_3 > | CGAL::Polygon_mesh_processing::kernel_point (const PolygonMesh &pm, const NamedParameters &np=parameters::default_values())
| returns a point inside the kernel of the given polygon mesh.

## Function Documentation

## ◆ has_empty_kernel() [1/2]

template<typename FaceRange , typename PolygonMesh , typename NamedParameters = CGAL::parameters::Default_named_parameters>

bool CGAL::Polygon_mesh_processing::has_empty_kernel | ( | const FaceRange & | face_range,
|  | const PolygonMesh & | pm,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

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

indicates whether the kernel of the given faces of a polygon mesh is empty.

The kernel is defined as the convex polyhedron that is the intersection of all the halfspaces on the negative side of the oriented planes defined by a range of faces of the input mesh.

See `CGAL::Polygon_mesh_processing::kernel()` for a comprehensive description of the parameters.

## ◆ has_empty_kernel() [2/2]

template<typename PolygonMesh , typename NamedParameters = CGAL::parameters::Default_named_parameters>

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

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

indicates whether the kernel of the given polygon mesh is empty.

This is a convenience overload that calls the overload above on all faces of the mesh.

## ◆ kernel() [1/2]

template<typename FaceRange , typename PolygonMesh , typename NamedParameters = parameters::Default_named_parameters, typename NamedParametersOut = parameters::Default_named_parameters>

void CGAL::Polygon_mesh_processing::kernel | ( | const FaceRange & | face_range,
|  | const PolygonMesh & | pm,
|  | PolygonMesh & | out,
|  | const NamedParameters & | np = `parameters::default_values()`,
|  | const NamedParametersOut & | np_out = `parameters::default_values()`
| ) |  |

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

computes the kernel of the given faces of a polygon mesh.

The kernel is defined as the convex polyhedron that is the intersection of all the halfspaces on the negative side of the oriented planes defined by a range of faces of the input mesh. The kernel may be empty or degenerate to a lower-dimensional convex shape.

In the implementation, a starting shape is iteratively clipped by the faces. By default, the bounding box of the input mesh is used as starting shape. However, the parameter `out` may be non-empty: In this case, it must be a convex polyhedron and will be used as starting shape.

The algorithm assumes that the faces of the input range form a closed surface as to perform a quick exit if the genus is non-zero. This precondition can be relaxed using the named parameter `allow_open_input`. In that case, the resulting kernel may contain faces of the starting shape.

In case of a degenerate kernel:

- If the dimension of the kernel is `2` (i.e., the kernel is a convex polygon in 3D), the output mesh consists of a single face.
- If the dimension of the kernel is `1` (i.e., the kernel is a line segment), the output mesh consists two isolated vertices.
- If the dimension of the kernel is `0` (i.e., the kernel is a single point), the output mesh contains one isolated vertex.

Template Parameters

  FaceRange | a model of `ConstRange` with `boost::graph_traits<PolygonMesh>::face_descriptor` as value type
  PolygonMesh | a model of `VertexListGraph`, `HalfedgeListGraph` and `FaceListGraph`
  PolygonMeshOut | a model of `MutableFaceGraph`, `VertexListGraph` and `FaceListGraph`
  NamedParameters | a sequence of Named Parameters
  NamedParametersOut | a sequence of Named Parameters

Parameters

  face_range | the range of faces used
  pm | input surface mesh
  out | output surface mesh
  np | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  If set to `true`, the input mesh is allowed to have boundaries. Type: Boolean Default: `false` |
  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)` 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` |
  is used to initialize the random number generator of the algorithm. Type: unsigned int Default: use `std::default_random_engine()` |

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 `out` 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, out)` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in PolygonMesh. |
  a property map storing, for each face of the output mesh, a face of the input mesh that defined the clipping plane that created it (or `boost::graph_traits<PolygonMeshOut>::null_face` if the face belongs to the starting shape) Type: a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMeshOut>::face_descriptor` as key type and `boost::graph_traits<PolygonMesh>::face_descriptor` as value type Default: unused |

## ◆ kernel() [2/2]

template<typename PolygonMesh , typename NamedParameters = parameters::Default_named_parameters, typename NamedParametersOut = parameters::Default_named_parameters>

void CGAL::Polygon_mesh_processing::kernel | ( | const PolygonMesh & | pm,
|  | PolygonMesh & | out,
|  | const NamedParameters & | np = `parameters::default_values()`,
|  | const NamedParametersOut & | np_out = `parameters::default_values()`
| ) |  |

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

computes the kernel of the given polygon mesh.

This is a convenience overload that calls the overload above on all faces of the mesh.

## ◆ kernel_point() [1/2]

template<typename FaceRange , typename PolygonMesh , typename NamedParameters = parameters::Default_named_parameters>

std::optional< Point_3 > CGAL::Polygon_mesh_processing::kernel_point | ( | const FaceRange & | face_range,
|  | const PolygonMesh & | pm,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

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

returns a point inside the kernel of the given faces of a polygon mesh.

The kernel is defined as the convex polyhedron that is the intersection of all the halfspaces on the negative side of the oriented planes defined by a range of faces of the input mesh.

See `CGAL::Polygon_mesh_processing::kernel()` for a comprehensive description of the parameters.

In addition to the parameters available in `CGAL::Polygon_mesh_processing::kernel()`, the following named parameter is also available:

Optional Named Parameters

  If set to `true`, the returned point is required to lie strictly inside the mesh and not on its boundary. If the kernel is degenerate, this requirement cannot be satisfied and no point is returned. Type: Boolean Default: `false` |

Returns
  `std::nullopt` if and only if the kernel is empty.

## ◆ kernel_point() [2/2]

template<typename PolygonMesh , typename NamedParameters = CGAL::parameters::Default_named_parameters>

std::optional< Point_3 > CGAL::Polygon_mesh_processing::kernel_point | ( | const PolygonMesh & | pm,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

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

returns a point inside the kernel of the given polygon mesh.

This is a convenience overload that calls the overload above on all faces of the mesh.