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

Packaging issue #227

Open
kolevich opened this issue Mar 2, 2021 · 4 comments
Open

Packaging issue #227

kolevich opened this issue Mar 2, 2021 · 4 comments

Comments

@kolevich
Copy link

kolevich commented Mar 2, 2021

Hello,
We have an issue with BoxPacker when trying to pack 11 items in a single box.

item:

  • width: 4.2
  • length: 10
  • height: 7

box 1:

We are pretty sure it's a bug because a) our end-user states it works in a real-life b) it works fine when we split this box into 2 and trying to pack 3 and 8 items in there, like this:

16x16x18

box 2:

  • width: 16
  • length: 18
  • height: 6
  • item qty: 3
  • result: success to pack in a single box

box 3:

  • width: 16
  • length: 18
  • height: 10
  • item qty: 8
  • result: success to pack in a single box

Would appreciate it if you check this and give your comments.

@dvdoug
Copy link
Owner

dvdoug commented Mar 2, 2021

it works fine when we split this box into 2 and trying to pack 3 and 8

Sounds like you might have found an edge case where the algorithm picks a wrong orientation. I hate these 😅

@kolevich
Copy link
Author

kolevich commented Mar 3, 2021

@dvdoug thanks for the quick response. Is there a way to fix it? Are you planning to do so at an early date?

@dvdoug
Copy link
Owner

dvdoug commented Mar 7, 2021

Hi @kolevich

There is no perfect box-packing algorithm in existence, so like all such algorithms BoxPacker is essentially a set of heuristics which due to their very nature will sometimes pick the non-optimal* result. It's usually fairly easy for me to track down which heuristic causes any particular sub-optimal result, the difficult part is coming up with a new, tweaked version of it that works better for the particular scenario at hand without regressing other cases in the test suite....

  • I've used that word on purpose rather than "wrong"

@dvdoug
Copy link
Owner

dvdoug commented May 3, 2021

I've had a look at this, sadly haven't found a revised heuristic yet that works yet without regressing more cases than it improves

dvdoug added a commit that referenced this issue Feb 5, 2023
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

2 participants