29 [[nodiscard]]
bool valid()
const {
return proj.valid(); }
30 [[nodiscard]]
explicit operator bool()
const {
return proj.valid(); }
63 float upDistLimitSq = FLT_MAX,
64 const AffineXf3f * xf =
nullptr,
65 float loDistLimitSq = 0,
67 const std::function<bool(
const MeshProjectionResult&)> & validProjections = {},
68 bool useLeafBoxes = true );
83 const MeshPart & mp,
const AABBTree & tree,
84 float upDistLimitSq = FLT_MAX,
85 const AffineXf3f * xf =
nullptr,
86 float loDistLimitSq = 0,
88 const std::function<bool(
const MeshProjectionResult&)> & validProjections = {},
89 bool useLeafBoxes = true );
107 const VertCoords & points,
const AABBTree & tree,
108 float upDistLimitSq = FLT_MAX,
109 const AffineXf3f * xf =
nullptr,
110 float loDistLimitSq = 0,
112 const std::function<bool(
const MeshProjectionResult&)> & validProjections = {},
113 const FaceBitSet * region =
nullptr,
114 bool useLeafBoxes = true );
140 const FaceBitSet * region =
nullptr );
162 float upDistLimitSq = FLT_MAX,
float loDistLimitSq = 0 );
#define MRMESH_API
Definition MRMeshFwd.h:85
Definition MRAABBTree.h:41
Definition MRMeshTopology.h:31
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 MRMeshProject.h:130
std::function< Processing(FaceId found, Ball3f &ball)> FoundBoxedTriCallback
Definition MRMeshProject.h:118
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={}, bool useLeafBoxes=true)
computes the closest point on mesh (or its region) to given point
void findBoxedTrisInBall(const MeshPart &mp, Ball3f ball, const FoundBoxedTriCallback &foundCallback)
MeshProjectionTransforms createProjectionTransforms(AffineXf3f &storageXf, const AffineXf3f *pointXf, const AffineXf3f *treeXf)
Creates structure with simplified transforms for projection functions, with rigidXfPoint applied to p...
MeshMeshSignedDistanceResult findSignedDistance(const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr, float upDistLimitSq=FLT_MAX)
computes minimal distance between two meshes
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={}, bool useLeafBoxes=true)
computes the closest point on mesh (or its region) to given point
std::function< bool(FaceId)> FacePredicate
Definition MRMeshFwd.h:592
MeshTriPoint
Definition MRMeshFwd.h:515
TriPointf
Definition MRMeshFwd.h:506
Processing
typically returned from callbacks to control the behavior of main algorithm
Definition MREnums.h:63
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
Definition MRMeshProject.h:18
MeshTriPoint mtp(const MeshTopology &topology) const
returns the closest point on mesh as MeshTriPoint relative to topology.edgeWithLeft( proj....
float distSq
squared distance from original projected point to proj
Definition MRMeshProject.h:26
bool valid() const
check for validity, otherwise the projection was not found
Definition MRMeshProject.h:29
TriPointf tp
barycentric coordinates of proj relative to the vertices of proj.face in the order of MeshTopology::g...
Definition MRMeshProject.h:23
PointOnFace proj
the closest point on mesh, transformed by xf if it is given
Definition MRMeshProject.h:20
a point located on some mesh's face
Definition MRPointOnFace.h:16
Definition MRMeshProject.h:143
TriPointf tp
barycentric coordinates of proj relative to the vertices of proj.face in the order of MeshTopology::g...
Definition MRMeshProject.h:147
MeshTriPoint mtp(const MeshTopology &topology) const
returns the closest point on mesh as MeshTriPoint relative to topology.edgeWithLeft( proj....
float dist
distance from pt to proj (positive - outside, negative - inside the mesh)
Definition MRMeshProject.h:149
PointOnFace proj
the closest point on mesh
Definition MRMeshProject.h:145