\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.13.2 - Polygon Mesh Processing
Feature Detection Functions

Functions to detect sharp edges and surface patches of polygon meshes.

Functions

template<typename PolygonMesh , typename FT , typename EdgeIsFeatureMap , typename NamedParameters >
void CGAL::Polygon_mesh_processing::detect_sharp_edges (PolygonMesh &pmesh, FT angle_in_deg, EdgeIsFeatureMap edge_is_feature_map, const NamedParameters &np)
 detects and marks the edges that are considered to be sharp with respect to the given angle bound. More...
 
template<typename PolygonMesh , typename PatchIdMap , typename VertexIncidentPatchesMap , typename EdgeIsFeatureMap >
void CGAL::Polygon_mesh_processing::detect_vertex_incident_patches (PolygonMesh &pmesh, const PatchIdMap patch_id_map, VertexIncidentPatchesMap vertex_incident_patches_map, const EdgeIsFeatureMap edge_is_feature_map)
 collects the surface patches of the faces incident to each vertex of the input polygon mesh. More...
 
template<typename PolygonMesh , typename FT , typename EdgeIsFeatureMap , typename PatchIdMap , typename NamedParameters >
boost::graph_traits< PolygonMesh >::faces_size_type CGAL::Polygon_mesh_processing::sharp_edges_segmentation (PolygonMesh &pmesh, FT angle_in_deg, EdgeIsFeatureMap edge_is_feature_map, PatchIdMap patch_id_map, const NamedParameters &np)
 This function calls successively CGAL::Polygon_mesh_processing::detect_sharp_edges(), CGAL::Polygon_mesh_processing::connected_components() and CGAL::Polygon_mesh_processing::detect_vertex_incident_patches() More...
 

Function Documentation

◆ detect_sharp_edges()

template<typename PolygonMesh , typename FT , typename EdgeIsFeatureMap , typename NamedParameters >
void CGAL::Polygon_mesh_processing::detect_sharp_edges ( PolygonMesh &  pmesh,
FT  angle_in_deg,
EdgeIsFeatureMap  edge_is_feature_map,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/detect_features.h>

detects and marks the edges that are considered to be sharp with respect to the given angle bound.

angle_in_deg gives the maximum angle (in degrees) between the two normal vectors of adjacent triangles. For an edge of the input polygon mesh, if the angle between the two normal vectors of its incident facets is bigger than the given bound, then the edge is marked as being a feature edge.

Also computes the number of sharp edges incident to each vertex, if vertex_feature_degree_map is provided.

Template Parameters
PolygonMesha model of HalfedgeListGraph
FTa number type. It is either deduced from the geom_traits Named Parameters if provided, or from the geometric traits class deduced from the point property map of PolygonMesh.
EdgeIsFeatureMapa model of ReadWritePropertyMap with boost::graph_traits<PolygonMesh>::edge_descriptor as key type and bool as value type. It must be default constructible.
NamedParametersa sequence of Named Parameters
Parameters
pmeshthe polygon mesh
angle_in_degthe dihedral angle bound
edge_is_feature_mapthe property map that will contain the sharp-or-not status of each edge of pmesh
npoptional Named Parameters described below
Named Parameters
geom_traitsan instance of a geometric traits class, model of Kernel
vertex_feature_degree_mapa property map that will contain the number of adjacent feature edges for each vertex of pmesh

◆ detect_vertex_incident_patches()

template<typename PolygonMesh , typename PatchIdMap , typename VertexIncidentPatchesMap , typename EdgeIsFeatureMap >
void CGAL::Polygon_mesh_processing::detect_vertex_incident_patches ( PolygonMesh &  pmesh,
const PatchIdMap  patch_id_map,
VertexIncidentPatchesMap  vertex_incident_patches_map,
const EdgeIsFeatureMap  edge_is_feature_map 
)

#include <CGAL/Polygon_mesh_processing/detect_features.h>

collects the surface patches of the faces incident to each vertex of the input polygon mesh.

Template Parameters
PolygonMesha model of HalfedgeListGraph
PatchIdMapa model of ReadPropertyMap with boost::graph_traits<PolygonMesh>::face_descriptor as key type and the desired patch id, model of CopyConstructible as value type.
VertexIncidentPatchesMapa model of mutable LvaluePropertyMap with boost::graph_traits<PolygonMesh>::vertex_descriptor as key type. Its value type must be a container of boost::property_traits<PatchIdMap>::value_type and have a function insert(). A std::set or a boost::unordered_set are recommended, as a patch index may be inserted several times.
EdgeIsFeatureMapa model of ReadPropertyMap with boost::graph_traits<PolygonMesh>::edge_descriptor as key type and bool as value type.
Parameters
pmeshthe polygon mesh
patch_id_mapthe property map containing the surface patch ids for the faces of pmesh. It must be already filled.
vertex_incident_patches_mapa property map that will contain the patch ids of all the faces incident to each vertex of pmesh.
edge_is_feature_mapa filled property map that will contain the sharp-or-not status of each edge of pmesh
See also
CGAL::Polygon_mesh_processing::sharp_edges_segmentation()

◆ sharp_edges_segmentation()

template<typename PolygonMesh , typename FT , typename EdgeIsFeatureMap , typename PatchIdMap , typename NamedParameters >
boost::graph_traits<PolygonMesh>::faces_size_type CGAL::Polygon_mesh_processing::sharp_edges_segmentation ( PolygonMesh &  pmesh,
FT  angle_in_deg,
EdgeIsFeatureMap  edge_is_feature_map,
PatchIdMap  patch_id_map,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/detect_features.h>

This function calls successively CGAL::Polygon_mesh_processing::detect_sharp_edges(), CGAL::Polygon_mesh_processing::connected_components() and CGAL::Polygon_mesh_processing::detect_vertex_incident_patches()

It detects and marks the sharp edges of pmesh according to angle_in_deg. The sharp edges define a segmentation of pmesh, that is done by computing a surface patch id for each face.

A property map for CGAL::face_index_t must be either available as an internal property map to pmesh or provided as one of the Named Parameters.

Template Parameters
PolygonMesha model of FaceGraph
FTa number type. It is either deduced from the geom_traits Named Parameters if provided, or from the geometric traits class deduced from the point property map of PolygonMesh.
EdgeIsFeatureMapa model of ReadWritePropertyMap with boost::graph_traits<PolygonMesh>::edge_descriptor
PatchIdMapa model of ReadWritePropertyMap with boost::graph_traits<PolygonMesh>::face_descriptor as key type and the desired patch id, model of CopyConstructible as value type.
NamedParametersa sequence of Named Parameters
Parameters
pmeshthe polygon mesh
angle_in_degthe dihedral angle bound
edge_is_feature_mapthe property map that will contain the sharp-or-not status of each edge of pmesh
patch_id_mapthe property map that will contain the surface patch ids for the faces of pmesh.
npoptional Named Parameters described below
Named Parameters
geom_traitsan instance of a geometric traits class, model of Kernel
vertex_feature_degree_mapa property map that will contain the number of adjacent feature edges for each vertex of pmesh
first_indexa std::size_t containing the index of the first surface patch of pmesh. The patches will be numbered on [first_index; first_index + num_patches], where num_patches is the number of surface patches
face_index_mapa property map containing the index of each face of pmesh
vertex_incident_patches_mapa property map that will contain the patch ids of all the faces incident to each vertex of pmesh.
Returns
the number of surface patches.
See also
CGAL::Polygon_mesh_processing::detect_sharp_edges()
CGAL::Polygon_mesh_processing::connected_components()
CGAL::Polygon_mesh_processing::detect_vertex_incident_patches()
Examples:
Polygon_mesh_processing/detect_features_example.cpp.