# Balancing Lengths of Dashed Polylines within a Common Boundary

Hi! I have 10 polylines within a boundary (dashed black line), all of which encompass the same area. I’m seeking a method to ensure that the lengths of the red dashed lines are equal. To illustrate, envision each polyline as a building, and my goal is to provide the yellow polylines with equal access to the blue polyline.

question.gh (32.3 KB)

I don’t really understand this but…
Equal area polygons does not guarantee equal length perimeters.

hello again !

To give you more background and clarity on my inquiry, I’ve already divided my boundary into 10 equal polylines and identified the one with more neighbors (polyline number 0 or the blue one). This part has been successfully addressed, and it’s not the primary focus of my current question. Now, my objective is to ensure that every yellow polyline has the same length as the segment that connects it to the blue polyline.

In each yellow polyline, you’ll notice that one edge is connected to a segment of the blue polyline. The central query revolves around achieving equal lengths for these segments corresponding to the segments of the blue line. Any insights or assistance on accomplishing this would be highly appreciated!

In simpler terms, my core question is how to adjust the segments of the blue polyline to establish equalized connections for the yellow polylines

Sorry, but I still don’t understand your question. Referring to other threads is no help (to me) at all.

Good luck.

Thank you for taking the time to consider my question, and I apologize for any confusion caused by my previous explanations.

I’m attempting to provide another perspective to convey my question more clearly. In the attached image, there are five rectangles, with one positioned in the middle (labeled as number 0). My inquiry pertains to understanding how to adjust the segments of this specific rectangle to transform it into a square with equal dimensions. Your insights on this matter would be greatly appreciated
rectangle.3dm (64.4 KB)

Does this mean the other rectangles change once the center rectangle becomes a square?

If yes, here’s a way using rectangle mapping:
rec-to-square.gh (11.9 KB)

You can choose to turn the rectangle into the square using its long or short dimension, by using ‘min’ instead of ‘max’:

1 Like

Thank you very much; it’s well done! Do you have any ideas on how to accomplish this with some polylines?

I see - your first .gh file doesn’t show me all the curves (they’re not internalized and I don’t have the plugins you’re using installed).

1 Like

Thank you for your time. The curves are internalized, and they become visible when you zoom out. Nonetheless, I appreciate your response to my second question. I will seek a solution for the first question.

1 Like

Ok! Is this what I should be seeing?

That’s all there is

1 Like

Apologies for the extended preamble in my question. I’ve uploaded the new .gh file, aiming for a clearer presentation of the inquiry.
question.gh (30.5 KB)

1 Like

Perhaps I should apologize for the lack of clarity on my side - the curves you want to share/internalize result after operations using components found in plug-ins you’re currently using but that I myself do not have installed:

Anyway, assuming your goals are (1) equalizing the segments of the central curve and (2) having the neighboring curves follow this change (note: I admit I do not fully understand what these neighboring curves should do, just guessing they should follow), one thing to try could be Spatial Deform - here’s a hypothetical case:
question (b).gh (14.7 KB)

The process in this example:

• Split the neighbor curves using their intersection(s) with the central curve, then re-join these split curves
• Equalize the segments of the central curve using kangaroo
• Use Spatial Deform to affect the neighbor curves
1 Like

Oh, that’s the solution! Thank you so much for your time, and I apologize for not providing all the necessary information at the beginning. But this is exactly what I was looking for. Could you please share the .gh file? I’d like to apply this definition to the polylines I mentioned earlier.

And I’m sorry again; it’s my first question, and I realize it might not have been clear enough.

1 Like

1 Like

Hey there, it’s me again!

(Sure, I can flatten the outputs, but it results in a strange shape.)
Could you please try running the definition on these curves? Thank you!
question (c).gh (19.4 KB)

1 Like

I’ve replaced the zombie kangaroo solver with the bouncy one (tweaked the damping parameter to slow it down) and keep the shape from going wild when equalizing its lengths.

Attached:
question (d).gh (23.3 KB)

*Note: if you change the damping, then reset the kangaroo solver, you can check different versions of the curve with its segments equalized:

1 Like

Yay, finally! Big shoutout to you for being the superhero who cracked the code on this problem. You’re the real MVP! Thanks a bunch!

1 Like