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

Suggest item #224

Open
solocolagenos opened this issue Feb 15, 2021 · 2 comments
Open

Suggest item #224

solocolagenos opened this issue Feb 15, 2021 · 2 comments

Comments

@solocolagenos
Copy link

solocolagenos commented Feb 15, 2021

How can I get the dimensions of an item that can fill the remaining empty space in the box?

i try it with:
$packedBox->getRemainingWidth()
$packedBox->getRemainingLength()
$packedBox->getRemainingDepth();

but it didn't work as I wanted
thx!!

@dvdoug
Copy link
Owner

dvdoug commented Mar 8, 2021

Hi @solocolagenos

Are you able to explain a little more about what you are trying to achieve? After a box is packed, there will be all sorts of "spaces" left over there is typically not just 1 leftover space.

The 3 methods above relate to the overall box. For instance if inner box dimensions were 20x30x40 and it was filled with 1 item 18x20x35. Then:

  • used(Width/Length/Depth) = 18x20x35 (a hypothetical containing box that would have beens sufficient)
  • remaining(Width/Length/Depth) = 2 x 10 x 5 (the difference between the actual box and the hypothetical box).

2x10x5 is an actual space (in a corner) that wasn't used for packing, but as you can see there are other spaces e.g. there is a 2x30x40 and a 20x10x5. The information for those isn't available from BoxPacker, you'd need to do the geometry yourself if you want to know them, bearing in mind that spaces overlap and that might be important.

Does that help?

@solocolagenos
Copy link
Author

Hi @solocolagenos

Are you able to explain a little more about what you are trying to achieve? After a box is packed, there will be all sorts of "spaces" left over there is typically not just 1 leftover space.

The 3 methods above relate to the overall box. For instance if inner box dimensions were 20x30x40 and it was filled with 1 item 18x20x35. Then:

  • used(Width/Length/Depth) = 18x20x35 (a hypothetical containing box that would have beens sufficient)
  • remaining(Width/Length/Depth) = 2 x 10 x 5 (the difference between the actual box and the hypothetical box).

2x10x5 is an actual space (in a corner) that wasn't used for packing, but as you can see there are other spaces e.g. there is a 2x30x40 and a 20x10x5. The information for those isn't available from BoxPacker, you'd need to do the geometry yourself if you want to know them, bearing in mind that spaces overlap and that might be important.

Does that help?

Thanks for answering.
Could you know what the dimensions of the largest remaining space would be? (with more volume)

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