dvdoug / boxpacker
3D bin packing with weight: cartonize orders into parcels, or fill a single container / pallet and leave leftover cargo unpacked
Fund package maintenance!
Requires (Dev)
- behat/behat: ^3.27
- dvdoug/behat-code-coverage: ^5.3
- friendsofphp/php-cs-fixer: ^3.93.1
- monolog/monolog: ^3.9
- phpunit/phpunit: ^11.5.44||^12.4.4
This package is auto-updated.
Last update: 2026-08-16 17:55:14 UTC
README
An implementation of the 3D bin packing problem with weight as a fourth constraint: given items and a catalogue of boxes, how many cartons do you need, and what goes in each?
The same engine can also fill a single container (pallet, trailer, ocean box) as densely as possible and leave the rest unpacked.
Typical uses: e-commerce cartonization and shipping-cost calculation, warehouse box selection, and one-container load planning.
- Your own Item/Box objects (no wrapper DTOs)
- Rotation: any way up, keep-flat, or none
- Weight limits and automatic weight balancing across cartons
- Limited box stock, linked items, custom placement rules
- Packed x/y/z coordinates and a 3D visualiser
Requires PHP 8.2+. composer require dvdoug/boxpacker
See documentation for more details.
License
BoxPacker is MIT-licensed.