Box sizing
Rectangular product fit margin
Find the limiting axis for an item held in a fixed orientation with equal padding on all sides.
Tightest remaining margin
cm
The example result is shown.
Worked example
Carton inside length 32 cmCarton inside width 24 cmCarton inside height 17 cmItem length 25 cmItem width 22 cmItem height 12 cmPadding per side 1 cm
Tightest remaining margin 0 cm
Calculation
min(a − d − 2 × g,b − e − 2 × g,c − f − 2 × g)
- a
- Carton inside length · cm
- b
- Carton inside width · cm
- c
- Carton inside height · cm
- d
- Item length · cm
- e
- Item width · cm
- f
- Item height · cm
- g
- Padding per side · cm