
a property map associating points to the vertices of
tm

Type: a class model of
ReadablePropertyMap
withboost::graph_traits<TriangleMesh>::vertex_descriptor
as key type andPoint_3
as value type 
Default:
boost::get(CGAL::vertex_point, tm)
CGAL 5.4.4  Polygon Mesh Processing

Functions to compute or change the orientation of faces and surfaces.
Classes  
struct  CGAL::Polygon_mesh_processing::Default_orientation_visitor 
Default visitor model of PMPPolygonSoupOrientationVisitor . More...  
Enumerations  
enum  CGAL::Polygon_mesh_processing::Volume_error_code { CGAL::Polygon_mesh_processing::VALID_VOLUME, CGAL::Polygon_mesh_processing::SURFACE_WITH_SELF_INTERSECTIONS, CGAL::Polygon_mesh_processing::VOLUME_INTERSECTION, CGAL::Polygon_mesh_processing::INCOMPATIBLE_ORIENTATION } 
Enumeration type used to indicate the status of a set of faces classified by the function volume_connected_components() . More...  
Functions  
template<class PointRange , class PolygonRange , class NamedParameters >  
bool  CGAL::Polygon_mesh_processing::orient_polygon_soup (PointRange &points, PolygonRange &polygons, const NamedParameters &np) 
tries to consistently orient a soup of polygons in 3D space. More...  
template<class PointRange , class PolygonRange >  
bool  CGAL::Polygon_mesh_processing::duplicate_non_manifold_edges_in_polygon_soup (PointRange &points, PolygonRange &polygons) 
duplicates each point p at which the intersection of an infinitesimally small ball centered at p with the polygons incident to it is not a topological disk. More...  
template<class Concurrency_tag = Sequential_tag, class PointRange , class TriangleRange , class TriangleMesh , class NamedParameters >  
void  CGAL::Polygon_mesh_processing::orient_triangle_soup_with_reference_triangle_mesh (const TriangleMesh &tm_ref, PointRange &points, TriangleRange &triangles, const NamedParameters &np) 
orients each triangle of a triangle soup using the orientation of its closest non degenerate triangle in tm_ref . More...  
template<typename TriangleMesh , typename NamedParameters >  
bool  CGAL::Polygon_mesh_processing::is_outward_oriented (const TriangleMesh &tm, const NamedParameters &np) 
tests whether a closed triangle mesh has a positive orientation. More...  
template<typename PolygonMesh >  
void  CGAL::Polygon_mesh_processing::reverse_face_orientations (PolygonMesh &pmesh) 
reverses for each face the order of the vertices along the face boundary. More...  
template<typename PolygonMesh , typename FaceRange >  
void  CGAL::Polygon_mesh_processing::reverse_face_orientations (const FaceRange &face_range, PolygonMesh &pmesh) 
reverses for each face in face_range the order of the vertices along the face boundary. More...  
template<class TriangleMesh , class NamedParameters >  
void  CGAL::Polygon_mesh_processing::orient (TriangleMesh &tm, const NamedParameters &np) 
makes each connected component of a closed triangulated surface mesh inward or outward oriented. More...  
template<class TriangleMesh , class VolumeFaceIndexMap , class NamedParameters >  
std::size_t  CGAL::Polygon_mesh_processing::volume_connected_components (const TriangleMesh &tm, VolumeFaceIndexMap volume_id_map, const NamedParameters &np) 
assigns to each face of tm an id corresponding to the volume connected component it contributes to. More...  
template<class TriangleMesh , class NamedParameters >  
bool  CGAL::Polygon_mesh_processing::does_bound_a_volume (const TriangleMesh &tm, const NamedParameters &np) 
indicates if tm bounds a volume. More...  
template<class TriangleMesh , class NamedParameters >  
void  CGAL::Polygon_mesh_processing::orient_to_bound_a_volume (TriangleMesh &tm, const NamedParameters &np) 
orients the connected components of tm to make it bound a volume. More...  
template<class PolygonMesh , class NamedParameters >  
void  CGAL::Polygon_mesh_processing::merge_reversible_connected_components (PolygonMesh &pm, const NamedParameters &np) 
reverses the connected components of tm having compatible boundary cycles that could be merged if their orientation were made compatible, and stitches them. More...  
#include <CGAL/Polygon_mesh_processing/orientation.h>
Enumeration type used to indicate the status of a set of faces classified by the function volume_connected_components()
.
The set of faces defines either a volume connected connected component in the case of VALID_VOLUME
or a surface connected component otherwise.
bool CGAL::Polygon_mesh_processing::does_bound_a_volume  (  const TriangleMesh &  tm, 
const NamedParameters &  np  
) 
#include <CGAL/Polygon_mesh_processing/orientation.h>
indicates if tm
bounds a volume.
See Definitions for details.
TriangleMesh  a model of MutableFaceGraph , HalfedgeListGraph and FaceListGraph . 
NamedParameters  a sequence of Named Parameters 
tm  a closed triangulated surface mesh 
np  an optional sequence of Named Parameters among the ones listed below 
CGAL::is_closed(tm)
tm
is selfintersecting the behavior of this function is undefined.
 
 

bool CGAL::Polygon_mesh_processing::duplicate_non_manifold_edges_in_polygon_soup  (  PointRange &  points, 
PolygonRange &  polygons  
) 
#include <CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h>
duplicates each point p at which the intersection of an infinitesimally small ball centered at p with the polygons incident to it is not a topological disk.
PointRange  a model of the concepts RandomAccessContainer and BackInsertionSequence whose value_type is the point type. 
PolygonRange  a model of the concept RandomAccessContainer whose value_type is a model of the concept RandomAccessContainer whose value_type is std::size_t , and is also a model of BackInsertionSequence . 
points  points of the soup of polygons. Some additional points might be pushed back to resolve nonmanifoldness or nonorientability issues. 
polygons  each element in the vector describes a polygon using the indices of the points in points . If needed the order of the indices of a polygon might be reversed. 
false
if some points were duplicated, thus producing a selfintersecting surface mesh. true
otherwise. orient_polygon_soup()
bool CGAL::Polygon_mesh_processing::is_outward_oriented  (  const TriangleMesh &  tm, 
const NamedParameters &  np  
) 
#include <CGAL/Polygon_mesh_processing/orientation.h>
tests whether a closed triangle mesh has a positive orientation.
A closed triangle mesh is considered to have a positive orientation if the normal vectors to all its faces point outside the domain bounded by the triangle mesh. The normal vector to each face is chosen pointing on the side of the face where its sequence of vertices is seen counterclockwise.
CGAL::is_closed(tm)
CGAL::is_triangle_mesh(tm)
tm
contains several connected components, they are oriented consistently. In other words, the answer to this predicate would be the same for each isolated connected component.TriangleMesh  a model of FaceListGraph 
NamedParameters  a sequence of Named Parameters 
tm  the closed triangle mesh free from selfintersections to be tested 
np  an optional sequence of Named Parameters among the ones listed below 
 

tm
. For performance reasons, it is left to the user to call the function does_bound_a_volume()
on a triangulated version of tm
to ensure the result returned is relevant. For advanced usages, the function volume_connected_components()
should be used instead.void CGAL::Polygon_mesh_processing::merge_reversible_connected_components  (  PolygonMesh &  pm, 
const NamedParameters &  np  
) 
#include <CGAL/Polygon_mesh_processing/orientation.h>
reverses the connected components of tm
having compatible boundary cycles that could be merged if their orientation were made compatible, and stitches them.
Connected components are examined by increasing number of faces.
PolygonMesh  a model of MutableFaceGraph , HalfedgeListGraph and FaceListGraph . 
NamedParameters  a sequence of Named Parameters 
pm  a surface mesh 
np  an optional sequence of Named Parameters among the ones listed below 
 
 

void CGAL::Polygon_mesh_processing::orient  (  TriangleMesh &  tm, 
const NamedParameters &  np  
) 
#include <CGAL/Polygon_mesh_processing/orientation.h>
makes each connected component of a closed triangulated surface mesh inward or outward oriented.
TriangleMesh  a model of FaceListGraph and MutableFaceGraph . 
NamedParameters  a sequence of Named Parameters 
tm  a closed triangulated surface mesh 
np  an optional sequence of Named Parameters among the ones listed below 
CGAL::is_closed(tm)
 
 
 

bool CGAL::Polygon_mesh_processing::orient_polygon_soup  (  PointRange &  points, 
PolygonRange &  polygons,  
const NamedParameters &  np  
) 
#include <CGAL/Polygon_mesh_processing/orient_polygon_soup.h>
tries to consistently orient a soup of polygons in 3D space.
When it is not possible to produce a combinatorial manifold surface, some points are duplicated. Because a polygon soup does not have any connectivity (each point has as many occurrences as the number of polygons it belongs to), duplicating one point (or a pair of points) amounts to duplicate the polygon to which it belongs.
These points are either an endpoint of an edge incident to more than two polygons, an endpoint of an edge between two polygons with incompatible orientations (during the reorientation process), or more generally a point p at which the intersection of an infinitesimally small ball centered at p with the polygons incident to it is not a topological disk.
The algorithm is described in [1].
PointRange  a model of the concepts RandomAccessContainer and BackInsertionSequence whose value type is the point type. 
PolygonRange  a model of the concept RandomAccessContainer whose value_type is a model of the concept RandomAccessContainer whose value_type is std::size_t . 
NamedParameters  a sequence of named parameters 
points  points of the soup of polygons. Some additional points might be pushed back to resolve nonmanifoldness or nonorientability issues. 
polygons  each element in the vector describes a polygon using the index of the points in points . If needed the order of the indices of a polygon might be reversed. 
np  optional sequence of named parameters among the ones listed below 

true
if the orientation operation succeded. false
if some points were duplicated, thus producing a selfintersecting polyhedron. void CGAL::Polygon_mesh_processing::orient_to_bound_a_volume  (  TriangleMesh &  tm, 
const NamedParameters &  np  
) 
#include <CGAL/Polygon_mesh_processing/orientation.h>
orients the connected components of tm
to make it bound a volume.
See Definitions for a precise definition.
TriangleMesh  a model of MutableFaceGraph , HalfedgeListGraph and FaceListGraph . 
NamedParameters  a sequence of Named Parameters 
tm  a closed triangulated surface mesh 
np  an optional sequence of Named Parameters among the ones listed below 
CGAL::is_closed(tm)
 
 
 

void CGAL::Polygon_mesh_processing::orient_triangle_soup_with_reference_triangle_mesh  (  const TriangleMesh &  tm_ref, 
PointRange &  points,  
TriangleRange &  triangles,  
const NamedParameters &  np  
) 
#include <CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h>
orients each triangle of a triangle soup using the orientation of its closest non degenerate triangle in tm_ref
.
Concurrency_tag  enables sequential versus parallel orientation. Possible values are Sequential_tag (the default), Parallel_if_available_tag , and Parallel_tag . 
PointRange  a model of the concepts RandomAccessContainer and BackInsertionSequence whose value type is the point type. 
TriangleRange  a model of the concept RandomAccessContainer whose value_type is a model of the concept RandomAccessContainer whose value_type is std::size_t and of size 3. 
TriangleMesh  a model of FaceListGraph and MutableFaceGraph . 
tm_ref  the reference triangle_mesh. 
points  the points of the soup. 
triangles  the triangles of the soup. 
np  an optional sequence of Named Parameters among the ones listed below 
 

PointRange
, geom_traits
and vertex_point_map
must be the same. void CGAL::Polygon_mesh_processing::reverse_face_orientations  (  PolygonMesh &  pmesh  ) 
#include <CGAL/Polygon_mesh_processing/orientation.h>
reverses for each face the order of the vertices along the face boundary.
PolygonMesh  a model of FaceListGraph and MutableFaceGraph 
void CGAL::Polygon_mesh_processing::reverse_face_orientations  (  const FaceRange &  face_range, 
PolygonMesh &  pmesh  
) 
#include <CGAL/Polygon_mesh_processing/orientation.h>
reverses for each face in face_range
the order of the vertices along the face boundary.
The function does not perform any control and if the orientation change of the faces makes the polygon mesh invalid, the behavior is undefined.
PolygonMesh  a model of FaceListGraph and MutableFaceGraph 
FaceRange  range of face descriptors, model of Range . Its iterator type is InputIterator . 
std::size_t CGAL::Polygon_mesh_processing::volume_connected_components  (  const TriangleMesh &  tm, 
VolumeFaceIndexMap  volume_id_map,  
const NamedParameters &  np  
) 
#include <CGAL/Polygon_mesh_processing/orientation.h>
assigns to each face of tm
an id corresponding to the volume connected component it contributes to.
Using the adjacency relation of two faces along an edge, a triangle mesh can be split into connected components (surface components in the following). A surface component without boundary separates the 3D space into an infinite and a finite volume. We say that the finite volume is enclosed by this surface component.
The volume connected components (volume components in the following) are defined as follows: Each surface component S
that is outside any volume enclosed by another surface component defines the outer boundary of a volume component. Each surface component that is inside the volume enclosed by S
defines a hole if it is included in no other volume enclosed by a surface component but S
. Ignoring the identified volume component, the same procedure is recursively repeated for all surface components in each hole.
There are some special cases:
do_orientation_tests
is set to true
, if the holes are not all equally oriented (all inward or all outward) or if the holes and the outer boundary are equally oriented, each surface component is reported as a volume component, and so are all the surface components inside the corresponding enclosed volumesdo_orientation_tests
is set to true
and the surface components that are outside all enclosed volumes are inward oriented, they are then considered as holes of the unbounded volume (that has no outer boundary)A property map for CGAL::vertex_point_t
must be either available as an internal property map of tm
or provided as one of the Named Parameters.
TriangleMesh  a model of FaceListGraph 
VolumeFaceIndexMap  a model of WritablePropertyMap with boost::graph_traits<TriangleMesh>::face_descriptor as key type and boost::graph_traits<TriangleMesh>::faces_size_type as value type. 
NamedParameters  a sequence of Named Parameters 
tm  the input triangle mesh 
volume_id_map  the property map filled by this function with indices of volume components associated to the faces of tm 
np  an optional sequence of Named Parameters among the ones listed below 
CGAL::is_closed(tm)
 
 
 
 
 
 
 
 
 
 
 

tm