Added support for any 3d shape, rather than just Box.
Added test cases.