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.
template<class Concurrency_tag = CGAL::Sequential_tag, class ReferencePointRange , class ReferenceFaceRange , class PointRange , class FaceRange , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>
orients each triangle of a triangle soup using the orientation of its closest non degenerate triangle in a triangle soup.
template<class Concurrency_tag = Sequential_tag, class PointRange , class TriangleRange , class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>
reverses the connected components of tm having compatible boundary cycles that could be merged if their orientation were made compatible, and stitches them.
template<class PolygonMesh , class FaceBitMap , class NamedParameters = parameters::Default_named_parameters>
identifies faces whose orientation must be reversed in order to enable stitching of connected components.
Each face is assigned a bit (false or true) such that two faces have compatible orientations iff they are assigned the same bits. If pm features several connected components (ignoring edge orientations), the property map passed to the named parameter face_partition_id_map will indicate for each face to which connected component it belongs. Note that two faces in different connected components are not impacting each others' orientations, so comparing their associated bits in face_bit_map is irrelevant.
face bit map indicating if a face orientation should be reversed to be stitchable (see CGAL::Polygon_mesh_processing::stitch_borders()) with another face. If false is returned, the map will not be filled.
np
an optional sequence of Named Parameters among the ones listed below
Returns
true if pm can be reoriented and false otherwise.
Optional Named Parameters
a property map associating points to the vertices of pm
Type: a class model of ReadablePropertyMap with boost::graph_traits<PolygonMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, pm)
Extra: If this parameter is omitted, an internal property map for CGAL::vertex_point_t should be available for the vertices of pm.
a property map filled by this function and that will contain for each face the id of its surface component after reversal and stitching in the range [0, n - 1], with n the number of such components.
Type: a class model of WritablePropertyMap with boost::graph_traits<PolygonMesh>::face_descriptor as key type and std::size_t as value type
an optional sequence of Named Parameters among the ones listed below
Precondition
CGAL::is_closed(tm)
Attention
if tm is self-intersecting the behavior of this function is undefined.
Optional Named Parameters
a property map associating points to the vertices of tm
Type: a class model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, tm)
a property map associating to each face of tm a unique index between 0 and num_faces(tm) - 1
Type: a class model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::face_descriptor as key type and std::size_t as value type
Default: an automatically indexed internal map
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. The size of the container is exactly the number of connected components.
Type: 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 value type bool
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.
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.
Returns
false if some points were duplicated, thus producing a self-intersecting surface mesh.
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.
Precondition
CGAL::is_closed(tm)
CGAL::is_triangle_mesh(tm)
If 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.
Extra: The geometric traits class must be compatible with the vertex point type.
Note
This function is only doing an orientation test for one connected component of 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.
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.
an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
a property map associating points to the vertices of pm
Type: a class model of ReadablePropertyMap with boost::graph_traits<PolygonMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, pm)
Extra: If this parameter is omitted, an internal property map for CGAL::vertex_point_t should be available for the vertices of pm.
a property map associating to each face of pm a unique index between 0 and num_faces(pm) - 1)
Type: a class model of ReadablePropertyMap with boost::graph_traits<PolygonMesh>::face_descriptor as key type and std::size_t as value type
Default: an automatically indexed internal map
If not 0, a connected component is considered reversible only if it has no more faces than the value given. Otherwise, it is always considered reversible.
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.
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.
np
optional sequence of named parameters among the ones listed below
Optional Named Parameters
a visitor used to be notified of the presence of non-manifold simplices and of the modifications done to polygons during orientation.
template<class Concurrency_tag = Sequential_tag, class PointRange , class TriangleRange , class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>
template<class Concurrency_tag = CGAL::Sequential_tag, class ReferencePointRange , class ReferenceFaceRange , class PointRange , class FaceRange , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>
triples of indices of points in ref_points defining the triangles of the reference soup
points
the points of the soup to be oriented
faces
triples of indices of points in points defining the triangles of the soup
np1
an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
a property map associating points to the elements of the point set ref_points
Type: a model of ReadablePropertyMap whose key type is the value type of the iterator of ReferencePointRange and whose value type is geom_traits::Point_3
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:
a non-closed surface component is reported as a volume component ignoring any inclusion test
a self-intersecting surface component is reported as a volume component ignoring any inclusion test
a surface component intersecting another surface component is reported as a volume component, and so are all the surface components inside its enclosed volume
if 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 volumes
If do_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 model of WritablePropertyMap with boost::graph_traits<TriangleMesh>::face_descriptor as key type and boost::graph_traits<TriangleMesh>::faces_size_type as value type.
Extra: The geometric traits class must be compatible with the vertex point type.
a property map associating to each face of tm a unique index between 0 and num_faces(tm) - 1
Type: a class model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::face_descriptor as key type and std::size_t as value type
Default: an automatically indexed internal 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]
Type: a class model of WritablePropertyMap with boost::graph_traits<TriangleMesh>::face_descriptor as key type and std::size_t as value type
Default: an automatically indexed internal map
a container, which contains at position k 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. The size of the container is exactly the number of surface components of tm.
Type: 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()
Default: unused
If true, 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.
Type: Boolean
Default: true
a container which 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. The size of the container is exactly the number of volume components.
Type: 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 value type Volume_error_code
Default: unused
If false, 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.
Type: Boolean
Default: false
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. The size of the container is exactly the number of connected components.
Type: 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 value type std::size_t
Default: unused
For each connected component identified using its id ccid, the container contains the number of connected components containing on its bounded side this component. The size of the container is exactly the number of connected components.
Type: 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 value type std::size_t
Default: unused
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. The size of the container is exactly the number of connected components.
Type: 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 value type bool
Default: unused
Output iterator into which pairs of ids (id must be convertible to std::size_t) can be put. Each pair of connected components intersecting will be reported using their ids. If do_self_intersection_tests named parameter is set to false, nothing will be reported.