MeshLib C++ Docs
Loading...
Searching...
No Matches
MRClosestWeightedPoint.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRMeshTriPoint.h"
5#include "MRPch/MRBindingMacros.h"
6#include <cfloat>
7
8namespace MR
9{
10
12{
14 VertId vId;
15
17 float dist = 0;
18
20 [[nodiscard]] bool valid() const { return vId.valid(); }
21 [[nodiscard]] explicit operator bool() const { return vId.valid(); }
22};
23
25{
28
30 float dist = 0;
31
33 [[nodiscard]] bool valid() const { return mtp.valid(); }
34 [[nodiscard]] explicit operator bool() const { return mtp.valid(); }
35};
36
38{
41
44 float maxWeight = 0;
45
48 float maxWeightGrad = FLT_MAX;
49
50
51 // To allow passing Python lambdas into `pointWeight`.
52 MR_BIND_PREFER_UNLOCK_GIL_WHEN_USED_AS_PARAM
53};
54
63
67[[nodiscard]] MRMESH_API PointAndDistance findClosestWeightedPoint( const Vector3f& loc,
69
74 const Mesh& mesh, const DistanceFromWeightedPointsComputeParams& params );
75
76} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
bounding volume hierarchy for point cloud structure
Definition MRAABBTreePoints.h:16
std::function< float(VertId)> VertMetric
Definition MRMesh/MRMeshFwd.h:492
MRMESH_API PointAndDistance findClosestWeightedPoint(const Vector3f &loc, const AABBTreePoints &tree, const DistanceFromWeightedPointsComputeParams &params)
MRMESH_API MeshPointAndDistance findClosestWeightedMeshPoint(const Vector3f &loc, const Mesh &mesh, const DistanceFromWeightedPointsComputeParams &params)
Definition MRClosestWeightedPoint.h:56
float maxDistance
find the closest point only if the distance to it is less than given value
Definition MRClosestWeightedPoint.h:61
float minDistance
stop searching as soon as any point within this distance is found
Definition MRClosestWeightedPoint.h:58
Definition MRClosestWeightedPoint.h:38
VertMetric pointWeight
function returning the weight of each point, must be set by the user
Definition MRClosestWeightedPoint.h:40
float maxWeight
Definition MRClosestWeightedPoint.h:44
float maxWeightGrad
Definition MRClosestWeightedPoint.h:48
Definition MRClosestWeightedPoint.h:25
MeshTriPoint mtp
a point on mesh in barycentric representation
Definition MRClosestWeightedPoint.h:27
bool valid() const
check for validity, otherwise there is no point closer than maxDistance
Definition MRClosestWeightedPoint.h:33
float dist
the distance from input location to mtp considering point's weight
Definition MRClosestWeightedPoint.h:30
Definition MRMesh/MRMeshTriPoint.h:23
bool valid() const
consider this valid if the edge ID is valid
Definition MRMesh/MRMeshTriPoint.h:58
Definition MRMesh/MRMesh.h:22
Definition MRClosestWeightedPoint.h:12
bool valid() const
check for validity, otherwise there is no point closer than maxDistance
Definition MRClosestWeightedPoint.h:20
float dist
the distance from input location to point vId considering point's weight
Definition MRClosestWeightedPoint.h:17
VertId vId
a cloud's point
Definition MRClosestWeightedPoint.h:14