Length of a spline

   7930   7   2
User Avatar
Member
10 posts
Joined: July 2005
Offline
Is there a way with VOPs to find the length of a spline?
I found the arclen() expression but i wasn't able to find the relative command in the VOPs.
How to calculate in VOPs the vector tangent (I think that with expressions the command is primduv) to a point in a spline?
Also…how to use the second input in a VOP geometry op? If I attach a primitive wich has attributes I cannot use the attributes if the primitive is connected to a second input.
Sorry for the many questions…thanks
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Very difficult to do this in VOPs as there is no real connectivity information to work with. There is no built-in function to do this right now.

I have done this in the past where I needed the arc length to the current point from the start. For that I used a VOP for loop where I interated across the points to the current point summing the result as I marched along the curve. Only works for poly curves as well and is somewhat slow but real handy.

Best bet is to do this in SOPs using the Measure SOP. Easy and painless if all you need is the total arc length. It works equally well with NURBs, Beziers and Polygon faces.
There's at least one school like the old school!
User Avatar
Member
2199 posts
Joined: July 2005
Online
glauca
Is there a way with VOPs to find the length of a spline?
Also…how to use the second input in a VOP geometry op? If I attach a primitive wich has attributes I cannot use the attributes if the primitive is connected to a second input.

Can you explain what you mean here?
You can access attributes from any point on any input to a vop sop using the import vop. You can also use prim_attribute but I don't think it has a vop, so you'd have to put it into an inline vop.
What I usually do is add a parameter and then put a prim expression in it that grabs the value I want.
The trick is finding just the right hammer for every screw
User Avatar
Member
10 posts
Joined: July 2005
Offline
Hi Jeff and Simon
thanks for your answer…
too bad to know that some real useful informations as acurve length are omitted from VOPs…
As for the second input, what I mean is that if I find the length of a spline with an arclen() expression in an AttributeCreate SOP and attach this to a second input of a VOP SOP I'm not able to import it in the VOP using the import_attribute VOP…the attributes attached to a second input simply desappear…
Anyway thank you for your help
User Avatar
Member
7710 posts
Joined: July 2005
Offline
I don't see why not. You're not forgetting something simple like not changing the OP Input Index parameter of your Import Attribute VOP to 1, right?
User Avatar
Member
10 posts
Joined: July 2005
Offline
Hi edward
no…I changed the index to 1 but with no luck…if I use the first input all is ok…but I need to use the second input (I'm trying to do a deform to spline…with the creep SOP, where I have o use a surface, the result is not what I want).
Thanks for your support
User Avatar
Member
2199 posts
Joined: July 2005
Online
It definately should work, I've done this a million times. Make sure you are creating a point attribute and that you match the type you are creating in the import vop. So if you are adding a float attribute then make sure you change the signature on the import vop to float by default it is vector.
The trick is finding just the right hammer for every screw
User Avatar
Member
10 posts
Joined: July 2005
Offline
Thanks Simon
the problem was that i tried to import a primitiva attribute (the length of the spline)…
I hope that in the future VEX could access full objects and primitive just like points…it could open many possibilities…
As always thanks for support
  • Quick Links