Jump to content

Even point distribution on a curve


Recommended Posts

It's very easy. First compute the best fit plane of these points. You can use this VEX tool:

http://orbolt.com/asset/animatrix::bestFitPlane::1.00

Then create a circle in VEX that's at origin on XZ plane, then using:

matrix3 m = dihedral ( {0,1,0}, bestFitPlaneNormal );

multiply your new circle points with m and then add bestFitPlaneCenter to these points.

 

  • Like 2
Link to comment
Share on other sites

9 hours ago, pusat said:

It's very easy. First compute the best fit plane of these points. You can use this VEX tool:

http://orbolt.com/asset/animatrix::bestFitPlane::1.00

Then create a circle in VEX that's at origin on XZ plane, then using:

matrix3 m = dihedral ( {0,1,0}, bestFitPlaneNormal );

multiply your new circle points with m and then add bestFitPlaneCenter to these points.

 

Thank you, pusat! But what if i will have not an elliptic closed curve, what will be the solution then?

Link to comment
Share on other sites

pusat's is by far the best way of doing this.

But for something rough and ready (and if you're not so bothered by being exactly even spaced) you could try this as well. Increasing the iterations on the for loop increases the 'accuracy'. It's based on even lengths of the original curve so is never going to be absolutely correct.

evenspace.gif

evenspace.hipnc

  • Like 1
Link to comment
Share on other sites

38 minutes ago, julian johnson said:

pusat's is by far the best way of doing this.

But for something rough and ready (and if you're not so bothered by being exactly even spaced) you could try this as well. Increasing the iterations on the for loop increases the 'accuracy'. It's based on even lengths of the original curve so is never going to be absolutely correct.

evenspace.gif

evenspace.hipnc

That's almost what i need, but it didn't work with my curve. Actually i'm getting this curve from edge group by converting it with python node. Maybe it's because python code generating some damaged curve?

evenspace_curve_from_edges.hipnc

Link to comment
Share on other sites

13 hours ago, pusat said:

It's very easy. First compute the best fit plane of these points. You can use this VEX tool:

http://orbolt.com/asset/animatrix::bestFitPlane::1.00

Then create a circle in VEX that's at origin on XZ plane, then using:

matrix3 m = dihedral ( {0,1,0}, bestFitPlaneNormal );

multiply your new circle points with m and then add bestFitPlaneCenter to these points.

 

Maybe you could give a hip file? Tried to recreate it, but realized that my skill is not enough for that :)

Link to comment
Share on other sites

I've tried to fix your incoming curve. This seems to work..

evenspace_curve_from_edges_maybefixed.hipnc

My tree relies on the curve having sequentially numbered points so I merged your 3 primitives into 1 using polypath and then reordered the points using a UV attribute..

Edited by julian johnson
  • Like 1
Link to comment
Share on other sites

5 minutes ago, julian johnson said:

I've tried to fix your incoming curve. This seems to work..

evenspace_curve_from_edges_maybefixed.hipnc

My tree relies on the curve having sequentially numbered points so I merged your 3 primitives into 1 using polypath and then reordered the points using a UV attribute..

WOW! That's it! Now it's perfect, thank you very much!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...