SVGnest is a library that allows to compute a packed layout using non regular shapes.
It looks very efficient, maybe one day it might come in handy.
Bin Packing
There’s also this library to compute bin packing (rectangles) in an efficient way.
Spotted a typo or (likely) a grammar error? Send a pull request.