Tokezo Posted July 8, 2017 Share Posted July 8, 2017 Hi! Is there a way to evenly distribute points on a curve? This curve for example. Resample doesn't give needed results Quote Link to comment Share on other sites More sharing options...
animatrix Posted July 8, 2017 Share Posted July 8, 2017 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. 2 Quote Link to comment Share on other sites More sharing options...
Tokezo Posted July 9, 2017 Author Share Posted July 9, 2017 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? Quote Link to comment Share on other sites More sharing options...
julian johnson Posted July 9, 2017 Share Posted July 9, 2017 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 Quote Link to comment Share on other sites More sharing options...
Tokezo Posted July 9, 2017 Author Share Posted July 9, 2017 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.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 Quote Link to comment Share on other sites More sharing options...
Tokezo Posted July 9, 2017 Author Share Posted July 9, 2017 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 Quote Link to comment Share on other sites More sharing options...
julian johnson Posted July 9, 2017 Share Posted July 9, 2017 (edited) 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 July 9, 2017 by julian johnson 1 Quote Link to comment Share on other sites More sharing options...
Tokezo Posted July 9, 2017 Author Share Posted July 9, 2017 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.