Distance at Point along Curve
4603
7
3
kgg
Member
5 posts
Joined: 9月 2018
Offline
2020年7月6日 5:01
Hi there,
I've been struggling finding a way to get the actual distance at any given point along a curve.
My points are not equally distributed along the curve and the curve may be closed.
A little visualization:
I tried xyzdist() but that only gives me equally values across the curve.
My xyzdist() snippet:
vector primuv ;
float dist = xyzdist (3 , @P , 0 , primuv );
f@u = primuv .x ;
I would appreciate if someone gives me a hint how to solve this or a solution.
Kind regards,
Kilian
CYTE
Member
679 posts
Joined: 2月 2017
Offline
2020年7月6日 5:39
Hey Kilian, you can use a resample node. disable the maximum segment length and check curve u attribute. it is exactly the value you are looking for. Cheers CYTE
kgg
Member
5 posts
Joined: 9月 2018
Offline
2020年7月6日 6:03
Thanks for the tip but I'm afraid I still get the equal values. Do I miss something? I also tried running a polypath before the resample.
Edited by kgg - 2020年7月6日 06:09:54
mestela
Member
1737 posts
Joined: 5月 2006
Online
2020年7月6日 7:02
Try a uvtexture sop in ‘arc length spline’ mode, set to run on points.
tamte
Member
8538 posts
Joined: 7月 2007
Online
2020年7月6日 10:47
for polygonal curves you can also use Edge Transport SOP
Tomas Slancik FX Supervisor Method Studios, NY
kgg
Member
5 posts
Joined: 9月 2018
Offline
2020年7月6日 16:16
mestela Try a uvtexture sop in ‘arc length spline’ mode, set to run on points.This works like a charm!
Thank you for your time!
Edited by kgg - 2020年7月6日 16:16:52
2020年7月10日 0:50
The Distance Along Geometry SOP does exactly this.
maurypb
Member
1 posts
Joined: 9月 2016
Offline
2022年12月16日 22:53
eikonoklastes The Distance Along Geometry SOP does exactly this.Thanks, @eikonoklastes.