Jump to content
Igor

Distance on Mesh

Recommended Posts

I have 3D scanned Model and need to measure distance between two points on Mesh. In Documentation I found suflen function but it is only for Nurbs. What ist best method to do same on polygon mesh?

Thanks!

Share this post


Link to post
Share on other sites

Thanks Alexander! I know this function but it does calculate straight distance between Points not distance on Mesh.

Share this post


Link to post
Share on other sites

Thank Eetu! This is great SOP!

Is there way to get length of the "smooth" and not "triangulated" path? I tried with Smooth-SOP and Ray-SOP but Curve gets shorter because endpoints are not fixed.

Thanks

Share this post


Link to post
Share on other sites

do a search for "geodesic distance" in the forum. you´ll find a thread with some example files.
are you looking for the actual geodesic path between the two points or just the geodesic distance?

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Petz! I will do search.

I need only distance between Points. The geometry is 3D scanned model and I must scale it to match other parts. For this I need exact distance on Mesh.

 

Share this post


Link to post
Share on other sites

I was pondering whether one could use the Volume Arrival Time SOP for this, but the thread petz alluded to seems to already have an example of that. By me. I need a new head :)

 

Share this post


Link to post
Share on other sites

if your mesh doesn´t have holes in it and you need just the distance betwen two points, it´s fairly easy to calculate. take a look at the attached file. it basically uses the fact that a real geodesic path unfolds into a straight line in the plane. so, all you have to do is to unfold the curve comming from the shortestPathSop and measure the euclidian distance between both endpoints...

hth.

petz

geodesic_distance.hipnc

  • Like 3

Share this post


Link to post
Share on other sites

Great example Petz thanks. What is the outerproduct function and matrix multiplication for it the first wrangle node? It does not seem to change any of the attributes when I remove it.

Share this post


Link to post
Share on other sites
18 minutes ago, Zybrand said:

Great example Petz thanks. What is the outerproduct function and matrix multiplication for it the first wrangle node? It does not seem to change any of the attributes when I remove it.

it doe´s project the vector onto the plane defined by the point normal. it´s there to make sure that the points of the 1-ring are correctly sorted even on distorted meshes. to see the difference, visualize the local frame (vec_u and vec_v) as attributes.

hth.

petz

Share this post


Link to post
Share on other sites

I still don't see a difference in vec_v with or without the * mat so does that mean vec_v is already on the plane defined by the normal? But I can see the difference it makes further down where you are calculating sort_val so I can see the results but I don't fully understand it :). What is the matrix you get from outerpoduct of a vector and itself? Is it the normal direction in matrix form and subtracting that from the ident() gives you the plane you want to project the vector too?

 

thanks,

Zybrand

Share this post


Link to post
Share on other sites
51 minutes ago, Zybrand said:

I still don't see a difference in vec_v with or without the * mat so does that mean vec_v is already on the plane defined by the normal? But I can see the difference it makes further down where you are calculating sort_val so I can see the results but I don't fully understand it :). What is the matrix you get from outerpoduct of a vector and itself? Is it the normal direction in matrix form and subtracting that from the ident() gives you the plane you want to project the vector too?

 

thanks,

Zybrand

take a look at the file

project_vec.hipnc

 

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×