CGAL 5.1 - Polygon Mesh Processing
|
Functions to compute or change the orientation of faces and surfaces.
Functions | |
template<class PointRange , class PolygonRange > | |
bool | CGAL::Polygon_mesh_processing::orient_polygon_soup (PointRange &points, PolygonRange &polygons) |
template<class PointRange , class PolygonRange > | |
bool | CGAL::Polygon_mesh_processing::duplicate_non_manifold_edges_in_polygon_soup (PointRange &points, PolygonRange &polygons) |
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) |
template<typename TriangleMesh , typename NamedParameters > | |
bool | CGAL::Polygon_mesh_processing::is_outward_oriented (const TriangleMesh &tm, const NamedParameters &np) |
template<typename PolygonMesh > | |
void | CGAL::Polygon_mesh_processing::reverse_face_orientations (PolygonMesh &pmesh) |
template<typename PolygonMesh , typename FaceRange > | |
void | CGAL::Polygon_mesh_processing::reverse_face_orientations (const FaceRange &face_range, PolygonMesh &pmesh) |
template<class TriangleMesh , class NamedParameters > | |
void | CGAL::Polygon_mesh_processing::orient (TriangleMesh &tm, const NamedParameters &np) |
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) |
template<class TriangleMesh , class NamedParameters > | |
bool | CGAL::Polygon_mesh_processing::does_bound_a_volume (const TriangleMesh &tm, const NamedParameters &np) |
template<class TriangleMesh , class NamedParameters > | |
void | CGAL::Polygon_mesh_processing::orient_to_bound_a_volume (TriangleMesh &tm, const NamedParameters &np) |
template<class PolygonMesh , class NamedParameters > | |
void | CGAL::Polygon_mesh_processing::merge_reversible_connected_components (PolygonMesh &pm, const NamedParameters &np) |
#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 | optional sequence of Named Parameters among the ones listed below |
CGAL::is_closed(tm)
vertex_point_map | the property map with the points associated to the vertices of tm . If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh |
face_index_map | a property map containing the index of each face of tm . |
is_cc_outward_oriented | a reference_wrapper (either from boost or the standard library) containing a reference to an object of type std::vector<bool> . The size of the vector is exactly the number of connected components. For each connected component identified using its id ccid , the output of is_outward_oriented called on the submesh corresponding to this connected component is the value at the position ccid in the parameter vector. |
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 non-manifoldness or non-orientability 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 self-intersecting 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 self-intersections to be tested |
np | optional sequence of Named Parameters among the ones listed below |
vertex_point_map | the property map with the points associated to the vertices of tm If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh |
geom_traits | a geometric traits class instance |
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 for Polygon Mesh Processing |
pm | a surface mesh |
np | optional sequence of Named Parameters for Polygon Mesh Processing among the ones listed below |
vertex_point_map | the property map with the points associated to the vertices of pm . If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in PolygonMesh |
face_index_map | a property map containing an index for each face initialized from 0 to num_faces(pm). |
maximum_number_of_faces | if not 0 (default), a connected component is considered reversible only if it has no more faces than the value given. Otherwise, it is always considered reversible. |
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 for Polygon Mesh Processing |
tm | a closed triangulated surface mesh |
np | optional sequence of Named Parameters for Polygon Mesh Processing among the ones listed below |
CGAL::is_closed(tm)
vertex_point_map | the property map with the points associated to the vertices of tm . If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh |
face_index_map | a property map containing the index of each face of tm . |
outward_orientation | if set to true (default) indicates that each connected component will be outward oriented, (inward oriented if false ). |
bool CGAL::Polygon_mesh_processing::orient_polygon_soup | ( | PointRange & | points, |
PolygonRange & | polygons | ||
) |
#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 re-orientation 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 . |
points | points of the soup of polygons. Some additional points might be pushed back to resolve non-manifoldness or non-orientability 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. |
true
if the orientation operation succeded. false
if some points were duplicated, thus producing a self-intersecting 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 for Polygon Mesh Processing |
tm | a closed triangulated surface mesh |
np | optional sequence of Named Parameters for Polygon Mesh Processing among the ones listed below |
CGAL::is_closed(tm)
vertex_point_map | the property map with the points associated to the vertices of tm . If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh |
face_index_map | a property map containing the index of each face of tm . |
outward_orientation | if set to true (default) the outer connected components will be outward oriented (inward oriented if set to false ). If the outer connected components are inward oriented, it means that the infinity will be considered as part of the volume bounded by 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 | optional sequence of Named Parameters for Polygon Mesh Processing among the ones listed below |
vertex_point_map | the property map with the points associated to the vertices of tm_ref . If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh |
geom_traits | a geometric traits class instance. The traits class must provide the nested functor Collinear_3 to check whether three points are collinear. |
PointRange
, geom_traits
and vertex_point_map
must be the same. 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 . |
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 |
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<PolygonMesh>::face_descriptor as key type and boost::graph_traits<PolygonMesh>::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 | optional sequence of Named Parameters among the ones listed below |
CGAL::is_closed(tm)
vertex_point_map | the property map with the points associated to the vertices of tm . If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh |
face_index_map | a property map containing a unique id per face of tm , in the range [0, num_faces(tm)[ |
face_connected_component_map | a property map filled by this function and that will contain for each face the id of its surface component in the range [0, number of surface components - 1[ |
volume_inclusions | a reference_wrapper (either from boost or the standard library) containing a reference to an object that must be a model of the BackInsertionSequence concept, with a value type being a model of BackInsertionSequence of std::size_t , both types having the functions reserve() and push_back() . The size of the container is exactly the number of surface components of tm . The container at position k contains the ids of all the surface components that are the first intersected by any ray with source on the surface component k and directed outside the volume enclosed by the surface component k . There is only one such id but when some surface components intersect. |
do_orientation_tests | if true (the default value), the orientation of the faces of each surface components will be taken into account for the definition of the volume. If false , the face orientation is ignored and the volumes are defined only by the nesting of surface components. |
error_codes | a reference_wrapper (either from boost or the standard library) containing a reference to a container that must be a model of the BackInsertionSequence concept, with a value_type being Volume_error_code The size of the container is exactly the number of volume components. The container indicates the status of a volume assigned to a set of faces. The description of the value type is given in the documentation of the enumeration type. |
do_self_intersection_tests | If false (the default value), it is assumed that tm does not contains any self-intersections. if true , the input might contain some self-intersections and a test is done prior to the volume decomposition. |
connected_component_id_to_volume_id | a reference_wrapper (either from boost or the standard library) containing a reference to a container that must be a model of the BackInsertionSequence concept, with a value_type being std::size_t . The size of the container is exactly the number of connected components. For each connected component identified using its id ccid , the id of the volume it contributes to describe is the value at the position ccid in the container. |
nesting_levels | a reference_wrapper (either from boost or the standard library) containing a reference to a container that must be a model of the BackInsertionSequence concept, with a value_type being std::size_t . The size of the container is exactly the number of connected components. For each connected component identified using its id ccid , the container contains the number of connected components containing on its bounded side this component. |
is_cc_outward_oriented | a reference_wrapper (either from boost or the standard library) containing a reference to a container that must be a model of the BackInsertionSequence concept, with a value_type being bool . The size of the container is exactly the number of connected components. For each connected component identified using its id ccid , the output of is_outward_oriented() called on the triangle mesh corresponding to this connected component is the value at the position ccid in the container. |
intersecting_volume_pairs_output_iterator | Output iterator into which pairs of ids (id must be convertible to |
tm