jerry800416 / 3D-bin-packing

3D Bin Packing improvements based on https://github.com/enzoruiz/3dbinpacking
MIT License
166 stars 49 forks source link

is this repo supports multiple bin? #11

Open Westlife1002 opened 1 year ago

Westlife1002 commented 1 year ago

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

jerry800416 commented 1 year ago

Not yet

jerry800416 commented 1 year ago

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

jerry800416 commented 1 year ago

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

Westlife1002 commented 1 year ago

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 commented 1 year ago

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

Westlife1002 commented 1 year ago

That's great improvement. I happen to have a scenario to look at. Many thanks for your quick confirmation. cheers

Jerry


发件人: Shiu Ruei-Chang @.> 发送时间: 2023年9月19日 23:15 收件人: jerry800416/3D-bin-packing @.> 抄送: Westlife1002 @.>; Mention @.> 主题: Re: [jerry800416/3D-bin-packing] is this repo supports multiple bin? (Issue #11)

@Westlife1002https://github.com/Westlife1002 Yes , it has been resolved. you can check it on example7.py, have a good day.

― Reply to this email directly, view it on GitHubhttps://github.com/jerry800416/3D-bin-packing/issues/11#issuecomment-1725868719, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIJKO4W5W7G5PHYOXYIEG73X3GZJPANCNFSM6AAAAAATGJAFVE. You are receiving this because you were mentioned.Message ID: @.***>

Westlife1002 commented 1 year ago

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

what's the issue here? thanks for your help

Best, Jerry


发件人: Shiu Ruei-Chang @.> 发送时间: 2023年9月19日 23:15 收件人: jerry800416/3D-bin-packing @.> 抄送: Westlife1002 @.>; Mention @.> 主题: Re: [jerry800416/3D-bin-packing] is this repo supports multiple bin? (Issue #11)

@Westlife1002https://github.com/Westlife1002 Yes , it has been resolved. you can check it on example7.py, have a good day.

― Reply to this email directly, view it on GitHubhttps://github.com/jerry800416/3D-bin-packing/issues/11#issuecomment-1725868719, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIJKO4W5W7G5PHYOXYIEG73X3GZJPANCNFSM6AAAAAATGJAFVE. You are receiving this because you were mentioned.Message ID: @.***>

Westlife1002 commented 1 year ago

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 commented 1 year ago

@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.

Westlife1002 commented 1 year ago

@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 commented 1 year ago

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))