Distance at Point along Curve
7382
7
3
kgg
Member
5 posts
Joined: Sept. 2018
Offline
July 6, 2020 5:01 a.m.
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
802 posts
Joined: Feb. 2017
Offline
July 6, 2020 5:39 a.m.
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: Sept. 2018
Offline
July 6, 2020 6:03 a.m.
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 - July 6, 2020 06:09:54
mestela
Member
1853 posts
Joined: May 2006
Offline
July 6, 2020 7:02 a.m.
Try a uvtexture sop in ‘arc length spline’ mode, set to run on points.
tamte
Member
9380 posts
Joined: July 2007
Offline
July 6, 2020 10:47 a.m.
for polygonal curves you can also use Edge Transport SOP
Tomas Slancik CG Supervisor Framestore, NY
kgg
Member
5 posts
Joined: Sept. 2018
Offline
July 6, 2020 4:16 p.m.
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 - July 6, 2020 16:16:52
July 10, 2020 12:50 a.m.
The Distance Along Geometry SOP does exactly this.
maurypb
Member
1 posts
Joined: Sept. 2016
Offline
Dec. 16, 2022 10:53 p.m.
eikonoklastes The Distance Along Geometry SOP does exactly this.Thanks, @eikonoklastes.