30 [[nodiscard]]
explicit operator bool()
const {
return proj.
valid(); }
57 float upDistLimitSq = FLT_MAX,
58 const AffineXf3f * xf =
nullptr,
59 float loDistLimitSq = 0,
61 const std::function<bool(
const MeshProjectionResult&)> & validProjections = {} );
73 const MeshPart & mp,
const AABBTree & tree,
74 float upDistLimitSq = FLT_MAX,
75 const AffineXf3f * xf =
nullptr,
76 float loDistLimitSq = 0,
78 const std::function<bool(
const MeshProjectionResult&)> & validProjections = {} );
113 float upDistLimitSq = FLT_MAX,
float loDistLimitSq = 0 );
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
Definition MRAABBTree.h:16
MRMESH_API MeshMeshSignedDistanceResult findSignedDistance(const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr, float upDistLimitSq=FLT_MAX)
computes minimal distance between two meshes
MRMESH_API MeshProjectionTransforms createProjectionTransforms(AffineXf3f &storageXf, const AffineXf3f *pointXf, const AffineXf3f *treeXf)
Creates structure with simplified transforms for projection functions, with rigidXfPoint applied to p...
MRMESH_API void findTrisInBall(const MeshPart &mp, const Ball3f &ball, const FoundTriCallback &foundCallback, const FacePredicate &validFaces={})
std::function< Processing(const MeshProjectionResult &found, Ball3f &ball)> FoundTriCallback
this callback is invoked on every triangle at least partially in the ball, and allows changing (shrin...
Definition MRMesh/MRMeshProject.h:90
MRMESH_API MeshProjectionResult findProjectionSubtree(const Vector3f &pt, const MeshPart &mp, const AABBTree &tree, float upDistLimitSq=FLT_MAX, const AffineXf3f *xf=nullptr, float loDistLimitSq=0, const FacePredicate &validFaces={}, const std::function< bool(const MeshProjectionResult &)> &validProjections={})
computes the closest point on mesh (or its region) to given point
std::function< Processing(FaceId found, Ball3f &ball)> FoundBoxedTriCallback
Definition MRMesh/MRMeshProject.h:82
MRMESH_API void findBoxedTrisInBall(const MeshPart &mp, Ball3f ball, const FoundBoxedTriCallback &foundCallback)
MRMESH_API MeshProjectionResult findProjection(const Vector3f &pt, const MeshPart &mp, float upDistLimitSq=FLT_MAX, const AffineXf3f *xf=nullptr, float loDistLimitSq=0, const FacePredicate &validFaces={}, const std::function< bool(const MeshProjectionResult &)> &validProjections={})
computes the closest point on mesh (or its region) to given point
std::function< bool(FaceId)> FacePredicate
Definition MRMesh/MRMeshFwd.h:479
Processing
typically returned from callbacks to control the behavior of main algorithm
Definition MREnums.h:31
Definition MRMesh/MRMeshProject.h:18
float distSq
squared distance from original projected point to proj
Definition MRMesh/MRMeshProject.h:26
bool valid() const
check for validity, otherwise the projection was not found
Definition MRMesh/MRMeshProject.h:29
MeshTriPoint mtp
its barycentric representation
Definition MRMesh/MRMeshProject.h:23
PointOnFace proj
the closest point on mesh, transformed by xf if it is given
Definition MRMesh/MRMeshProject.h:20
Definition MRMesh/MRMeshTriPoint.h:23
a point located on some mesh's face
Definition MRMesh/MRPointOnFace.h:11
bool valid() const
check for validity, otherwise the point is not defined
Definition MRMesh/MRPointOnFace.h:19
Definition MRMesh/MRMeshProject.h:97
float dist
distance from pt to proj (positive - outside, negative - inside the mesh)
Definition MRMesh/MRMeshProject.h:103
PointOnFace proj
the closest point on mesh
Definition MRMesh/MRMeshProject.h:99
MeshTriPoint mtp
its barycentric representation
Definition MRMesh/MRMeshProject.h:101