dvdoug/BoxPacker

Partitioned Boxes

Patch85 opened this issue · 3 comments

Hello. I've been looking at integrating BoxPacker into an app and have been struggling to come up with an appropriate way to handle partitioned boxes.

As an example, I have some items that are 10 x 10 x 4 that are often packed into a box that is 20.25 x 10 x 12.
This box has a cardboard insert that subdivides the interior into 2 sections, each of which can accommodate 3 of my items, stacked.

If I define this box with its overall interior dimensions, I can get results that would have me pack items that would fit in the box without the partition, but when it is in place as intended, these items will not fit.

Is there a way to define a single box as a container of sorts for partitions? Like multiple boxes within a box?

My intent is to take the results and use them to get shipping estimates, so simply adding the partitioned area as its own independent box won't quite do the job.

Nothing obvious comes to mind to help with this scenario @Patch85 I'm afraid, you'd need to model the two halves independently, but I can't think of any way to "rejoin" them that the BoxPacker architecture currently supports

Thanks for getting back to me about it. Thus far, BoxPacker has been impressive in its capabilities and utility, I think we'll be able to use it well.

If I come up with a solution to this scenario, would you be open to a PR?

Yes, absolutely - although if you need to break BC in any way, then I can't guarantee releasing it for a while other than as an alpha