How to Pack Dangerous Goods With Risk Points in One Container
Thirty cartons of an aerosol with risk type 1, twenty boxes of a solvent-based product with risk type 2, and forty units of plain packaging material. The container is 120 × 100 × 110 cm and there is physical room for everything. The question that actually decides the shipment is a different one: may these goods travel together — and if they may, where exactly does each carton sit?
That question is rarely answered well by eyeballing a loading list. Three constraints decide it:
- Risk types — what kind of hazard an item carries, as integer codes you assign.
- Risk points — how much hazard one unit carries, as a number.
- Incompatible pairs — pairs of risk types that must never be loaded together, regardless of quantity.
Notice that none of these are geometry. A load can fit perfectly and still be a bad load. And notice that the answer is not a bare yes or no: a usable answer is a concrete plan — every item at a specific x/y/z position inside a specific container, with the leftovers counted. RSJ 3D Packer produces exactly that in a single solve, and shows it in an interactive 3D view you can inspect before anyone touches a pallet.
A simple analogy: risk points are a hazard budget for the container
Think of the container as having a hazard budget instead of just a volume. Every dangerous item costs points when it goes in, and the container has a maximum it can afford — allowedRiskPoints.
- A unit with
riskPoints: 10costs 10. - Thirty such units cost 300.
- If the container’s
allowedRiskPointsis 500, you can afford 50 of them at most, no matter how much empty air is left.
Risk types behave like incompatible ingredients. Flour and water share a bowl happily; bleach and ammonia do not, and no smaller quantity fixes it. Declaring a pair in risks says: these two types must not end up in the same container, full stop.
Stacking classes work like shelf levels. An item is only ever placed on items of a lower or equal itemClass. Heavy, stable goods go low; fragile or top-loaded goods carry a higher class and never end up underneath something that outranks them.
The analogy explains the outcome people find most surprising: a plan can come back with items unpacked while the container is visibly half empty. Volume was never the binding constraint — the hazard budget or a forbidden pair was.
How it works under the hood: from risk fields to a packed plan
The solver needs very little from you, and all of it is explicit:
- Each item may carry
riskTypes(integer array) andriskPoints(number), pluscount,width,height,depth, and optionallyweight,itemClassandvertical. - Each container may carry
allowedRiskPoints, pluswidth,height,depth,countand optionally a maximumweight. - The optional
risksarray declares pairs of risk types that must not be loaded together.
Those fields go into a solver whose core is a neural network optimised through neuro-evolution, working within a 240 second time budget per request on every plan. It solves the static problem: items may be packed in any order, which is what you want when the plan is made before the truck arrives.
The result is a full description of the load: packed items with a container index and an x/y/z position, fill percentage per container, the number of containers used, unpacked items with counts, a viewer URL and an API sandbox URL. Every packed item is supported by the item below it — there are no floating items in the plan — and the solution can be downloaded as a GLB 3D model for review outside the browser.
If the general concept of bin packing is new to you, the plain-language introduction at What Is 3D Bin Packing? covers the geometry side. This article stays on the hazard side.
Why it matters — and three common misconceptions
Getting this wrong is not a matter of a slightly worse fill rate. A plan that ignores risk constraints is a plan you cannot ship.
Misconception 1: “If it fits geometrically, it’s fine.” Geometry is one of four constraint families here, alongside risk points, incompatible pairs and stacking order. A geometrically perfect arrangement where two declared-incompatible types share a container is simply not a valid load.
Misconception 2: “Risk points are per item type.”
They are per item. Fifty-seven units of an item with riskPoints: 10 are 570 points against the container’s allowedRiskPoints — not 10. This is where naive spreadsheets go wrong: the per-unit value looks harmless, and the aggregate silently exceeds the budget. The solver has to decide how many units can go in, not just whether the product family is allowed.
Misconception 3: “You can rotate anything.”
Setting vertical: false on an item prevents rotation out of its upright position. That changes both what fits and what can be stacked on top, and it is exactly the kind of constraint that makes a hand-made plan fall apart at the loading bay.
Dangerous goods features — risk types and risk points — are part of the Pro plan. Every plan can be tested free for 30 days, and the free test exposes the Pro feature set, so you can run your own mixed load through it before deciding anything.
Step by step: packing dangerous goods with RSJ 3D Packer
The managed application is the one-step path. No protocol handling, no client to build.
Step 1 — Open the application and start the free test.
Go to 3dpacker.rsj.de and start the free trial. You get the Pro feature set for 30 days, which is what you need for risk fields.
Step 2 — Describe the container.
Width, height, depth and count. Add allowedRiskPoints, and a maximum weight if the container has a load limit. One container is enough for this example; multiple bins are covered in How to Pack Items of Different Sizes Into Multiple Containers.
Step 3 — Describe each item.
Count, dimensions, and — for the hazardous ones — riskTypes and riskPoints. Use vertical: false for anything that must stay upright, and itemClass to control what may be stacked on what.
Step 4 — Declare the incompatible pairs.
In the risks list, for example type1: 1 and type2: 2.
Step 5 — Solve and inspect. Run the solve, open the interactive 3D view, check fill percentage and used containers, look at any unpacked items, and download the GLB model if you need to circulate the result.
For reference, this is the payload the application builds for the example at the top of this article:
{
"containers": [
{ "width": 120, "height": 100, "depth": 110, "count": 1,
"weight": 24000, "allowedRiskPoints": 500 }
],
"items": [
{ "width": 40, "height": 30, "depth": 30, "count": 30,
"riskTypes": [1], "riskPoints": 10, "itemClass": 2, "weight": 15 },
{ "width": 50, "height": 40, "depth": 40, "count": 20,
"riskTypes": [2], "riskPoints": 5, "vertical": false, "itemClass": 1, "weight": 25 },
{ "width": 30, "height": 20, "depth": 20, "count": 40,
"itemClass": 1, "weight": 5 }
],
"risks": [{ "type1": 1, "type2": 2 }]
}
Background only: the same solve is available as a JSON REST call to POST /solve, described in the API reference, the OpenAPI specification and the live sandbox. That is the hard way — useful when you are wiring the solver into an order management system, unnecessary when you just want a plan today.
What the result tells you about your dangerous goods load
Read the response in this order and you will know what happened.
packedItems — each entry has an id, a container index c, dimensions and an x/y/z position. This is your answer to “where does the risky item sit”, and it is the part a spreadsheet cannot give you.
containers — used and filled tell you how much of the container you actually consumed. A fill percentage well below 100 on a load that still left items behind is the signature of a hazard budget or an incompatible pair doing the blocking, not geometry.
unpackedItems — item ids with count. If hazardous units remain, this is the number you need for the split shipment conversation.
Viewer and sandbox URLs — the viewer is embeddable in an IFRAME, so the 3D result can be shared with a colleague or a customer; the sandbox URL lets you reproduce the exact request. A sample packing solution shows what the viewer looks like.
If you save the response as a file, a quick local check is often faster than clicking through a UI:
jq '{filled: .containers[0].filled,
used: .containers[0].used,
packed: (.packedItems | length),
unpacked: [.unpackedItems[] | {id, count}]}' response.json
That gives you fill percentage, container count, how many items were placed, and precisely which items were not — the three facts you need to decide whether to ship, re-split, or re-specify the load.
FAQ
Are risk points counted per item or per item type?
Per item. Each item entry carries its own riskPoints value, and the container has an allowedRiskPoints maximum. If you have 57 units of an item with riskPoints: 10, that is 570 risk points against the container’s limit, so the solver must decide how many can go in.
What happens if I declare two risk types as incompatible?
The optional risks array lists pairs of risk types that must not be loaded together. When you declare such a pair, the solver will not place items of those two types in the same container, even if there is physical space.
Can dangerous goods be rotated in the container?
Only if you allow it. By default an item may be rotated, but setting vertical to false prevents rotation out of its upright position. This is useful for items that must stay upright for safety or handling reasons.
Which plan do I need to pack dangerous goods with risk points?
Dangerous goods features — risk types and risk points — are available on the Pro plan. Every plan can be tested free for 30 days, and the free test exposes the Pro feature set, so you can try it before subscribing.
Conclusion
Packing dangerous goods into one container is a budget problem wearing a geometry costume. Risk points spend a hazard budget, risk types obey an incompatibility list, and stacking classes decide what may sit on what — and only after all three are satisfied does the fill rate matter. Handing that to a spreadsheet is how you end up with a plan that fits beautifully and ships illegally.
RSJ 3D Packer takes the risk fields as input and returns a full three-dimensional plan: positions, fill percentages, unpacked counts, a viewer you can embed and a GLB model you can download. Start the free 30-day test with the Pro feature set, run your own mixed load through it, and see what your hazard budget actually allows.
Related posts
- Automate Container Load Planning With a REST API
- How to Pack Items of Different Sizes Into Multiple Containers
- Container Loading Software for Freight Forwarders