Draw parametric curves that connects points using VEX help!!!

   3092   3   1
User Avatar
Member
355 posts
Joined: Nov. 2015
Offline
In the example file I have a point drawing a line between a point and its closest neighbor using a parameter I call “draw curve”. I'm using linear interpolation, so the point is tracing out an arc but because the line only has two points its always drawing a straight line. How can I create points along the path the point is tracing so that I can hold the curved shape as the line is being drawn by the “draw curve” parameter?

Many thanks in advance if someone can assist with this problem.

Attachments:
mograph_curve_lines_connect_RnD_01.hip (265.8 KB)

hou.f*ckatdskmaya().forever()
User Avatar
Member
2038 posts
Joined: Sept. 2015
Offline
You have your algorithm that traces a path.

All you have to do is decide what ‘resolution’ you want.

You have your draw line parameter which depending on it's value, determines where a potential point will lie according to your method.

So decide how many times along that curve you want to add a point that will go towards defining your curve.

Once you've decided that, add a point for each step along the curve you want, at the same time creating an array of the point numbers of those newly added points.

Give that array of point numbers to the addprim function that will connect all those points.

Of course to get a well defined poly curve you need a lot of points.

If you want a similarly smooth curve but with less points you could try looking into one of the vex spline function variations.
User Avatar
Member
355 posts
Joined: Nov. 2015
Offline
BabaJ
You have your algorithm that traces a path.

All you have to do is decide what ‘resolution’ you want.

You have your draw line parameter which depending on it's value, determines where a potential point will lie according to your method.

So decide how many times along that curve you want to add a point that will go towards defining your curve.

Once you've decided that, add a point for each step along the curve you want, at the same time creating an array of the point numbers of those newly added points.

Give that array of point numbers to the addprim function that will connect all those points.

Of course to get a well defined poly curve you need a lot of points.

If you want a similarly smooth curve but with less points you could try looking into one of the vex spline function variations.

Ahh thanks @BabaJ, will try to see how that works out for me! I dont mind getting a low-rez poly curve because I could use the convert SOP later to make it a bezier curve.
hou.f*ckatdskmaya().forever()
User Avatar
Member
2038 posts
Joined: Sept. 2015
Offline
I wasn't sure what kind of curve function you were trying to implement. Here's an example just to illustrate the addprim with an array.
Edited by BabaJ - June 29, 2019 20:41:25

Attachments:
Addprim Connect Points Array.hiplc (84.4 KB)

  • Quick Links