-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some questions about the MR::computeGeodesicPath function? #1683
Comments
Hello! MeshLib/source/MRMesh/MRMesh.h Lines 97 to 98 in 529a2fa
another way is this:
|
/// finds closest point on this mesh (or its region) to given point; | |
/// xf is mesh-to-point transformation, if not specified then identity transformation is assumed | |
[[nodiscard]] MRMESH_API bool projectPoint( const Vector3f& point, MeshProjectionResult& res, float maxDistSq = FLT_MAX, const FaceBitSet* region = nullptr, const AffineXf3f * xf = nullptr ) const; |
MeshTriPoint
is structure that represent point on surface using barycentric coordinates of the face (EdgeId is base edge of the Face)
Hello! MeshLib/source/MRMesh/MRSurfacePath.h Lines 50 to 54 in 69590b7
as you can see this function takes two MeshTriPoint s (spheres on the picture) to build the path.
So you need to convert you points to |
I suddenly understood! |
Something like this Vector3f a,b; // known coordinates
auto projA = mesh.projectPoint( a );
auto projB = mesh.projectPoint( b );
auto surfacePath = computeGeodesicPath( mesh, projA->mtp, projB->mtp, GeodesicPathApprox::DijkstraAStar ); or if you already know faces of Vector3f a,b; // known ccordinates
FaceId aF,bF; // known faces of `a` and `b`
auto surfacePath = computeGeodesicPath( mesh, mesh.toTriPoint( aF, a ), mesh.toTriPoint( bF, b ), GeodesicPathApprox::DijkstraAStar ); |
I understand. Thank you! |
Closing this issue, please reopen it if you have any other related questions |
Hi :) Is the projectPoint() function avaliable in the python API? |
Hello! There are functions |
Thank you : ) May I also ask if you have a function that outputs the face where the output nearest point from findProjection is located? I am planning to use computeGeodesicPath but I have only points to work with (numpy vector3f from pointcloud) I'm planning to run this in Python using this method: but from my understanding, mesh.toTriPoint is not available in Python and only Tripointf is only available but requires me to already know the face on which the point from findProjection belongs to? From: My apologies, I'm not too familiar with EdgeId's and FaceId's, thus I couldn't understand how the arguments for the tripoint was set? From: https://github.com/MeshInspector/MeshLib/blob/a1214ffdf41d6417dca6a092a4a95312cdc9435c/test_python/test_meshProjections.py |
Now we don't have
If you want to create |
Hi, I want to using the surface path function, but i confused about the use of functions.
I have two point coordinates that on the surface of the mesh, and is it enough to call the function MR::computeGeodesicPath.
MR::computeGeodesicPath function need MeshTriPoint object, but i confused about some concepts, eg. EdgeId.
Hope to get answers, thank you.
The text was updated successfully, but these errors were encountered: