Method & assumptions
A complete check of a deliberately limited grid model.
Cratepack evaluates regular orthogonal grids of identical rectangular items inside a rectangular container. In each tested grid, every item has the same orientation. The result is the largest count among those tested uniform grids. It is not a claim about the best possible arbitrary three-dimensional packing.
What the dimensions mean
Enter the container’s internal usable X, Y and Z dimensions, all in millimetres. Enter the outer L, W and H dimensions of one item in the same unit. The letters are labels, not an assumption that L must be the longest edge. The tool does not deduct wall thickness or infer packaging tolerances.
A row such as HWL assigns the entered item H dimension along container X, W along Y, and L along Z. All items in that row use the same assignment. There are at most six permutations. If the item has equal edge lengths, some permutations give identical ordered dimension triples; these are collapsed while their symbolic aliases are kept in JSON.
One gap between neighbors
The entered gap is the same nonnegative distance between neighboring items along each axis. It is not a required margin at the container walls. Two items require one gap, three require two gaps, and one item requires none. If you need unused space at a wall, reduce the usable container dimension yourself before entering it.
The one-axis count
For a positive item edge d, internal container edge C, nonnegative gap g, and n ≥ 1 items, the required span is:
used span = n × d + (n − 1) × g
It fits when that span is no greater than C. Rearranging gives n × (d + g) ≤ C + g, so the greatest integer count on that axis is:
n = floor((C + g) / (d + g))
The same expression gives zero when the item edge exceeds that container edge. Every calculation uses exact scaled integer millimetres, including a tiny positive gap; no floating-point rounding determines whether an exact boundary fits.
From axes to a uniform grid
For a tested item assignment, multiply the three axis counts: nX × nY × nZ. That Cartesian grid supplies exactly that many positions under this model. Compute this for every distinct item-edge permutation and compare the integer products. This proves the best count within the stated uniform, single-orientation model.
It does not search mixed orientations, alternating layers, offset rows, tilted items, compression, interlocking or irregular shapes. One of those arrangements might hold more items. The tool does not report an unrestricted packing maximum or a shipping or load plan.
Used spans and remaining space
For a complete positive-count grid, the used span on each axis is n × d + (n − 1) × g. The remaining span is C minus that used span. This is the unused extent on that axis, not a promise that another item or another object fits into the leftover space. The schematic labels axis counts and is not to scale; it does not draw every item.
If a tested orientation has any zero axis count, it has zero complete items. Its used spans and per-axis remainders are reported as not applicable, with null values in JSON. Potential counts on the other axes still identify the limiting direction, but they do not create a partially placed item grid. If every tested orientation has zero complete items, the page shows a valid no-fit result and selects no placed layout.
Ties and repeated item edges
The fixed symbolic order is LWH, LHW, WLH, WHL, HLW, HWL. Equal ordered dimension triples collapse to the first representative. Every distinct assignment tied for the greatest positive count is listed. The selected details use the first in that order; this does not mean it has better handling or stability. If all tested counts are zero, the records remain available without selecting a placed layout.
Decimal input limits
Every dimension must be greater than 0 and at most 1,000,000,000 mm. Gap is 0 through 1,000,000,000 mm. All seven fields accept unsigned plain decimals with at most six fractional places and 32 raw characters, including optional ASCII outer spaces. Leading zeroes are allowed. Use digits on both sides of any decimal point: 0.5 is valid; .5 and 1. are not.
Signs, exponents, tabs, commas, unit suffixes, NaN and trailing text are rejected. A dimension of 0 is invalid. A value just above the maximum is rejected exactly, and values are never silently clamped. These software limits do not imply that measurements are physically known to six decimal places.
Exact counts, even at numerical boundaries
The implementation parses decimal dimensions into integer millionths of a millimetre and keeps products as BigInt. At the maximum container size and smallest item size, an axis count can be 10¹⁵ and a three-axis product 10⁴⁵. Counts remain full integer strings; the tool does not convert them to a rounded floating-point number or try to render that many objects.
Copy and text/JSON downloads use only the current completed result. Every edit clears all old summary, rows, schematic and export state. Reset example explicitly restores all seven inputs. A late clipboard response cannot restore an older calculation in the page.
Primary mathematical context
- Wolfram MathWorld: Floor Function defines the greatest-integer operation used after the one-axis inequality is rearranged.
- OpenStax Prealgebra 2e: Rectangular solids provides the orthogonal, layered rectangular-geometry context.
The gap/count derivation above is specific to this calculator’s model. Neither reference turns it into a general packing optimizer or a guarantee of physical fit. Try the worked examples before using your own dimensions.