alt.hn

12/27/2025 at 8:21:24 AM

Simple 3D Packing

https://github.com/Vrroom/psacking

by matroid

12/27/2025 at 8:21:24 AM

A while back, I implemented a paper that had showed up on HN for a course project (Dense, Interlocking-Free and Scalable Spectral Packing of Generic 3D Objects).

Over the holidays, I cleaned up the implementation (with the help of Claude Code, although this is not an advertisement for it) and released it on GitHub.

If anyone needs fast 3D packing in python, do give this a shot. Hopefully I have attributed all the code/ideas I have used from elsewhere properly (if not, please feel free to let me know).

by matroid

12/27/2025 at 5:03:24 PM

The problem sounds very interesting and a complex one to solve. Could give examples of use cases where dense 3d packing is needed? (Say, besides literal packing of physical objects in a box? )

by jukea

12/27/2025 at 7:50:55 PM

The main one I could think of was maximising 3D printer utilisation, I.e if filling your print volume was something you wanted to optimise for.

by phil-martin

12/27/2025 at 8:18:08 PM

> Could give examples of use cases where dense 3d packing is needed? (Say, besides literal packing of physical objects in a box? )

Not an answer, but something interesting on this topic:

In a warehouse/distribution center, a dense packing result can be too time consuming for most consumer products. As density increases, it takes the human longer to find their own solution rapidly that works. You can provide instructions but that is even slower than the human just doing their best via trial and error.

We had to dial back our settings from about a 95% volume consumption percent (initial naive setting) down to about 80% before they could rapidly fill the cartons. Basically it's balancing cost of labor vs capacity of system during peak (conveyor would start backing up) vs shipping costs.

by RaftPeople

1/1/2026 at 9:51:20 PM

Bin packing can be seen as an optimization problem. In 2D, consider a scenario where you need to cut shapes from a sheet of plywood or sheet metal while minimizing waste; finding the optimal orientation of these shapes reduces material loss. In 3D, you might imagine packing objects into a container or cargo space, or sculpting a collection of 3D shapes out of a known volume of material, where you'd optimize the arrangement and orientation to minimize waste.

by jordanarseno

1/1/2026 at 8:31:28 PM

Much too hard to find the original paper: https://dl.acm.org/doi/epdf/10.1145/3592126

One question I have, is when we say "interlocking-free", does this mean that the algorithm can still densely stack cups (with a draft angle), or is it instead guaranteeing that the convex hull of shapes are non-interfering?

by avidiax

1/2/2026 at 5:38:19 AM

Thanks. I'll link it in the first line in the README. I think the interlocking-free part can pack cups like you suggest. They propose a flood fill algorithm which computes all the reachable places for the voxelized shape. It doesn't put assumptions on convexity. I think it would be a great example to try it out on though.

by matroid

1/1/2026 at 11:37:14 PM

Interesting, this is the first time I've come across using a FFT for collision detection, and now that I think about it it really makes sense. Thanks for the insight!

by Koffiepoeder

1/1/2026 at 9:45:37 PM

I'm old enough to remember when 2D packing was considered a hard problem.

by hermitcrab

1/1/2026 at 10:26:19 PM

2d packing is still a hard problem

by Jarmsy