algorithmic modeling for Rhino
What's the most efficient way to divide a curve by length from the midpoint out? And to make it even more fun, how would I do the same but with the segments centered?
Context: I'd like to write a definition to create panelized railings (think glass railings) along a curve. Panels are best manufactured at equal lengths, so I'd array a 1m panel, then have whatever is left over be a unique panel. There are many conditions that I might want to try:
1. Standard size from start, left-over size at end.
2. Standard size from end, left-over size at start.
3. Edge of standard size from midpoint, equal left-over size at start and end.
4. Center of standard size from midpoint, equal left-over size at start and end.
I'd like to switch between these 4 cases along with adjusting the length of the standard size panel to find the best solution.
So I could also ask if anybody knows of a preexisting solution that's already out there, too.
Any help would be greatly appreciated.
Tags:
Hey, this my help.
I tried to throw something together. One scenario actually wont work without additional conditions. You can only have the remainder in the center if there is an equal number of whole segments. Otherwise, the remainder would have to be off center on one side or the other, or the remainder would have to be divided by 2 and put on either side of the center segment.
Either way, this is a sloppy example of how to divide a line so that the segments are centered, and pick from the offset left or right option.
To divide a curve so that you end up with straight segments of the same length you need to use the 'divide distance' component rather than 'divide length'. This will be good enough for the first two cases.
For the last two, it's a bit more complicated if you want the start and end panels to be the exact same length. I did this using the Kangaroo plugin, I don't think there's a direct geometrical way to solve this.
Hello, I saw that this discussion shows a problem I am aslo having..I have a small question, I have a curve of 7m and I want to divide it by lenght of 2m, so I will have 3 segments of 2m and one segment of 1m which is gona be at the end of the the curve, in case I want to make this segment of 1m to be dispached in the 2 sides of the curve in order to have a segments of 0.5m , 2m, 2m, 2m, 0.5m and not 1m, 2m, 2m, 2m.. is ther a way to do so?
Thank you in advance
The problem with this approach is that the first and last segments won't necessarily have the same length.
It won't meet the criteria of "...equal left-over size at start and end."
Would it actually matter? (Thinking out loud here)
I assume that when you build this you would start at one end of the curve and erect each panel until the other end.
What you're after is the custom size for your two end panels which would be the average of the results above. The fact that the middle point was out by 2.5 mm is neither here nor there.
With this method the difference between the first and last panel could be much larger, depending on the shape of your curve.
My example is neither the perfect solution because it also uses the curve length for something, in this case to figure out the number of segments needed. There is a possibility that you might need more.
Btw, I just realized I connected to the CurvePull force some polylines I generated rather than the referenced curves. It will stay closer to the original shape if you use the referenced curves.
In the case it was a line I think it works, I tried this with changing the distance between different divisions.. and it looks like working..
But I have another question if I wana join the end point of each segment in a crossed way like shown in the image.. the line with 2 points is giving me all possible lines between up and down
yes that's what i was looking for.. thank u Vicente
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by