template<class TriangleMesh, class VertexPointMap = Default, class Kernel = Default, class AABBTree = Default, class Has_rotation = CGAL::Tag_true>
class CGAL::Rigid_triangle_mesh_collision_detection< TriangleMesh, VertexPointMap, Kernel, AABBTree, Has_rotation >
This class provides methods to perform some intersection tests between triangle meshes that undergo affine transformations (rotation, translation, and scaling).
Meshes are added to an internal set and are referenced using an id assigned when added to the set. Note that the exact predicate framework applies on the meshes after having applied the transformation to the coordinates of the points of the vertices of each mesh.
- Template Parameters
-
TriangleMesh | a model of HalfedgeListGraph and FaceListGraph |
VertexPointMap | a model of ReadablePropertyMap with the vertex descriptor of TriangleMesh as key type, and a point from a CGAL Kernel as value type. Default is the internal point property map of TriangleMesh if it exists. |
Kernel | a model of CGAL Kernel. Default is the kernel of the value type of VertexPointMap retrieved using Kernel_traits . |
AABBTree | an AABB_tree that can containing faces of TriangleMesh . Default is using AABB_traits with AABB_face_graph_triangle_primitive as primitive type. |
Has_rotation | tag indicating whether the transformations applied to meshes may contain rotations (Tag_true ) or if only translations and scalings are applied (Tag_false ). Some optimizations are switch on in case there are no rotations. |
|
template<class NamedParameters > |
std::size_t | add_mesh (const TriangleMesh &tm, const NamedParameters &np) |
| adds mesh tm to the set of meshes to be considered for intersection. More...
|
|
template<class NamedParameters > |
std::size_t | add_mesh (const AABB_tree &tree, const TriangleMesh &tm, const NamedParameters &np) |
| adds an instance of a triangulated surface mesh using an external tree of its faces. More...
|
|
void | set_transformation (std::size_t mesh_id, const Aff_transformation_3< K > &aff_trans) |
| sets the transformation associated to a mesh identified by its id in the set.
|
|
template<class MeshIdRange > |
std::vector< std::size_t > | get_all_intersections (std::size_t mesh_id, const MeshIdRange &ids) const |
| returns a vector of the ids of meshes within ids that have at least a face intersecting a face of the mesh with id mesh_id . More...
|
|
std::vector< std::size_t > | get_all_intersections (std::size_t mesh_id) const |
| returns a vector of the ids of meshes in the set that have at least a face intersecting a face of the mesh with id mesh_id
|
|
template<class MeshIdRange > |
std::vector< std::pair< std::size_t, bool > > | get_all_intersections_and_inclusions (std::size_t mesh_id, const MeshIdRange &ids) const |
| returns a vector of the ids of meshes within ids that are intersecting with the mesh with id mesh_id , considering volume inclusions for closed meshes. More...
|
|
std::vector< std::pair< std::size_t, bool > > | get_all_intersections_and_inclusions (std::size_t mesh_id) const |
| returns a vector of the ids of meshes in the set that are intersecting with the mesh with id mesh_id , considering volume inclusions for closed meshes. More...
|
|
template<class TriangleMesh , class VertexPointMap = Default, class Kernel = Default, class AABBTree = Default, class Has_rotation = CGAL::Tag_true>
template<class NamedParameters >
adds an instance of a triangulated surface mesh using an external tree of its faces.
- Warning
- The tree is not copied and the lifetime of
tree
must be longer than that of this class.
- Template Parameters
-
- Returns
- the id of
tm
used to refer to that mesh.
- Parameters
-
tree | an AABB-tree of faces of a mesh |
tm | triangulated surface mesh |
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 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 . It must be initialized and the value must be unique per face and in the range [0, num_faces(tm)[ . |
apply_per_connected_component | if false , tm is assumed to have only one connected component, avoiding the extraction of connected components. Default is true . |
template<class TriangleMesh , class VertexPointMap = Default, class Kernel = Default, class AABBTree = Default, class Has_rotation = CGAL::Tag_true>
template<class MeshIdRange >
returns a vector of the ids of meshes within ids
that have at least a face intersecting a face of the mesh with id mesh_id
.
If mesh_id
is in ids
it is not reported.
- Template Parameters
-
MeshIdRange | a range of ids convertible to std::size_t . |
template<class TriangleMesh , class VertexPointMap = Default, class Kernel = Default, class AABBTree = Default, class Has_rotation = CGAL::Tag_true>
template<class MeshIdRange >
returns a vector of the ids of meshes within ids
that are intersecting with the mesh with id mesh_id
, considering volume inclusions for closed meshes.
More precisely, if at least one face of a mesh with id i
intersects a face of the mesh with id mesh_id
, the pair (i, false)
is put in the output vector. If there is no face intersection, but at least one of the meshes with ids i
and mesh_id
is closed, and at least one connected component is included in the bounded volume defined by a closed mesh then the pair (i, true)
is put in the output vector (independently of mesh i
or mesh_id
being the one including the other). The inclusion test is done using Side_of_triangle_mesh
, in particular surface orientation is ignored and only the nesting level of connected components defines a bounded volume. If a mesh has some self-intersection the inclusion test may return incorrect results. If mesh_id
is in ids
it is not reported.
- Template Parameters
-
MeshIdRange | a range of ids convertible to std::size_t . |
- Note
- If a mesh is made of several connected components and at least one component is not closed, then no inclusion test will be made even if some components are closed.
template<class TriangleMesh , class VertexPointMap = Default, class Kernel = Default, class AABBTree = Default, class Has_rotation = CGAL::Tag_true>
returns a vector of the ids of meshes in the set that are intersecting with the mesh with id mesh_id
, considering volume inclusions for closed meshes.
See the previous overload for details.