Generate Groups with Equal Length Curves Within

Hello,

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)

Any suggestions? Thanks

Hello,

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 !

20’ Length Sum.gh (25.2 KB)
(edited, removed unnecessary Flip Planes)

1 Like

missing

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?

1 Like

:crazy_face:

I moved the branches 100 units apart for clarity, then derived these 20 unit X rectangles.

I have no clue…

@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’…

Anyways, Problem Solved! thanks again @magicteddy

What a relief! I still don’t understand but I don’t need to. :sunglasses:

1 Like

20Feet

2 Likes

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?

I still have no clue but won’t wade through your code to figure it out. Cheers!

It’s the total length of the lines in each branch that equals 20 (or whatever number is chosen), not the width along X.

2 Likes

Well, well, you must be a mind reader to derive his intent from what was posted.

This is the slider set to 20: (which makes no sense to me at all)

I mean, I get it now but don’t see the point?

Again, This is a very small part of a much larger Grasshopper def.

Curves Represent Light Fixtures and for every 20 feet of Fixtures I need a driver. Hence why every 20 feet I need to STOP and start again.

@magicteddy Killed It!! Thanks again.

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! :+1:

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.

1 Like

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

2 Likes

@magicteddy You really are the Magic Man!! Thanks for the link I will dive in and check it out.