MeshLib Documentation
Loading...
Searching...
No Matches
MRMesh/MRMeshCollidePrecise.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRId.h"
4#include "MRMeshPart.h"
6
7#include <functional>
8
9namespace MR
10{
11
14
16struct EdgeTri
17{
18 EdgeId edge;
19 FaceId tri;
20 EdgeTri() = default;
21 EdgeTri( EdgeId e, FaceId t ) : edge( e ), tri( t ) { }
22};
23
24inline bool operator==( const EdgeTri& a, const EdgeTri& b )
25{
26 return a.edge.undirected() == b.edge.undirected() && a.tri == b.tri;
27}
28
30{
32 std::vector<EdgeTri> edgesAtrisB;
33 std::vector<EdgeTri> edgesBtrisA;
34};
35
41MRMESH_API PreciseCollisionResult findCollidingEdgeTrisPrecise( const MeshPart & a, const MeshPart & b,
42 ConvertToIntVector conv, const AffineXf3f* rigidB2A = nullptr, bool anyIntersection = false );
43
46 const Mesh & a, const std::vector<EdgeId> & edgesA,
47 const Mesh & b, const std::vector<FaceId> & facesB,
48 ConvertToIntVector conv, const AffineXf3f * rigidB2A = nullptr );
49
52 const Mesh & a, const std::vector<FaceId> & facesA,
53 const Mesh & b, const std::vector<EdgeId> & edgesB,
54 ConvertToIntVector conv, const AffineXf3f * rigidB2A = nullptr );
55
60MRMESH_API CoordinateConverters getVectorConverters( const MeshPart& a, const MeshPart& b,
61 const AffineXf3f* rigidB2A = nullptr );
62
64
65} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
MRMESH_API PreciseCollisionResult findCollidingEdgeTrisPrecise(const MeshPart &a, const MeshPart &b, ConvertToIntVector conv, const AffineXf3f *rigidB2A=nullptr, bool anyIntersection=false)
finds all pairs of colliding edges from one mesh and triangle from another mesh
MRMESH_API CoordinateConverters getVectorConverters(const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr)
creates simple converters from Vector3f to Vector3i and back in mesh parts area range
MRMESH_API bool operator==(const BitSet &a, const BitSet &b)
compare that two bit sets have the same set bits (they can be equal even if sizes are distinct but la...
Definition MRCameraOrientationPlugin.h:8
std::function< Vector3i(const Vector3f &)> ConvertToIntVector
float-to-int coordinate converter
Definition MRMesh/MRPrecisePredicates3.h:47
this struct contains coordinate converters float-int-float
Definition MRMesh/MRPrecisePredicates3.h:52
edge from one mesh and triangle from another mesh
Definition MRMesh/MRMeshCollidePrecise.h:17
EdgeTri(EdgeId e, FaceId t)
Definition MRMesh/MRMeshCollidePrecise.h:21
EdgeId edge
Definition MRMesh/MRMeshCollidePrecise.h:18
EdgeTri()=default
FaceId tri
Definition MRMesh/MRMeshCollidePrecise.h:19
Definition MRMesh/MRMesh.h:23
Definition MRMesh/MRMeshCollidePrecise.h:30
std::vector< EdgeTri > edgesBtrisA
Definition MRMesh/MRMeshCollidePrecise.h:33
std::vector< EdgeTri > edgesAtrisB
each edge is directed to have its origin inside and its destination outside of the other mesh
Definition MRMesh/MRMeshCollidePrecise.h:32