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

Item Dimensions | Cartonization #84

Open
agritheory opened this issue May 15, 2024 · 3 comments
Open

Item Dimensions | Cartonization #84

agritheory opened this issue May 15, 2024 · 3 comments
Assignees

Comments

@agritheory
Copy link
Owner

Link to Item with default UOM or link to Item Conversion Detail.

Length, width and height with UOM

Required orientation (like if it can or cannot be turned on its side)

An attachment (and preview) field for 3D data

@agritheory agritheory changed the title Item Dimensions Item Dimensions | Cartonization May 30, 2024
@Alchez
Copy link
Collaborator

Alchez commented Jun 11, 2024

@agritheory @HKuz

I'm adding my questions and notes about cartonization here, but this should also cover #85.


In the context of inventory tools, is cartonization referring to:

  • packing items into boxes?
  • packing items into warehouse units?
  • packing boxes into warehouse units?
  • or a combination of the above?

Goal: Define the items and packages and receive cartesian coordinates of how to pack the items into the packages.

I tried out the following libraries for general bin packing and here's my notes:

  • https://github.com/enzoruiz/3dbinpacking
    • This is the only package that returns coordinates of the packed items and is fairly performant too. The library allows sorting by biggest first and smallest first, and also trying to fit all items into a single box if possible.
    • There do seem to be some reported issues about false positives in the orientation of individual items, which will affect the 3D preview, but it seems like it solves the bin packing problem correctly in those cases too (as much as you can "solve" NP-complete problems 😅).
  • https://github.com/hudora/pyShipping
    • I couldn't install this package (however, it's also over a decade old), but it uses C and Python to do 3D bin packing. I'm not sure if it's salvageable, but the code could also be worth a look for performance?
  • https://github.com/xshen1898/AutomatedCartonSelection
    • The code is not performant at all and crashed my system trying to parse just 6 items across 13 types of boxes, but the package dataset could be yanked out and might be a good start for inventory tools fixtures.
  • https://developers.google.com/optimization/pack/bin_packing
    • Google has an example for bin packing in their optimization tools repo that uses a linear solver. The example shown only uses one dimension (weights) but I think we could maybe try and expand that to include volume as another dimension.
    • They also have a solve for the knapsack problem if the number of the target packages is fixed. More info on the difference can be found here.
  • https://rosettacode.org/wiki/Knapsack_problem
    • There are some great examples on this site that include multi-dimensional packing (volume and weight), but they're currently only for single-bin packing. We could try adapt this code to allow multiple bins as well though.

@agritheory
Copy link
Owner Author

@Alchez @HKuz

I think we should look into the PythonMIP package and MIP solvers generally for this. The examples page seems reasonably adaptable. This is among the most technically challenging solutions we could develop for this, but also is industry standard. An override API would be appropriate. Besides the Knapsack problem, both one and two dimension bin packing are covered.

https://docs.python-mip.com/en/latest/examples.html

@agritheory
Copy link
Owner Author

Another integration here would be to automatically populate Shipment parcels based on Item Dimensions

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