Galapagos fitting multiple squares in defined space

Hello there,

we are working on a project and trying to build a script which fits multiple squares into one defined space.

The squares have a few defined parameters like minimal / maximal areas and certain (above 0,5) length to width ratios.

We have already managed to get our script to fit one rectangle into the defined space but can’t manage to do it with multiple rectangles.

Does anyone have ideas how we can manage to multiply our rectangles and fit multiple in the defined space?

Attached you can find the current version of the script.

Thanks very much for any help in advance. (21.4 KB)