RSJ 3D Packer 3D bin packing, palletising and load optimisation

← All posts

2026-10-15

What Is the 3D Bin Packing Problem? A Plain-Language Explanation

What Is the 3D Bin Packing Problem? A Plain-Language Explanation
RSJ 3D Packer packing optimization item packer

What Is the 3D Bin Packing Problem? A Plain-Language Explanation

If you have ever stacked boxes into the back of a car and then stood there wondering whether you could squeeze one more in, you have already worked on the 3D bin packing problem. You just did it with your hands, in about ten seconds, and probably not optimally.

So, what is the 3D bin packing problem? In one sentence: it is the task of fitting a set of three-dimensional items into one or more containers of fixed size, without any item overlapping another, while respecting the real-world rules that apply to your goods.

This article explains the problem itself — no software pitch until the end. If you already know the problem and are shopping for tools, the software comparison is a better starting point.

The 3D Bin Packing Problem, in One Sentence

Formally: you have a list of items, each with a width, a height and a depth, and you have one or more bins (containers, pallets, totes) that also have a width, height and depth. Every item must be placed at a position inside a bin so that:

  • no two items overlap,
  • no item sticks out of its bin,
  • every item rests on the floor of the bin or on top of another item.

That is the geometric core. Everything else — weight, stacking rules, dangerous goods — is a constraint layered on top.

The name comes from the classic bin packing problem, where the goal is to put a set of objects into as few bins as possible. In the one-dimensional original, an object is just a number, and a bin is a capacity. The “3D” part means each object now occupies a volume rather than a slot, and each bin is a box rather than a bucket.

There are usually two goals, and they compete with each other:

  • Use as few containers as possible — fewer containers means lower freight cost.
  • Maximise the fill percentage — a fuller container means less wasted volume, though sometimes at the cost of an extra container elsewhere.

And one important caveat: this is a classic optimisation problem. Finding the provably best arrangement is computationally hard, and the difficulty grows explosively with the number of items. So practical solvers do not search for perfection. They use heuristics — smart shortcuts — to find very good solutions quickly.

A Real-World Analogy: Packing a Moving Truck

Imagine you are moving house and you have rented a truck. Your goals are obvious:

  • Everything must fit, or you pay for a second truck.
  • Nothing gets crushed, so heavy boxes go low and fragile ones go high.
  • Oddly shaped things — a lamp, a bike — need to go somewhere sensible, not just in the first gap you see.

Now think about the decisions you actually make, box by box:

  • Which box goes in next?
  • Which way round do I turn it? Does the “this way up” arrow matter?
  • What can I safely stack on top of what?
  • Is there a gap at the back I should have filled earlier?

Those four questions are the 3D bin packing problem. The same logic shows up everywhere:

  • Pallets — mixed cartons on a standard euro pallet, with a height limit and a weight limit.
  • Shipping containers — 20ft, 40ft, high cube, all with different internal dimensions.
  • Warehouse totes — small bins picked by a robot or an operator, where pick order may matter as much as fit.

A human is very good at this for thirty boxes, and quite bad at it for three hundred. A computer can evaluate millions of candidate arrangements in the time it takes you to lift the first box — and it does not get tired, biased, or attached to a particular packing pattern.

How 3D Bin Packing Differs from 1D and 2D Packing

It helps to see the three variants side by side, because the jump in difficulty is not linear.

1D packing. Items have a single dimension, a container is a single capacity. Think of filling a truck by weight only, or cutting a cable into lengths with minimum waste. The decision is essentially “which items go in which bin”.

2D packing. Items are rectangles placed on a flat surface. The classic example is cutting sheet material — steel, glass, plywood — where you want to place rectangles on a sheet with minimal offcut. Now position matters in two directions, and rectangles may often be rotated 90°.

3D packing. Items are boxes, and the container is a volume. Now you must decide position in three axes and orientation, and — crucially — items can rest on top of other items. Rotation and stacking become first-class concerns rather than afterthoughts.

That last point is where the complexity explodes. In 2D, an item roughly has four meaningful orientations on the sheet. In 3D, a box has up to six distinct axis-aligned orientations, and each one changes what can be stacked on it and how much floor space it occupies. Multiply that by the number of possible positions, and by the number of items, and a naive brute-force search becomes hopeless almost immediately.

What Makes 3D Packing Hard? Constraints Beyond Geometry

Geometry alone is already hard. Real logistics makes it harder, because a plan that is geometrically valid can still be physically or legally impossible. The common extra constraints:

Rotation restrictions. Some goods simply may not be laid on their side — liquids, electronics, anything with a “this way up” marking. In a solver’s input this is usually an explicit flag. In RSJ 3D Packer, an item that must not be rotated out of its upright position is expressed as "vertical": false.

Stacking rules. Not everything can carry everything. A typical model gives each item a stacking class, and an item may only be placed on items of a lower or equal class. Layered on top of that: every packed item must be supported by the item below it. No floating boxes, no cantilevers.

Weight limits. A container has a maximum load, and individual items may have a weight of their own. A container can be volumetrically half empty and still be too heavy.

Dangerous goods. Hazardous materials carry risk types and risk points. Some pairs of risk types must not travel in the same container at all, and a container may have a maximum number of risk points it is allowed to hold. A plan that ignores this is not just inefficient — it is non-compliant.

Multiple container sizes. In practice you rarely have one bin size. You have a fleet: short and tall, long and low, heavy-duty and light. Choosing which container to open for which group of items is part of the problem.

How a 3D Packing Solver Works Under the Hood (Briefly)

You do not need to understand the internals to use a solver, but a mental model helps you set expectations.

Most solvers fall into one of two families. Classic heuristics apply a fixed rule — place the biggest item first, fill the lowest gap next — and are fast and predictable. Metaheuristics search a space of strategies and improve them over time. RSJ 3D Packer belongs to the second family: its core is a neural network optimised through neuro-evolution, which means the packing strategy itself is evolved rather than hand-written.

Two consequences follow from that design:

  1. There is a time budget. RSJ 3D Packer works with a 240-second time budget per request. The solver returns a plan within that budget; the actual duration depends on problem size and constraints.
  2. The plan is static. Items may be packed in any order — the solver is not simulating a live loading sequence. (For cases where order matters, the algorithm can be adapted, for example to a fixed packing order or a required unpacking order.)

The output is a concrete plan: every packed item with its container index and x/y/z position, the fill percentage per container, the number of containers used, and the list of items that did not fit. From there you can view the result in an interactive 3D viewer and download it as a GLB 3D model.

Why It Matters: Business Impact and Common Misconceptions

The business case is straightforward arithmetic. If your fill rate goes from 68% to 82%, you are shipping the same goods in measurably fewer containers. Fewer containers means lower freight cost, less handling, and a smaller carbon footprint per shipment. Add weight and dangerous-goods constraints and the benefit compounds: plans that used to be rejected at the loading dock are now correct the first time.

Three misconceptions come up often enough to be worth naming.

“A perfect solution always exists.” It usually does exist in theory and is impractical to find. Optimality is a mathematical ideal; good heuristics get you close enough that the remaining gap costs less than the compute needed to close it.

“Any packing software can handle all constraints.” Many tools optimise geometry and stop there. Rotation restrictions, stacking classes, weight limits and dangerous goods are frequently missing or bolted on afterwards.

“You need to be a developer to use a solver.” Not true. RSJ 3D Packer offers a browser application with an interactive 3D view, and the cloud version is integrated into Google Sheets through its own add-on. Developers who want automation can call the REST API directly — the API walkthrough covers that path.

How RSJ 3D Packer Solves the 3D Bin Packing Problem

RSJ 3D Packer is a managed service: you describe the problem, it returns a packing plan. There is no infrastructure to run and no solver library to tune.

The primary path is the browser application — sign in, enter your containers and items, run the solve, and inspect the result in an interactive 3D view. The second path is the API, a JSON REST interface at https://3dpacker.rsj.de, documented as OpenAPI 3.0.

A request to POST /solve looks like this:

{
  "containers": [
    {
      "width": 48,
      "height": 47,
      "depth": 46,
      "count": 1,
      "weight": 2000,
      "allowedRiskPoints": 1000
    }
  ],
  "items": [
    { "width": 11, "height": 6, "depth": 6, "count": 51 },
    {
      "width": 7,
      "height": 8,
      "depth": 9,
      "count": 53,
      "vertical": false,
      "itemClass": 1,
      "weight": 12
    },
    { "width": 8, "height": 9, "depth": 10, "count": 57, "riskTypes": [1, 2], "riskPoints": 10 }
  ],
  "risks": [{ "type1": 1, "type2": 2 }]
}

width, height and depth map to x, y and z, and count defaults to one if you leave it out. Optional item fields include weight, itemClass, vertical, riskPoints, riskTypes and an id of your choosing; optional container fields include weight (maximum load), allowedRiskPoints and count. Unknown keys are ignored, so you can carry your own metadata along with a request.

Calling it from the command line is a single request:

curl -s https://3dpacker.rsj.de/solve \
  -H "Authorization: Bearer session-1bc90169-1c83-443e-8ed7-b0328aaf78a5" \
  -H "Content-Type: application/json" \
  -d @problem.json

The session token comes from the login endpoint — GET /user/{email}?hmac={hmac} — and is valid for roughly one day, so fetch a fresh one per run rather than storing it.

The response tells you everything you need to act on the plan:

{
  "containers": [
    { "width": 48, "height": 47, "depth": 46, "count": 1, "used": 1, "filled": 76.77, "first": 0 }
  ],
  "items": [
    { "width": 11, "height": 6, "depth": 6, "count": 51, "vertical": true, "remaining": 0 },
    { "width": 8, "height": 9, "depth": 10, "count": 57, "remaining": 17 }
  ],
  "packedItems": [
    { "id": 0, "c": 0, "width": 11, "height": 6, "depth": 6, "x": 0, "y": 0, "z": 0 }
  ],
  "unpackedItems": [
    { "id": 2, "width": 8, "height": 9, "depth": 10, "weight": 0, "itemClass": 0, "count": 17 }
  ]
}

You get packed items with container index and coordinates, fill percentage per container, the number of containers used, and the items that did not fit — plus a viewer URL for the 3D preview and a link to the API sandbox.

On feature availability: different item sizes work on every plan; different container sizes, weight limits and preventing vertical rotation start on Standard; dangerous goods with risk types and risk points are a Pro feature. Every plan can be tested free for 30 days, and the free test exposes the Pro feature set. Full details and checkout are on the plans page, and the machine-readable spec lives at openapi.yaml.

FAQ

What is the difference between 3D bin packing and container loading?

3D bin packing is the mathematical problem of fitting items into containers. Container loading is the practical application of that solution in logistics. A 3D packing solver like RSJ 3D Packer computes the arrangement, which you then use to load the container.

Can 3D bin packing handle weight limits and dangerous goods?

Yes, advanced solvers can. RSJ 3D Packer supports weight limits per container, stacking classes, vertical rotation restrictions, and dangerous goods with risk types and risk points. Weight limits and rotation restrictions are available on Standard and Pro; dangerous goods require the Pro plan.

Do I need to be a programmer to use a 3D packing solver?

Not necessarily. RSJ 3D Packer offers a browser application with an interactive 3D view, and a Google Sheets add-on for the cloud version. Developers can also use the REST API directly.

How long does it take to get a packing plan?

RSJ 3D Packer works with a 240-second time budget per request. The actual time depends on the problem size and constraints, but the solver returns a plan within that budget.

The Short Version

3D bin packing is fitting boxes into boxes without overlaps, using as few containers as possible while respecting the rules your goods actually have: which way up they may travel, what can be stacked on what, how heavy the load may get, and what may not share a container. It is hard because the number of positions and orientations explodes with item count, which is why nobody solves it with brute force and everybody solves it with heuristics.

The practical takeaway: describe your items and containers once, let a solver do the searching, and act on a plan that already accounts for your constraints. The free 30-day test exposes the full Pro feature set, so you can run your own mixed pallet or container problem and see the fill rate for yourself — start the test and put real numbers in.

Related posts

EU label: AI-generated content