Curve Derivative

   2754   4   0
User Avatar
Member
477 posts
Joined: July 2005
Offline
Hello,

I am playing around with the VOP SOP tool, to create a custom wire deformation tool. It is working nice so far, I am using the xyzdist function to get the shortest distance from every Point “P” in the Deformation geometry to the curve, which I exported to a Geometry file (“…/MyCurve.bgeo”).
The xyzdist function is yielding the distance (dist float) and the Point on the curve (primuv vector). I can use these Parameters to some things already, but it would be also nice to get the curve u Parameter and the Derivative at the Position u (Speed vector) (d/du)C(u). My Question is, is it possible to get these Parameters and if yes what is the easiest way and is it also possible to get this all from a curve object directly (without exporting to a *.bgeo).
I ll appreciate any help
User Avatar
Member
8582 posts
Joined: July 2007
Offline
just create tangent vector on curve using Polyframe SOP, then access it using primuv() from the desired u value

and you don't need to export as geo, in CVEX based ops like Attrib VOP SOP you have geometry input strings directly, in all wrangle nodes you can use @OpInput1-4 to access the input geometries and there is always op: syntax to get geometry from any node directly for VOP SOP
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
477 posts
Joined: July 2005
Offline
Very nice thanks Tomas, all of your advices seems to work fine.
I had only to resample the curve before using polyframe to get a smoother result (so it looks like, you cannot get a tangent vector from a NURBS-Curve directly).
User Avatar
Member
8582 posts
Joined: July 2007
Offline
you can always get position at certain u which your tool currently requires then u+0.001 and u-0.001 (so you'll have like P1, P2, P3)
then normalize( ((P1-P3) + (P2-P1))/2 ) will give you approximate tangent
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
477 posts
Joined: July 2005
Offline
ok this is working fine thanks alot
  • Quick Links