Projects

Which Way Up?

Choose a carton orientation before stocking the shelf. A worked example shows how a quarter turn fits a tenth carton.

Status
Active
Built with
Python
Started
Updated
Source
github.com/Um9i/wwu

Suppose a shelf is 100 cm wide and 60 cm deep, with 20 cm of clearance. Each carton measures 30 × 20 × 20 cm. A stockroom team needs to know how many identical cartons to allocate to each shelf.

Which Way Up? compares six ways to orient a carton. For each, it counts how many whole cartons fit across, deep and high, then returns the layout with the highest count.

Try both layouts

Top views of the same shelf. The first layout holds nine cartons and leaves a strip unused. The second holds ten.

Carton footprintAcross 100 cmAlong 60 cmCartons per shelf
30 × 20 cm339
20 × 30 cm5210

In the first layout, three cartons use 90 cm of the width. The remaining 10 cm is too narrow for another carton. In the second, five cartons use the full 100 cm and two rows use the full depth. Both layouts use the available height in one layer.

When the answer applies

The calculation assumes rectangular cartons of the same size, all facing the same way, with no overhang or handling gap. Use the shelf’s usable internal dimensions and allow for any clearance your team needs before running the numbers.

Reproduce the result

Install the wwu Python package. It takes each set of dimensions in height, width, depth order.

from wwu import Box

carton = Box(20, 30, 20)
layout = carton.best_orientation(20, 100, 60)
print(layout.dimensions)  # (20, 20, 30)
print(layout.box_count)   # 10