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

← All posts

2026-10-19

How to Pack Dangerous Goods in One Container Safely

How to Pack Dangerous Goods in One Container Safely
RSJ 3D Packer packing optimization item packer

How to Pack Dangerous Goods in One Container Safely

A mixed load is the hard case. Half a container of general cargo, a few pallets with hazard labels, and one container to put it all in. Two things can go wrong at once: you exceed the risk limit the container is allowed to carry, or you place two risk types next to each other that must never travel together.

Doing that by hand means juggling dimensions, weights, stacking heights and a segregation matrix at the same time. It is slow, and the moment someone swaps a pallet the whole layout is questionable again.

This guide shows how to set up one dangerous goods packing problem and let RSJ 3D Packer solve it: containers with risk limits, items with risk types and risk points, and the pairs of risk types that must be split across containers. You will end up with a packing plan you can inspect in 3D, plus the numbers you need to check it against your own limits.

What You Need Before You Start

  • An account. The free test runs for 30 days and exposes the Pro feature set, which is where dangerous goods handling lives. On the paid plans, risk types and risk points are a Pro feature.
  • Your item list, with width, height and depth for every distinct item type, plus the count.
  • Risk data for the dangerous items: riskTypes (integer codes) and riskPoints (a number).
  • Your container specification: width, height, depth, count, and optionally a maximum load weight and allowedRiskPoints.
  • Your segregation rule, expressed as pairs of risk type codes that must not share a container. These go into the risks array.

Two things to keep in mind from the start:

  • Every request gets a 240 second solver budget. The solver returns one heuristically optimised plan for that request; if your loading list changes, you send a new request.
  • Width, height and depth map to x, y and z. Keep the same axis convention across items and containers, or the geometry will not mean what you think it means.

The API is a JSON REST interface at https://3dpacker.rsj.de. If you prefer clicking to typing, the browser application on the landing page uses the same engine and shows the result in an interactive 3D view.

Step 1: Define Your Containers and Their Risk Limits

Start with the box everything has to fit into. Dimensions and count are required for containers; weight (maximum load) and allowedRiskPoints are optional.

allowedRiskPoints is the cap on the sum of risk points of everything you load into that container. It is the number that decides whether a container is allowed to carry this particular mix.

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

If all your containers are identical, one entry with count: 3 is enough. If you work with different container sizes, list each size separately — that is a Standard or Pro capability.

Step 2: Describe Your Items, Including Risk Types and Risk Points

For every distinct item type you give width, height, depth and count (count defaults to one if you omit it). General cargo needs nothing else.

Dangerous goods additionally carry:

  • riskTypes: an integer array, one or more codes that categorise the hazard.
  • riskPoints: a number quantifying how much hazard the item contributes to the container total.
  • itemClass: an integer used for stacking. An item is only ever placed on items of a lower or equal class, so heavier or fragile goods stay near the floor.
  • vertical: set to false when an item must not be rotated out of its upright position.
  • weight: the item’s own weight.
  • id: an optional identifier of your choosing, which comes back in the response so you can map packed items to your own SKUs.
{
  "items": [
    { "id": "std-carton", "width": 11, "height": 6, "depth": 6, "count": 51 },
    {
      "id": "upright-drum",
      "width": 7,
      "height": 8,
      "depth": 9,
      "count": 53,
      "vertical": false,
      "itemClass": 1,
      "weight": 12
    },
    {
      "id": "haz-aerosol",
      "width": 8,
      "height": 9,
      "depth": 10,
      "count": 57,
      "riskTypes": [1, 2],
      "riskPoints": 10
    }
  ]
}

An item may carry several risk types at once — that is normal for a substance that is flammable and something else. Each type you list participates in the segregation rules you declare in the next step.

Step 3: Declare Incompatible Risk Type Pairs

This is the part most manual planners get wrong, because it is invisible in the geometry: two items can fit perfectly next to each other and still must not travel in the same container.

The risks array takes pairs of risk type codes. Every pair you list is a combination the solver must not place in the same container.

{
  "risks": [
    { "type1": 1, "type2": 2 },
    { "type1": 2, "type2": 5 },
    { "type1": 3, "type2": 3 }
  ]
}

risks is optional in the request, but if you have dangerous goods in the load, this array is your safety rule. Declare every pair your regulations or your own policy forbid together — the solver only knows the pairs you hand it. When segregation is required, it will spread the affected items across the available containers rather than forcing them into one.

Step 4: Submit the Packing Request

Combine the three blocks into one body and post it to /solve. You need a session token first. Log in and call:

GET /user/{email}?hmac={hmac}

The response contains your user record and a session value. Send that on every call:

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

Your load.json is the merged request:

{
  "containers": [
    { "width": 48, "height": 47, "depth": 46, "count": 3, "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 }]
}

A few practical notes:

  • Sessions are valid for roughly a day — fetch a fresh one instead of storing it. The browser application authenticates with cookies, which is what the API sandbox at https://3dpacker.rsj.de/3dapi.html relies on.
  • Unknown keys in the request objects are ignored, so you can let your own metadata travel along in the body. Namespace those keys anyway, in case a future field collides with one of them.
  • The solver runs for up to 240 seconds on this request and returns a heuristically optimised plan. That budget applies to every request on every plan.
  • The full field reference is published as an OpenAPI 3.0 document at https://3dpacker.rsj.de/static/openapi.yaml and rendered at https://3dpacker.rsj.de/3ddocs.html.

Step 5: Read the Plan and Check It Against Your Limits

The response tells you what was packed, where, and what did not make it.

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

How to read it:

  • packedItems is the actual plan. Each entry has the container index c and the x, y, z position of the item corner. Every packed item is supported by the item below it — there are no floating items in the plan.
  • containers gives the fill percentage, how many containers the plan uses, and first, the index of the first packed item in that container.
  • unpackedItems lists what could not be placed, with counts.
  • items summarises per item type how many are still remaining.

The response also includes a viewer URL for an interactive 3D view of the result — the same viewer used on the landing page, which can be embedded in an IFRAME. If you want the geometry in another tool, the solution can be downloaded as a GLB 3D model.

How to Confirm the Plan Is Safe

Run these checks before anyone touches a pallet.

  1. Risk points per container. Sum riskPoints for the packedItems in each container and compare it to that container’s allowedRiskPoints. If a container exceeds it, the input was wrong — usually the same item type described twice with different risk values.
  2. No forbidden pair in one container. Group packed items by container, collect their risk types, and check against your risks list.
  3. Weight. Sum item weights per container and compare against the container weight.
  4. Nothing left behind. unpackedItems should be empty, or contain only items you deliberately left out.

A quick sanity check in Python, using the response body:

import json, collections

resp = json.load(open("solve-response.json"))
risk_points = {"0": 120, "1": 45}          # riskPoints per packed item id
by_container = collections.defaultdict(float)

for p in resp["packedItems"]:
    by_container[p["c"]] += risk_points.get(str(p["id"]), 0)

limits = {0: 1000, 1: 1000}                # allowedRiskPoints per container
for c, total in by_container.items():
    status = "ok" if total <= limits[c] else "over limit"
    print(f"container {c}: {total} risk points ({status})")

Then open the viewer URL and look at the load. The 3D view catches what numbers miss: a tall item in front of a door, a stack that looks top-heavy, an item class order that reads oddly in practice.

Troubleshooting

Items stay in unpackedItems. The most common cause is a limit that is too tight for the mix. If the remaining items are dangerous goods, allowedRiskPoints on the containers is usually the binding constraint; if they are heavy general cargo, it is weight. Raise the limit or add a container, then solve again.

The plan spreads the load over more containers than you expected. That is segregation at work. Items with risk types declared as incompatible cannot share a container, so the solver has to put them somewhere else. Adding containers usually reduces the count of used ones by giving the solver room to arrange.

A load that should be safe is flagged as incompatible. Re-check your risks pairs. Codes are integers, and a pair listed the wrong way round (type1/type2 swapped) is a different declaration for a human reader but still the same forbidden combination for the solver — the real risk is a missing pair, which simply is not enforced.

An item ended up rotated when it should not be. Set "vertical": false on that item. Conversely, if a fragile item is being placed too high, give it a higher itemClass so it can only sit on items of a lower or equal class.

Your item list changed mid-day. The solver answers the request it was given, so build a new request and solve again. The 240 second budget applies per request.

FAQ

What are risk types and risk points in RSJ 3D Packer? Risk types are integer codes that categorise the hazard of an item, for example flammable or corrosive. Risk points quantify how much hazard the item contributes. Containers have a maximum allowedRiskPoints, and the solver ensures the sum of risk points of packed items does not exceed that limit.

Can I pack dangerous goods together with general cargo in one container? Yes, as long as the combined risk points do not exceed the container’s allowedRiskPoints and no incompatible risk type pairs are loaded together. The solver will segregate incompatible items across containers if needed.

How does the solver handle incompatible risk types? You declare pairs of risk types that must not be loaded together in the risks array. The solver then ensures that items with those risk types are not placed in the same container, if possible.

What if I need a fixed packing order or unpacking order? The standard solver produces a static plan, meaning the items may be packed in any order. For dynamic problems like a fixed packing order or a required unpacking order, the algorithm can be adapted — contact RSJ for more information.

Conclusion

Packing dangerous goods into one container safe comes down to five inputs and one request: containers with a risk limit, items with risk types and risk points, your segregation pairs, a POST to /solve, and a check of the returned plan against those limits. The solver handles the geometry, the weight limits, the stacking classes and the segregation between risk types at the same time — the 240 second budget is spent searching for a plan that satisfies all of it together, not one constraint at a time.

RSJ 3D Packer is available as a cloud subscription, as an on-premises server for Windows 10/11 or Ubuntu Linux, or as a stand-alone program. The free 30-day test exposes the Pro feature set, which is what includes dangerous goods handling, so you can run your own mixed load through it before you decide anything.

Try RSJ 3D Packer on your next dangerous goods shipment: start the free test, or check plans and checkout if you already know it fits your operation.

Related posts

EU label: AI-generated content