The problem
Webshops ship mixed orders every day. Choosing the carton for each order and stacking cartons on pallets by rule of thumb wastes cardboard, space and shipping money. Most packing libraries fill one container with boxes; real shipping is a hierarchy: products go into shipping cartons, cartons go onto pallets, and every level has its own sizes, weight limits and prices.
What pack3d does
pack3d takes an order and a packaging hierarchy and decides which packaging to use at every level and where every box sits. Plans use integer geometry and are deterministic: the same input and seed always give the same plan. An independent validator checks every plan before it is trusted.
How it works
- Fast mode returns a good plan right away.
- Improve mode keeps searching for a cheaper plan with a biased random-key genetic algorithm, within an effort or time budget, and reports its progress.
- Plans are scored by box count or by real carrier prices, including volumetric weight and rate brackets.
- It respects stock limits and weight limits and can balance the load on a pallet.
- The engine has no dependencies, runs in a web worker and works in the browser and in Node 22+.
The viewer
pack3d-react draws a plan in 3D with React Three Fiber: cardboard and pallet textures, printed labels that turn with each item, and a selection colour to highlight a unit. A playground app packs sample webshop orders and shows the result.
Engineering
- TypeScript, ESM only, with generated API docs.
- Thousands of engine tests, benchmarks with a CI gate against a baseline, and Playwright end-to-end tests for the playground.
- Size budgets on every entry (the core is about 17.5 kB minified and gzipped) and package checks with publint and Are The Types Wrong.
- MIT licensed, contributions under the Developer Certificate of Origin.
Status
Pre-release. The engine, worker, viewer, playground and CI pipeline are complete; nothing is published to npm yet.