Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get better results in Blender? #20

Open
kursad-k opened this issue Feb 2, 2021 · 2 comments
Open

How to get better results in Blender? #20

kursad-k opened this issue Feb 2, 2021 · 2 comments

Comments

@kursad-k
Copy link

kursad-k commented Feb 2, 2021

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)>
@karry3775
Copy link

Try using the front bottom left corner as the origin.

@mojoee
Copy link

mojoee commented Jun 16, 2022

How is the blender solution going? Can you share?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants