algorithmic modeling for Rhino

Hello, I have an optimization problem to solve via grasshopper. Maybe it can solved by Space Syntax or goat or octopus with galapos or any other suggestion ?!

Here is my problem... I need to arrange Boxes in the most efficient way within boundaries of object and follow the following constraints.

The Goal: To fit 125 boxes in the most efficient way inside the total area. Starting Variables:

(1) 40% of the Boxes need to be between 60 and 85MSQ.
(2) 40% of the boxes need to be between 86 and 110MSQ.

(3) 20% of the boxes need to be between 111 and 125mSQ. The breakdown doesn’t have to be exact to give the script some flexibility. Meaning you can have 41% +39% +20% = 100%.


1. A total MAXIMUM area of approximately 1600M per layer.

2. A maximum of 8 layers for a total of 12,800M per layer. Optimization can make as little or as many as 8 layers vertical to accommodate all boxes. So if script can achieve with 3 levels great. If needed all 8 levels, that's fine too. However, pay attention to next constraint (#3).

3. Approximately 15% of that space on each layer is off limits. (internal area) (blue area in example script) and the shape of the boundary cannot be modified to accommodate box design resulting in jagged lines for the internal area.

4. All generated squares/rectangles must have at least 3m touching an outside border (The Green lines).

5. All boxes must also be touching minimum 1M of border of the blue line.

6. If the boxes generated go outside the green boundary, they must be fillet to maintain the straight lines of the green boundaries.

7. Get as many of the boxes as possible a view towards the dots. 

Could any one provide me a method or a way to start, if there are any useful links, please share with me. Thank you!

Views: 857


Replies to This Discussion

Hallo Mohamed,

rectangle packing there is packrat:

but not sure if you can archiev all you criteria with it.

You could do it with Kangoroo:

Or you could use Galapagos and other algorithms:

Another possible starting point can be found here:

it is all done with spiderweb.

What do you need it for?

Best Richard

Thank you Richard, this is helpful, for the first link instead of rectangle packing I would love to find something more into polygon packing, for the kangaroo link I checked it before and would love to have more details about it to start do something with, but also the boundaries of the building should be polygon, the other two links very interesting thanks for sharing them.

I need it for:

I have a three size rooms to be arranged at the plan, the plan boundaries are in polygon shape and there is a corridor inside this plan which should be clear from rooms. I have another constrain which is a view for the plan boundaries and it is represented as a points in the Rhino file that I am attached here 






  • Add Photos
  • View All

© 2019   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service