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

is this repo supports multiple bin? #11

Open
Westlife1002 opened this issue Dec 22, 2022 · 11 comments
Open

is this repo supports multiple bin? #11

Westlife1002 opened this issue Dec 22, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@Westlife1002
Copy link

Hi Jerry,
is this repo supports multiple bin and item distribution now?

@jerry800416
Copy link
Owner

Not yet

@jerry800416
Copy link
Owner

I fixed this issue in the latest version, please refer to the Readme.

@jerry800416 jerry800416 reopened this Jun 29, 2023
@jerry800416
Copy link
Owner

This issue has been resolved, please reopen if you have other questions.

@Westlife1002
Copy link
Author

Dear Jerry, is this repo supports multiple bin and item distribution now? I hope it is true as I saw your reply on Jun 29. I will take a look of the latest version. many thanks

@jerry800416
Copy link
Owner

@Westlife1002 Yes , it has been resolved. you can check it on example7.py, have a good day.

@Westlife1002
Copy link
Author

Westlife1002 commented Sep 19, 2023 via email

@Westlife1002
Copy link
Author

Westlife1002 commented Sep 19, 2023 via email

@Westlife1002
Copy link
Author

Hi Jerry,

it works well with the original example7.py. however, if I add the third bin, e.g.

init packing function

packer = Packer()

init bin

box = Bin('example7-Bin1', (5, 5, 5), 100,0,0)
box2 = Bin('example7-Bin2', (3, 3, 5), 100,0,0)
box3 = Bin('example7-Bin3', (5, 8, 10), 100,0,0)

add item

Item('item partno', (W,H,D), Weight, Packing Priority level, load bear, Upside down or not , 'item color')

packer.addBin(box)
packer.addBin(box2)
packer.addBin(box3)

I suddenly got below error:

Traceback (most recent call last):
File "C:\Users\Admin\Desktop\3D-bin-packing-master\example7.py", line 45, in
packer.pack(
File "C:\Users\Admin\Desktop\3D-bin-packing-master\py3dbp\main.py", line 585, in pack
self.bins[idx].gravity = self.gravityCenter(bin)
File "C:\Users\Admin\Desktop\3D-bin-packing-master\py3dbp\main.py", line 541, in gravityCenter
result.append(round(i / sum(r) * 100,2))
ZeroDivisionError: division by zero

@jerry800416
Copy link
Owner

@Westlife1002 In the current version, if the bin is empty, an error will be reported. This is a bug and I will correct it in the next version.

@jerry800416 jerry800416 reopened this Oct 2, 2023
@jerry800416 jerry800416 added the bug Something isn't working label Oct 2, 2023
@Westlife1002
Copy link
Author

@Westlife1002 In the current version, if the bin is empty, an error will be reported. This is a bug and I will correct it in the next version.

ok, when will the new version be released?

@aspire5738
Copy link

You can add a check for zero. Replace the line 541 in the file "3D-bin-packing-master\py3dbp\main.py"

   result.append(round(i / sum(r) * 100,2))

on

        if sum(r) == 0 :
            result.append(0)
        else :
            result.append(round(i / sum(r) * 100,2))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants