davidmchapman / 3DContainerPacking

A 3D container packing library in C#.
MIT License
435 stars 150 forks source link

Pack all items - many available boxes #33

Open noptools opened 3 years ago

noptools commented 3 years ago

David Would you please suggest how one could modify the code so that rather than just packing only one box at a time, that it would have an infinite number of each of the specified containers, and find the 'optimal' (or very good ;) packing of all items, for the minimum total container volume.

mjrichards91 commented 3 years ago

Pass all known items and boxes into the PackingService.Pack method and first find which container has the highest PercentContainerVolumePacked. You can then get all of the UnpackedItems from there and re-run the PackingService.Pack method with those UnpackedItems (again finding which container has the highest PercentContainerVolumePacked) until all items are packed. In the end, you would have the multiple boxes in which everything was packed in.