CGAL 6.2 - Boolean Operations on Meshes
Loading...
Searching...
No Matches
Mesh Kernel

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_3CGAL::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_3CGAL::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.

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.

◆ 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
FaceRangea model of ConstRange with boost::graph_traits<PolygonMesh>::face_descriptor as value type
PolygonMesha model of VertexListGraph, HalfedgeListGraph and FaceListGraph
PolygonMeshOuta model of MutableFaceGraph, VertexListGraph and FaceListGraph
NamedParametersa sequence of Named Parameters
NamedParametersOuta sequence of Named Parameters
Parameters
face_rangethe range of faces used
pminput surface mesh
outoutput surface mesh
npan 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.

  • is used to initialize the random number generator of the algorithm.
  • Type: unsigned int
  • Default: use std::default_random_engine()
Parameters
np_outan 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.

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.

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.

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