If the code for the main goal would require x lines (more or less easy as I said), the code for packing could require 10+ x lines since the objects are random (or should be) and you are in fact after some kind of sparse 3d Tetris … meaning that face to face isn’t a sufficient enough condition/rule.
Plus you’ll need an object generator (but that’s not nuclear science) - for instance a very fast C# that does classic voxels [as boxes] out of meshes or breps (I have a similar def, mind). Voxels (as Lists) are far better than a voxelized (so to speak) polysurface because you can move some in order to achieve better aesthetics or a more dense or sparse result (and obviouslly noboby could tell the difference).
On the other hand in real-life some interactive (on the fly) option should being provited: suspend the computer from doing things and modify interactively the current generation/state of the whole packing in order to achieve a better looking result (in plain English: “swap” volatile with persistent data per generation [impossible to do that without code]).
Believe it or not this could require a full day of coding (or maybe more if Karma is in short supply).