Refinery package Packing.PackRectangles - items are outside the containers


I am wondering if someone has encountered a similar problem.

I am using Packing.PackRectangles node of the Refinery package to pack rectangles in 3 containers as shown below:

I have a list of rectangles as rooms and they were packed in containers. It works well for the second container, however, rectangles from the first and third containers are outside the perimeter:

I cannot find the logic of why it’s happening.

I found a discussion about this topic:

The solution was to translate rectangles. I think it is not my case, but maybe I am wrong.

Do you have any suggestions on what I should adjust?

Many thanks!!!


Where’s your code?

If I recall (not done it for a while) you have to get the translations right for your visualisations or it messes up.

Hi Alien,

here is my code:
packing 2d.dyn (85.1 KB)

Tomorrow I will try to do some translation…we will see:)

Many thanks!

The bin packing nodes in the refinery toolkit require the container be oriented and located in a particular fashion. Try rebuilding your containers at the origin with no rotation, and translate the rooms after placement.

1 Like

Hi Jacob,

I followed your instruction and it works:) Thank you!
From my initial containers (rectangles created from points), I got dimensions and created new rectangles, which I translated to the centre point of my initial containers.

Thanks and have a nice day!

1 Like