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

← All posts

2026-11-20

How to Pack Mixed Size Boxes Into a Container Without Wasting Space

How to Pack Mixed Size Boxes Into a Container Without Wasting Space
RSJ 3D Packer packing optimization item packer

How to Pack Mixed Size Boxes Into a Container Without Wasting Space

Packing one carton size is arithmetic: divide the container volume by the box volume and round down. Packing six carton sizes into the same container is a geometry problem, and the answer depends on the order you place things, which way each box may be turned, what may sit on top of what, and how the weight distributes.

This guide walks through the practical version of that problem: you have a container, a list of box types with dimensions and counts, and you want a concrete plan — coordinates, fill percentage, and an honest list of what did not fit. We will do it with RSJ 3D Packer, which computes a heuristically optimised packing plan for the static 3D bin packing problem: items may be packed in any order, and the solver decides that order for you.

By the end you will have a repeatable workflow, an API call you can script, and a checklist for judging whether the result is actually good.

The Challenge of Packing Mixed Size Boxes

Uniform boxes tile predictably. Mixed boxes do not, for three reasons that compound:

  • Irregular gaps. Large boxes create a base layer with a stepped top surface. The small boxes that fill the steps leave voids that no medium box can use. Each size you add multiplies the number of ways to combine them.
  • Stacking limits. Not everything may go on everything. In RSJ 3D Packer this is modelled with stacking classes: an item is only ever placed on items of a lower or equal class. A heavy pallet-sized carton has to be near the bottom, and that decision constrains every placement above it.
  • Weight distribution and rotation. Containers have an optional maximum load, items have optional weights, and some cartons must stay upright — "vertical": false means the box may not be rotated out of its upright position. Those restrictions remove otherwise attractive placements.

The goal is not “fit everything in”. The goal is to maximise the fill percentage of each container while respecting weight, stacking, rotation and dangerous goods rules — and to find out quickly when a container count is simply too small.

Manual planning works layer by layer, which is exactly the strategy that leaves usable volume behind. An algorithmic pass can consider placements a human will not enumerate by hand. That is the gap this walkthrough closes.

Prerequisites for Using RSJ 3D Packer

Before you start, collect the following:

  • An account. Sign up and sign in at 3dpacker.rsj.de. Every plan can be tested free for 30 days, and the free test exposes the Pro feature set.
  • Your box list. For each box type: width, height, depth and count. Width/height/depth map to x/y/z — pick one unit and stay consistent across items and containers.
  • Your container list. Width, height, depth and how many containers of each size you have.
  • Optional constraints. Weight per item and maximum container load, itemClass for stacking, vertical: false for no-rotation items, and risk types/points for dangerous goods.
  • Nothing to install for the cloud version. On-premises (Windows 10/11 64-bit or Ubuntu 64-bit, 16 GB RAM, 4 GB disk) and a stand-alone program exist for other deployment needs.

One plan caveat before you build a problem definition: different container sizes and weight limits are Standard and Pro features, preventing vertical rotation is Standard and Pro, and dangerous goods handling is Pro only. The free test gives you all of it for the evaluation period, so check your target plan if you build a dependency on them.

Step-by-Step: Generating an Optimised Packing Plan

Step 1: Open the packing application

Sign in and open the packing application in a browser:

# the application, where the free test runs
https://3dpacker.rsj.de/

You get a browser interface for building the problem and an interactive 3D view of the result. Everything below can be done in that UI; the JSON shown at each step is the same data you would send to the API, which makes the transition to automation trivial later.

Step 2: Define your containers

Enter width, height, depth and count for each container type. Add the optional weight (maximum load) and allowedRiskPoints if you use them.

{
  "containers": [
    {
      "width": 48,
      "height": 47,
      "depth": 46,
      "count": 1,
      "weight": 2000,
      "allowedRiskPoints": 1000
    }
  ]
}

count defaults to one if you omit it, so a single container type needs only its three dimensions.

Step 3: Add every box type

Add one entry per box type with its own dimensions and count. This is where the mixed-size problem actually gets described:

{
  "items": [
    { "width": 11, "height": 6, "depth": 6, "count": 51 },
    {
      "width": 7,
      "height": 8,
      "depth": 9,
      "count": 53,
      "vertical": false,
      "itemClass": 1,
      "weight": 12
    }
  ]
}
  • vertical describes whether the item may be rotated out of its upright position. Omit it and rotation is allowed; set "vertical": false to lock the item upright.
  • itemClass is an integer. An item is only ever placed on items of a lower or equal class, so class 1 sits on class 0 or 1, never on class 2.
  • weight is a number and is checked against the container’s maximum load.
  • You may attach your own id to any item to keep it identifiable in the result.

If you are unsure whether rotation should be locked for a given box type, the trade-off is covered in Prevent Items From Being Rotated During Packing: Why It Matters.

Step 4: (Optional) Configure dangerous goods rules

If any items carry risk types, add riskPoints and riskTypes to those items and declare which type pairs must never share a load:

{
  "items": [
    { "width": 8, "height": 9, "depth": 10, "count": 57, "riskTypes": [1, 2], "riskPoints": 10 }
  ],
  "risks": [{ "type1": 1, "type2": 2 }]
}

Containers cap the accumulated risk with allowedRiskPoints. The risks array is optional and only meaningful on top of the item-level risk fields.

Step 5: Submit the problem to the solver

In the UI, run the solve. From a script, the same problem is a single POST. Authenticate first:

# 1. Exchange the e-mail + hmac for a session token
curl -s "https://3dpacker.rsj.de/user/you@example.com?hmac=${HMAC}" \
  -H "Accept: application/json"
# -> response contains: "session": "session-1bc90169-1c83-443e-8ed7-b0328aaf78a5"

The hmac is an HMAC-SHA256 hash of the e-mail address. It can only be computed on the server while the user is logged in, so a stand-alone client copies it once and keeps it. Sessions are valid for about a day — fetch a fresh one rather than storing it.

# 2. Solve, with a client timeout above the 240 second solver budget
curl -s https://3dpacker.rsj.de/solve \
  -H "Authorization: Bearer ${SESSION}" \
  -H "Content-Type: application/json" \
  -d @problem.json \
  -o plan.json

Every request runs with a 240-second time budget on every plan. Set your HTTP client timeout above that.

Unknown keys in the request objects are ignored, so you can carry client metadata along — but be aware a future field could collide with a key you invented.

Step 6: Review the 3D result and export

The result contains packed items with their container index (c) and x/y/z position, fill percentage per container, the number of containers used, unpacked items with counts, plus a viewer URL and an API sandbox URL.

{
  "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 }
  ],
  "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 }
  ]
}

Open the interactive 3D view to see the layout, and download the solution as a GLB 3D model if you need it for documentation or a stakeholder review.

How to Confirm the Packing Plan Worked

Four checks, in order of how quickly they tell you something:

  1. Fill percentage per container. The filled value in each container entry is your space utilisation. Compare runs against each other rather than against an abstract ideal — the same box list with a tighter itemClass scheme will beat a looser one.
  2. Remaining counts. Every item entry carries remaining. All zeros means the whole order fit; anything else is listed again in unpackedItems with its count.
  3. The 3D view. Every packed item is supported by the item below it — the plan contains no floating items — and stacking classes are respected. Eyeballing the viewer is the fastest way to notice that a group of fragile boxes ended up under a heavy one because you gave them the wrong class.
  4. Containers used. Fewer containers for the same item set is the entire point. If used is one more than you expected, that marginal container is where your wasted space lives.

A short script turns checks 1, 2 and 4 into a gate you can run in CI or before a shipment goes out:

import json, os, requests

plan = requests.post(
    "https://3dpacker.rsj.de/solve",
    headers={"Authorization": f"Bearer {os.environ['PACKER_SESSION']}"},
    json=json.load(open("problem.json")),
    timeout=300,
).json()

for c in plan["containers"]:
    print(f"{c['used']}/{c['count']} used, filled {c['filled']}%")

unpacked = [(i["width"], i["height"], i["depth"], i["count"])
            for i in plan["unpackedItems"] if i["count"]]
print("unpacked:", unpacked or "none")

If unpacked is not empty, the plan is not wrong — it is telling you the problem as stated is infeasible. Change the problem, not the plan.

Troubleshooting Common Issues

Items do not fit at all. Re-check the dimensions first — a transposed width and height is the most common cause. Then look at vertical: if a box is locked upright when it did not need to be, you removed placements for no reason.

The weight limit is exceeded or the solver refuses placements. Confirm the container’s weight is the maximum load and not the tare weight, and that item weight values are in the same unit. Reducing counts or adding a container type changes the answer more than tweaking dimensions does.

Everything piles up in one corner. Look at itemClass. Items only stack on lower or equal classes, so a class assignment that is too high at the bottom forces odd layouts. The mechanics are explained in Stacking Constraints in Container Packing Explained.

Dangerous goods prevent a full load. Check allowedRiskPoints per container against the sum of riskPoints, and confirm the risks pairs are the ones you actually want to forbid — a pair you did not intend blocks placements silently.

The solve feels slow. The 240-second budget is fixed and applies to every request. Fewer item types, fewer containers and simpler class structures all reduce the search space. If you are running many scenarios, that is the point at which the API and the Google Sheets add-on start paying for themselves compared to the UI.

A field you sent had no effect. Unknown keys are ignored by design. Check field names against the API reference or the OpenAPI document rather than assuming a typo was rejected.

Taking It Further: Automation and Integration

Once a problem definition works, stop rebuilding it by hand:

  • REST API. Every solve is a JSON POST, so order data from your ERP or WMS can feed the solver directly. The API sandbox lets you try requests live with a 3D preview before you write client code.
  • Google Sheets add-on. The cloud version plugs into Sheets, which is often the shortest path from a spreadsheet of box counts to a plan — see Google Sheets Packing Calculator: What the Add-On Does.
  • GLB export. Download the solution as a 3D model for documentation, training material or a loading discussion that does not need the app open.
  • On-premises or stand-alone. Available if the data cannot leave your network or you need a fixed deployment.

One thing worth knowing if your process is stricter than “pack in any order”: the solver targets the static problem, but the algorithm can be adapted for dynamic problems, such as a fixed packing order or a required unpacking order. That is a conversation with the vendor, not a checkbox in the UI.

FAQ

Can RSJ 3D Packer handle boxes of different sizes in the same container?

Yes. RSJ 3D Packer is designed to pack items with different dimensions. You specify each box type with its own width, height and depth, and the solver optimises their placement together.

How long does it take to get a packing plan?

The solver works with a 240-second time budget per request. The response contains the packed item positions, the fill percentage per container and any unpacked items.

Can I prevent certain boxes from being rotated?

Yes. Set "vertical": false for items that must remain upright. Preventing vertical rotation is available on the Standard and Pro plans.

What if some items don’t fit in the containers?

The result includes unpacked items with their counts. Adjust container sizes, item quantities or constraints and re-run the solver.

Do I need to install anything?

No, for the cloud version — it runs in the browser and through the web service API. On-premises and stand-alone delivery options exist if you need them.

Conclusion

Mixed-size packing is not solved by a better spreadsheet formula; it is solved by generating a plan, reading its fill percentage honestly, and iterating on the constraints that actually bind. Define your containers, describe every box type with real dimensions, lock only the rotations that genuinely need locking, and let the solver do the placement search.

RSJ 3D Packer is the practical way to run that loop: a browser UI for the first attempt, a JSON API once it becomes routine, and a 3D viewer to check the result before anything gets loaded. The free 30-day test exposes the full Pro feature set, so you can run your own mixed-size box list through it today and compare the fill percentage against your current plan.

Related posts

EU label: AI-generated content