Calculate how many identical boxes fit in a rectangular space, and where.
The space is a shipping container, a pallet area, leftover container space,
or a larger box. Give the box's L/W/H and EITHER a `container` preset OR the
space's L/W/H (all in millimetres - container presets are mm). Boxes mix
orientations across regions to pack densely; the plain maximum-load answer
uses the exact SmartPacker T solver.
Args:
box_length: Box length.
box_width: Box width.
box_height: Box height.
container: Container preset instead of explicit space dims (fills the
internal usable L/W/H in mm; overrides space_* when recognised).
ISO dry: 20GP 20HQ 40GP 40HQ 45GP 45HQ; NA domestic: 53HC 48HC;
reefers: 20RF 40RF 40RH; EU pallet-wide: 40HQ-PW 45HQ-PW. Many
aliases (20/40/45, 20ft, 40HC, 40', 40 reefer, ...).
space_length: Space length (front-back). Use this OR `container`.
space_width: Space width (left-right).
space_height: Space height (up).
count: How many boxes to load. 0 (default) loads the maximum.
to_front: Anchor a partial load to the front (else the back).
to_left: Anchor a partial load to the left (else the right).
to_bottom: Anchor a partial load to the bottom (else the top).
box_weight: Weight of one box (optional; same unit as max_weight).
max_weight: Max total load weight (optional; 0 = no weight limit).
include_image: Set true ONLY when the user wants to SEE or visualize
the loading plan / 3D layout (e.g. "show the loading plan",
"visualize it", "what does it look like?"). Default false is
faster and lighter and still returns `image_url`, a shareable
link to the 3D render. When true, the image is ALSO embedded
inline (Claude Desktop and Cherry Studio display it; the
claude.ai web app shows only the link either way).
Returns the maximum that fits, how many were loaded, the fill rate, the
region/block decomposition (each block's position, orientation, and
grid), any weight limit applied, an `image_url` link to the rendered 3D
loading plan, and - when include_image is true - the inline image too.