I need to create bounding areas from an input of curves - Each area contains 20 feet of the input curves, then a new area is created with another 20 feet of curves, and so on and so on - ALONG THE X AXIS
I would prefer to use Kangaroo to do this so I am not having to create areas by hand like I currently am. BUT I am new to Kangaroo and do not know how to approach this problem… Maybe Kangaroo isnt the right way? 20’ Length Sum.gh (10.1 KB)
I took the math approch, computing S(x) = the total length of lines between 0 and x, computing x for all S(x) = k S0 (choose S0 = 20 feet for instance), and split the lines there.
The general case (curves instead of lines) is left as an exercise to the reader !
I can guess what Pufferfish is doing for you but otherwise don’t understand the goal at all (or what @magicteddy is doing either)?
I got bounding rectangles for each branch of your curves (Union Box) by other means and they are around 600 units long. So “20 feet of curves” is nothing by comparison.
When I get bounding rectangles for each line separately, they average 35.68 by 19.16 units.
I doubt Kangaroo is necessary for this but don’t see the point?
@magicteddy did exactly what I needed to do!! These curves are part of a much larger grasshopper script and I need to Know where to place a component that is needed for every 20’ of ‘curve’…
Yeah, I made a little more sense of your results by replacing your random color code with my ColorB cluster. But the intervals look like way more that 20 units?
OK, but are you really going to put a driver on fractions of a light fixture? I would think some rounding is in order to have groups of whole fixtures?
Yes, the code that @magicteddy produced for this is brilliant!
Yes there will definitely need to be some adjusting in location, BUT I am using this method to approximate stopping location, then finding the closest ‘node’ between curves. There will definitely be some overlap but this at least gets us started with placements rather than doing it by hand after a pattern is created.
Will most likely change the step to every 15-18’ to overestimate how many drivers we will need. Either that or as you said do some rounding to make sure there are in accurate spots.
This thread solves a similar problem, with a completely different method. It groups numerical data so that the difference between max and min value in each branch never exceeds a certain value.
If applied to the list of partial sums of the lengths of the curves (sorted from left to right), this could be another way to guarantee the start/stop is on an end point of a curve