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

Spaces between items #492

Open
HitoTech opened this issue May 16, 2023 · 2 comments
Open

Spaces between items #492

HitoTech opened this issue May 16, 2023 · 2 comments

Comments

@HitoTech
Copy link

Hello,

First, thank you for your great library!
We use it in order to find the best fit, with the minimum packages number.

I write this issue, because we have a specific request, and I'm not sure how I should handle it.

For specific item types, and specific boxes, when we want to pack multiple items in one package, we are asked to add additional dimensions between items.

Example with 2 items :

  • First item => Best fit into the best box ;
  • Second item
    • Try to fit it into the first box with the first item ;
    • We must add 5cm on all sides of both items, because there is already one item in the box ;
    • Check if both items still fit in the current box.

It would still be the same when we have more items.

If I understand your library right, I would say that I should use the ConstrainedPlacementItem interface.
But I'm not really sure how to do this request with this, because even if the canBePacked method returns true, it will not return the new X/Y/Z positions.

Do you have an idea on how to manage this edge case please ?

Thank you by advance for your help!

@dvdoug
Copy link
Owner

dvdoug commented May 21, 2023

Hi

Unfortunately, I can't think of an easy way to solve this, it's a problem that's just not in the architecture. The only thing I can think of is just to unconditionally pad the item size by 5cm always and accept that many packing solutions will be sub-optimal as a result.

I'll leave this open in case I ever think of a way this kind of constraint could be incorporated into a hook

@HitoTech
Copy link
Author

Hello 👋

Ok, that's what I thought after reading the code.
Maybe I will try to do the calculation in the canBePacked method for each item when called.
It will be a lot of calculation, and the 3D representation will not be accurate, but I will know that everything in the box can fit.

In any case, thank you for taking the time to answer my question 🙏

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