Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Even point distribution on a curve

Hi!
Is there a way to evenly distribute points on a curve? This curve for example. Resample doesn't give needed results

Share this post

Share on other sites

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

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.

2 people like this

Share this post

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:

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?

Share this post

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.hipnc

1 person likes this

Share this post

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.

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

Share this post

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:

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

Share this post

Share on other sites

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

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
1 person likes this

Share this post

Share on other sites
5 minutes ago, julian johnson said:

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

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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now