Scale a rectangle based on distance - must have set sizes, must touch

Thanks in advance for any help! I want to start with rectangles that are 1x2 and scale some based on proximity to control points to either 1x3 or 1x4. I need them to remain touching. The closest I have gotten (not very close) is using anemone to loop the process, but it’s not very controllable and the rectangles often overlap.

I’ve uploaded that .gh file though I don’t know how helpful it will be as I don’t know that looping is the right answer here. Let me know if you have further questions. scale rectangle test rhino (9.7 KB) scale rectangle test rhino (9.7 KB)

Hi @arking.eight,

Could you maybe upload a sketch or diagram of what you’re trying to do?
By looking at your file, it’s not super clear to me.

Sure, I’m uploading a rhino file and sketch showing roughly what I’m trying to achieve. That is, rectangles closer to the control curve are the larger dimensions (1x4 and 1x3). However it’s not a perfect gradient from the curve outward, there is some variation with smaller rectangles close to the control curve. Does this make sense?

Scaling rectangles sketch model.3dm (101.8 KB)

Hey @arking.eight,

Here’s a possible solution that can generate nearly endless, random configurations.

I’ve written a small Python script, since I needed more advanced looping features than what Grasshopper offers, for calculating the cell spans per column of the grid. The script only crunches numbers though. Everything else is done with vanilla Grasshopper components.

One thing to note is that if you make the base grid bigger or smaller than the current configuration, you should always adjust the Min. Span and Max. Span sliders accordingly. Otherwise, the results can get monotonous.

You can also hover your mouse cursor over the inputs and outputs of the Python component and a small description will pop up! (20.9 KB)

This is super impressive, thank you for working on this! If it went no further that would be fine, but I’m curious how possible you think it is to get purple and blue rectangles onto the same column in the grid.

Blue rectangles would adhere mostly to zones around the control lines.

Absolutely possible, but way more complex. :slight_smile:

I get it, just like the thing above, but with non-linear curves and non-uni-directional.
I’ll look into to, but no promises! You should also try and see how far you get!!

I have a kind of bad idea I’m going to try