3dbinpacking icon indicating copy to clipboard operation
3dbinpacking copied to clipboard

How to get better results in Blender?

Open kursad-k opened this issue 4 years ago • 2 comments

Hi,

I am trying to make a crude packing implementation in Blender using this library. So far I have not gotten a good results. I am wondering if this is an issue with this lib in general, like working in 3d coordiates . Does it require the pivot to be in certain location other than the center?

Also I seem to be getting only 0 and 1 for the rotation type.

Please see the screenshot for the details (after running the script). As you can see the packing result shows some items positioned outside of the bin and there are overlaps, basically does not look like these boxes are packed inside the bin.

image

Output

***************************************************
::::::::::: Bin(6.072x6.072x6.072, max_weight:1000.000) vol(223.870)
FITTED ITEMS:
====>  Box.005(2.714x0.114x1.413, weight: 1.000) pos([0, 0, 0]) rt(0) vol(0.437)  ->  [0, 0, 0]
<Vector (0.0000, 0.0000, 0.0000)>
====>  Box.003(1.364x0.638x1.442, weight: 1.000) pos([Decimal('2.714'), 0, 0]) rt(0) vol(1.255)  ->  [Decimal('2.714'), 0, 0]
<Vector (2.7140, 0.0000, 0.0000)>
====>  Box(1.281x0.745x1.412, weight: 1.000) pos([Decimal('4.078'), 0, 0]) rt(0) vol(1.348)  ->  [Decimal('4.078'), 0, 0]
<Vector (4.0780, 0.0000, 0.0000)>
====>  Box.001(2.428x0.426x1.453, weight: 1.000) pos([Decimal('5.359'), 0, 0]) rt(1) vol(1.503)  ->  [Decimal('5.359'), 0, 0]
<Vector (5.3590, 0.0000, 0.0000)>
====>  Box.002(0.607x3.611x1.586, weight: 1.000) pos([0, Decimal('0.114'), 0]) rt(0) vol(3.476)  ->  [0, Decimal('0.114'), 0]
<Vector (0.0000, 0.1140, 0.0000)>
====>  Box.004(2.990x2.050x1.592, weight: 1.000) pos([0, Decimal('3.725'), 0]) rt(0) vol(9.758)  ->  [0, Decimal('3.725'), 0]
<Vector (0.0000, 3.7250, 0.0000)>

kursad-k avatar Feb 02 '21 17:02 kursad-k

Try using the front bottom left corner as the origin.

karry3775 avatar Feb 10 '21 03:02 karry3775

How is the blender solution going? Can you share?

mojoee avatar Jun 16 '22 10:06 mojoee