algorithmic modeling for Rhino
Hi all,
I'm currently bashing my head against a curve division problem..
What I'm trying to do is subdividing a freeform curve of non-regular shape (that is it's not a circle, arc or anything matematically "regular") into even parts that are all the same Cartesian distance from another.
Basically I'd need a crossbreed of "divide by distance (distance)" and "divide curve (numberOfdivisions)". Put another way, when the original curve shape changes, the "divide by distance" input parameter would need to change.
As the curve t parameters don't relate to point distances in cartesian space, they didn#t really help me, either, unless I'm missing something obvious (always a possibility with me..).
Any ideas? I guess some iterative C#/VB script component would do the trick, trouble is I am still scripting illiterate :/
Thank you & kind regards,
Max
Tags:
If I understand correctly you want to be able to specify an approximate distance between points but always have an even spacing throughout the curve.
If so then you need to divide the Length of curve by the approximate distance to the number of division points as a float then convert to an integer.
If not then just ignore me.
Hi Danny,
yes, I think that looks promising- no GH where I'm at right now, so will replicate tomorrow.
However, doesn't the "L" output of the last evaluate curve component you use give the points distance ON the curve itself?
What I'm aiming at is a bit different- imagine dividing a curve evenly and connecting those points with lines: as vertices of a polyline. Those connecting lines should then all have the same linear length.
I could do that with "divide distance" if I always knew the correct input parameter; but as dividing the length of a curvy curve by the number of divisions I need and then using THAT value as the spacing for "divide distance" won't always work, as the actual length of the non-linear curve is longer than the directly connecting lines considered together..
I'll draw up a sample tomorrow, it's rather hard to describe!
Thank you so much already,
Max
Hi,
the attached GHX shows it better.. basically I've modified it to use the "divideDistance"- moving the slider to a certain value gives identical linear distances with increasing accuracy- though I guess it really needs to be scripted in a loop.
Best wishes,
Max
Here's a Rhinoscript that will make the polyline with a specified distance between the kinks. It doesn't automatically make use of the full line length but does report in the command line the length of the last curve segment and the number of segments in the polyline. It only works for curves in the xy plane. It maybe of only limited use. Thanks to Pascal Golay for debugging a quirky do loop.
Chris
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by