Pattern generation with a minimal distance

I want to generate a rectangular pattern with a minimal distance to each other. I have tried with populate, but then I have a high amount of overlapping patterns.

Generate touching rectangles with a minimum size and offset all of them inward.

How generate touching rectangles?

They are many ways,
you can look at that

you can generate rectangles then pack them with OpenNest.
Too perfect !!

generate pattern with minimum (9.6 KB)

You can generate your own code with your constrains… Kangaroo could surely also be used.


Please remove the duplicate thread and post a GH file next time.

Duplicate Thread.

1 Like

The model I posted above fails to detect nested rectangles:

Here is a way to fix that using Boundary surfaces and BBX instead of CCX:

P.S. Oops! I forgot about “minimal distance”. Oh well.

Thanks for the useful info. By the way minimum distance in overlapping are not equal geometrically. :slight_smile:

Hi Joseph!
Thanks for the solution. Actually I dont find the loop widget. Where I can I get it?

Anemone plugin.

Here’s a way to account for minimal distance (purple group):

My rectangles were all squares because both X and Y Random components were using the same default seed value. When I added separate ‘Seed_X’ and ‘Seed_Y’ sliders to fix that I soon encountered an error (red component):

  1. Index too high, it must already exist within the original list

Rather than avoiding the error condition, I added a Combine component to handle it.

I learned something new today.

Dear joseph!
It is great!
Thanks for your effort!

Please let me know what is in the expression of “larger than”?
Also how come that my replace widget looks different? In mine in the second row threre is “l” instead of on “0” which I can see on yours?

This is why having a GH file is so much more informative than an image!
And much easier and more accessible to others who might learn from a thread but won’t bother wiring all the components together and running into the same questions you have. Much as it pains me, with rare exceptions, I don’t post GH files (or wordy explanations) when none was provided.

P.S. I just noticed that unless you graft the input to Boundary surface, nested rectangles will create a holed surface. The output must then be flattened.


I tried to copy everything carefully. No success.

Post a file next time and you would have working code much sooner! Here it is: (22.7 KB)

Thanks Joseph!
I have learnt the lesson.

I have modified some parameters for the sake of the desired geometry. But the solution stops before finishing the job.

cull_rectangles_2020Sep22d (25.7 KB) fileted rect.3dm (30.4 KB)

It looks correct to me. Only 270 non-overlapping rectangles of the original 395 you generated. Disable preview on the Geo param you added to the code.