Functions to orient polygon soups and to stitch geometrically identical boundaries.
|
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 , typename NamedParameters > |
void | CGAL::Polygon_mesh_processing::stitch_borders (PolygonMesh &pmesh, const HalfedgePairsRange &hedge_pairs_to_stitch, const NamedParameters &np) |
| 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...
|
|
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()
.
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
-
- Parameters
-
polygons | each element in the range describes a polygon using the indices of the vertices. |
- See Also
orient_polygon_soup()
#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>
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 |
|
) |
| |
template<class PolygonMesh >
std::size_t CGAL::Polygon_mesh_processing::remove_isolated_vertices |
( |
PolygonMesh & |
pmesh) | |
|
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
-
- Parameters
-
pmesh | the polygon mesh to be repaired |
- Returns
- number of removed isolated vertices
#include <CGAL/Polygon_mesh_processing/repair.h>
template<typename PolygonMesh , typename HalfedgePairsRange , typename NamedParameters >
void CGAL::Polygon_mesh_processing::stitch_borders |
( |
PolygonMesh & |
pmesh, |
|
|
const HalfedgePairsRange & |
hedge_pairs_to_stitch, |
|
|
const NamedParameters & |
np |
|
) |
| |
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
.
The vertices that get removed from pmesh
are selected as follows: The pair of halfedges in hedge_pairs_to_stitch
are processed linearly. Let p
be such a pair. If the target of p.first
has not been marked for deletion, then the source of p.second
is. If the target of p.second
has not been marked for deletion, then the source of p.first
is. A vertex is marked for deletion if its corresponding point has already be seen with a vertex previously handled.
- Precondition
- For each halfedge in a pair of
hedge_pairs_to_stitch
, the corresponding edge is neither degenerated nor incident to a degenerate border edge.
- Template Parameters
-
- Parameters
-
pmesh | the polygon mesh to be modified by stitching |
hedge_pairs_to_stitch | a range of std::pair of halfedges to be stitched together |
np | optional Named Parameters described below |
- Named Parameters
vertex_point_map | the 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 should be available in PolygonMesh |
#include <CGAL/Polygon_mesh_processing/stitch_borders.h>
- Examples:
- Polygon_mesh_processing/stitch_borders_example.cpp.
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.
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.
- Precondition
pmesh
does not contains any degenerate border edge.
- Template Parameters
-
- Parameters
-
pmesh | the polygon mesh to be modified by stitching |
np | optional sequence of Named Parameters among the ones listed below |
- Named Parameters
vertex_point_map | the 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 should be available in PolygonMesh |
#include <CGAL/Polygon_mesh_processing/stitch_borders.h>