CGAL 4.10.2 - Polygon Mesh Processing
|
#include <CGAL/Side_of_triangle_mesh.h>
This class provides an efficient point location functionality with respect to a domain bounded by one or several disjoint closed triangle meshes.
A point is said to be on the bounded side of the domain if an odd number of surfaces is crossed when walking from the point to infinity.
The input triangle mesh is expected to contain no self-intersections and to be free from self-inclusions.
In case the triangle mesh has several connected components, the same test is performed and returns correct results. In case of self-inclusions, the user should be aware that the predicate called inside every other sub-volume bounded by a nested surface will return in turns CGAL::ON_BOUNDED_SIDE
and CGAL::ON_UNBOUNDED_SIDE
, following the aforementioned parity criterion.
This class depends on the package 3D Fast Intersection and Distance Computation.
TriangleMesh | a triangulated surface mesh, model of FaceListGraph |
GeomTraits | a geometric traits class, model of Kernel |
VertexPointMap | a model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and GeomTraits::Point_3 as value type. The default is typename boost::property_map<TriangleMesh,vertex_point_t>::type . |
Implementation Details
The current implementation is based on the number of triangles intersected by a ray having the query point as source. The do-intersect predicate used to detect if a triangle is intersected is able to detect if a triangle is intersected in its interior or on its boundary. In case it is intersected on its boundary, another ray is picked. In order to speed queries, the first ray used is an axis aligned one that depends on the extents of the bbox of the input mesh. In case other rays are needed to conclude, the rays are generated from a random uniform sampling of a sphere.
Public Types | |
typedef unspecified_type | AABB_tree |
AABB-tree accepting faces of TriangleMesh | |
Public Member Functions | |
Side_of_triangle_mesh (const TriangleMesh &tmesh, VertexPointMap vpmap, const GeomTraits >=GeomTraits()) | |
Constructor with one triangulated surface mesh. More... | |
Side_of_triangle_mesh (const TriangleMesh &tmesh, const GeomTraits >=GeomTraits()) | |
Constructor with one surface triangle mesh, using get(boost::vertex_point, tmesh) as vertex point property map. More... | |
Side_of_triangle_mesh (const AABB_tree &tree, const GeomTraits >=GeomTraits()) | |
Constructor that takes a pre-built CGAL AABB_tree of the triangulated surface mesh primitives. More... | |
Bounded_side | operator() (const Point &point) const |
returns the location of a query point More... | |
CGAL::Side_of_triangle_mesh< TriangleMesh, GeomTraits, VertexPointMap >::Side_of_triangle_mesh | ( | const TriangleMesh & | tmesh, |
VertexPointMap | vpmap, | ||
const GeomTraits & | gt = GeomTraits() |
||
) |
Constructor with one triangulated surface mesh.
tmesh | the triangulated surface mesh bounding the domain to be tested |
vpmap | the property map with the points associated to the vertices of tmesh |
gt | an instance of the geometric traits class |
CGAL::is_closed(tmesh) && CGAL::is_triangle_mesh(tmesh)
CGAL::Side_of_triangle_mesh< TriangleMesh, GeomTraits, VertexPointMap >::Side_of_triangle_mesh | ( | const TriangleMesh & | tmesh, |
const GeomTraits & | gt = GeomTraits() |
||
) |
Constructor with one surface triangle mesh, using get(boost::vertex_point, tmesh)
as vertex point property map.
tmesh | the triangulated surface mesh bounding the domain to be tested |
gt | an instance of the geometric traits class |
CGAL::is_closed(tmesh) && CGAL::is_triangle_mesh(tmesh)
CGAL::Side_of_triangle_mesh< TriangleMesh, GeomTraits, VertexPointMap >::Side_of_triangle_mesh | ( | const AABB_tree & | tree, |
const GeomTraits & | gt = GeomTraits() |
||
) |
Constructor that takes a pre-built CGAL AABB_tree
of the triangulated surface mesh primitives.
tree | a CGAL AABB_tree with AABB_face_graph_triangle_primitive as Primitive type |
gt | an instance of the geometric traits class |
CGAL::is_closed(tmesh) && CGAL::is_triangle_mesh(tmesh)
Bounded_side CGAL::Side_of_triangle_mesh< TriangleMesh, GeomTraits, VertexPointMap >::operator() | ( | const Point & | point) | const |
returns the location of a query point
point | the query point to be located with respect to the input polyhedral surface |
CGAL::ON_BOUNDED_SIDE
if the point is inside the volume bounded by the input triangle meshCGAL::ON_BOUNDARY
if the point is on triangle meshCGAL::ON_UNBOUNDED_SIDE
if the point is outside triangle mesh