I have written an approximate algorithm for the case you describe i.e. 3D rectangular boxes, with orthogonal rotation, in C++.
You can find the results and algorithm in the published paper:
http://www.cs.ukzn.ac.za/publications/erick_dube_507-034.pdf