\( \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
Combinatorial Repairing

Functions to orient polygon soups and to stitch geometrically identical boundaries.

Functions

template<class PolygonRange >
bool CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh (const PolygonRange &polygons)
 returns true if the soup of polygons defines a valid polygon mesh that can be handled by CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(). More...
 
template<class PolygonMesh , class Point , class Polygon >
void CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh (const std::vector< Point > &points, const std::vector< Polygon > &polygons, PolygonMesh &out)
 builds a polygon mesh from a soup of polygons. More...
 
template<class PolygonMesh >
std::size_t CGAL::Polygon_mesh_processing::remove_isolated_vertices (PolygonMesh &pmesh)
 removes the isolated vertices from any polygon mesh. More...
 
template<typename PolygonMesh , typename HalfedgePairsRange >
void CGAL::Polygon_mesh_processing::stitch_borders (PolygonMesh &pmesh, const HalfedgePairsRange &hedge_pairs_to_stitch)
 Stitches together border halfedges in a polygon mesh. More...
 
template<typename PolygonMesh , class NamedParameters >
void CGAL::Polygon_mesh_processing::stitch_borders (PolygonMesh &pmesh, const NamedParameters &np)
 Same as the other overload but the pairs of halfedges to be stitched are automatically found amongst all border halfedges. More...
 

Function Documentation

◆ is_polygon_soup_a_polygon_mesh()

template<class PolygonRange >
bool CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh ( const PolygonRange &  polygons)

#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>

returns true if the soup of polygons defines a valid polygon mesh that can be handled by CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh().

It checks that each edge has at most two incident faces and such an edge is visited in opposite direction along the two face boundaries, no polygon has twice the same vertex, and the polygon soup describes a manifold surface. This function does not require a range of points as an argument since the check is purely topological. To each vertex of the mesh is associated an index that is used in the description of the boundaries of the polygons provided in polygons.

Template Parameters
PolygonRangea model of the concept RandomAccessContainer whose value_type is a model of the concept RandomAccessContainer whose value_type is std::size_t.
Parameters
polygonseach element in the range describes a polygon using the indices of the vertices.
See also
orient_polygon_soup()

◆ polygon_soup_to_polygon_mesh()

template<class PolygonMesh , class Point , class Polygon >
void CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh ( const std::vector< Point > &  points,
const std::vector< Polygon > &  polygons,
PolygonMesh &  out 
)

#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>

builds a polygon mesh from a soup of polygons.

Precondition
the input polygon soup describes a consistently oriented polygon mesh.
Template Parameters
PolygonMesha model of MutableFaceGraph with an internal point property map
Pointa point type that has an operator [] to access coordinates
Polygona std::vector<std::size_t> containing the indices of the points of the face
Parameters
pointspoints of the soup of polygons
polygonseach element in the vector describes a polygon using the index of the points in points
outthe polygon mesh to be built
Precondition
CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh(polygons)
See also
CGAL::Polygon_mesh_processing::orient_polygon_soup()
CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh()
Examples:
Polygon_mesh_processing/polygon_soup_example.cpp.

◆ remove_isolated_vertices()

template<class PolygonMesh >
std::size_t CGAL::Polygon_mesh_processing::remove_isolated_vertices ( PolygonMesh &  pmesh)

#include <CGAL/Polygon_mesh_processing/repair.h>

removes the isolated vertices from any polygon mesh.

A vertex is considered isolated if it is not incident to any simplex of higher dimension.

Template Parameters
PolygonMesha model of FaceListGraph and MutableFaceGraph
Parameters
pmeshthe polygon mesh to be repaired
Returns
number of removed isolated vertices

◆ stitch_borders() [1/2]

template<typename PolygonMesh , typename HalfedgePairsRange >
void CGAL::Polygon_mesh_processing::stitch_borders ( PolygonMesh &  pmesh,
const HalfedgePairsRange &  hedge_pairs_to_stitch 
)

#include <CGAL/Polygon_mesh_processing/stitch_borders.h>

Stitches together border halfedges in a polygon mesh.

The halfedges to be stitched are provided in hedge_pairs_to_stitch. For each pair p in this vector, p.second and its opposite will be removed from pmesh.

Template Parameters
PolygonMesha model of FaceListGraph and MutableFaceGraph
HalfedgePairsRangea range of std::pair<boost::graph_traits<PolygonMesh>::halfedge_descriptor, boost::graph_traits<PolygonMesh>::halfedge_descriptor>, model of Range. Its iterator type is InputIterator.
Parameters
pmeshthe polygon mesh to be modified by stitching
hedge_pairs_to_stitcha range of std::pair of halfedges to be stitched together
Examples:
Polygon_mesh_processing/stitch_borders_example.cpp.

◆ stitch_borders() [2/2]

template<typename PolygonMesh , class NamedParameters >
void CGAL::Polygon_mesh_processing::stitch_borders ( PolygonMesh &  pmesh,
const NamedParameters &  np 
)

#include <CGAL/Polygon_mesh_processing/stitch_borders.h>

Same as the other overload but the pairs of halfedges to be stitched are automatically found amongst all border halfedges.

Two border halfedges h1 and h2 are set to be stitched if the points associated to the source and target vertices of h1 are the same as those of the target and source vertices of h2 respectively.

Template Parameters
PolygonMesha model of FaceListGraph and MutableFaceGraph
NamedParametersa sequence of Named Parameters
Parameters
pmeshthe polygon mesh to be modified by stitching
npoptional sequence of Named Parameters among the ones listed below
Named Parameters
vertex_point_mapthe property map with the points associated to the vertices of pmesh. If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in PolygonMesh.
apply_per_connected_componentspecifies if the borders should only be stitched inside their own connected component. In that case, a property map for CGAL::face_index_t should be either available as an internal property map to pmesh or provided as the Named Parameter face_index_map. If this is not the case, a default map will be created on the fly. Default value is false.
face_index_mapa property map containing the index of each face of pmesh