17struct MeshIntersectionResult
29 explicit operator bool()
const {
return proj.face.valid(); }
40 const FacePredicate & validFaces = {} );
50 const FacePredicate & validFaces = {} );
52struct MultiRayMeshIntersectResult
58 std::vector<TriPointf> *
isectBary =
nullptr;
59 std::vector<Vector3f> * isectPts =
nullptr;
68 const std::vector<Vector3f>& origins,
69 const std::vector<Vector3f>& dirs,
72 float rayStart = 0.0f,
float rayEnd = FLT_MAX,
73 bool closestIntersect =
true,
74 const FacePredicate & validFaces = {}
77struct MultiMeshIntersectionResult : MeshIntersectionResult
80 const Mesh *
mesh =
nullptr;
98 float rayStart = 0.0f,
float rayEnd = FLT_MAX );
101 double rayStart = 0.0,
double rayEnd = DBL_MAX );
121 std::vector<FaceId> * fsVec =
nullptr );
130 std::vector<FaceId> * fsVec =
nullptr );
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRAABBTree.h:16
Definition MRMeshIntersect.h:18
new unsafe MR.MeshTriPoint mtp
new unsafe ref float distanceAlongLine
new unsafe MR.PointOnFace proj
Definition MRMesh/MRMesh.h:23
Definition MRMeshIntersect.h:78
new unsafe MR.? Const_Mesh mesh
Definition MRMeshIntersect.h:53
new unsafe MR.Std.? Vector_MRTriPointf isectBary
new unsafe MR.? BitSet intersectingRays
new unsafe MR.Std.? Vector_MRFaceId isectFaces
new unsafe MR.Std.? Vector_Float rayDistances
MRMESH_API void multiRayMeshIntersect(const MeshPart &meshPart, const std::vector< Vector3f > &origins, const std::vector< Vector3f > &dirs, const MultiRayMeshIntersectResult &result, float rayStart=0.0f, float rayEnd=FLT_MAX, bool closestIntersect=true, const FacePredicate &validFaces={})
MRMESH_API MeshIntersectionResult rayMeshIntersect(const MeshPart &meshPart, const Line3f &line, float rayStart=0.0f, float rayEnd=FLT_MAX, const IntersectionPrecomputes< float > *prec=nullptr, bool closestIntersect=true, const FacePredicate &validFaces={})
MRMESH_API void xyPlaneMeshIntersect(const MeshPart &meshPart, float zLevel, FaceBitSet *fs, UndirectedEdgeBitSet *ues, VertBitSet *vs, std::vector< FaceId > *fsVec=nullptr)
MRMESH_API MultiMeshIntersectionResult rayMultiMeshAnyIntersect(const std::vector< Line3fMesh > &lineMeshes, float rayStart=0.0f, float rayEnd=FLT_MAX)
MRMESH_API void planeMeshIntersect(const MeshPart &meshPart, const Plane3f &plane, FaceBitSet *fs, UndirectedEdgeBitSet *ues, VertBitSet *vs, std::vector< FaceId > *fsVec=nullptr)
Line3Mesh< double > Line3dMesh
Definition MRMeshIntersect.h:93
Line3Mesh< float > Line3fMesh
Definition MRMeshIntersect.h:92
std::function< bool(const MeshIntersectionResult &)> MeshIntersectionCallback
Definition MRMeshIntersect.h:105
MRMESH_API void rayMeshIntersectAll(const MeshPart &meshPart, const Line3f &line, MeshIntersectionCallback callback, float rayStart=0.0f, float rayEnd=FLT_MAX, const IntersectionPrecomputes< float > *prec=nullptr)
Definition MRCameraOrientationPlugin.h:8
Definition MRMeshFwd.h:503
Definition MRMeshIntersect.h:85
Line3< T > line
in the reference frame of mesh
Definition MRMeshIntersect.h:86
const Mesh * mesh
must be set a valid pointer before use
Definition MRMeshIntersect.h:88
const FaceBitSet * region
may remain nullptr, meaning all mesh
Definition MRMeshIntersect.h:90
const AABBTree * tree
must be set a valid pointer before use
Definition MRMeshIntersect.h:89
IntersectionPrecomputes< T > * prec
set it to a valid pointer for better performance
Definition MRMeshIntersect.h:87