# 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 on other sites

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

##### 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 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?

• 1

##### 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 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 on other sites
Quote

Thanks Eetu! I´m trying to use your file and the file from Petz to see if it does what I need.

##### 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

• 3

##### Share on other sites

Thanks Petz! Your method works perfect!

##### 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 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 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 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

• 2

##### Share on other sites

Awesome thanks Petz! I get it now

##### Share on other sites

It is now possible to get surface distance from the softselection with the new function of H16.5!

geodesic_distance_softsel.hiplc

Edited by satoru
• 4

## Create an account

Register a new account