I originally posted this in the VB forum as I am using VB6 code but was advised to re-post it here....

I want to be able to calculate the volume of a small rectangular block that is within a larger rectangular block.

I know the centroids of both blocks and the extent of the blocks in the x, y and z directions. The x,y,z axes of both blocks are parallel. For example, the extent of the large block is 15x, 20y, 12z and the extent of the small block is 4x, 3y, 3z.

I wonder if their is an efficient way to determine a) if the small block is completely within the large block or b) if the small block is partly within the large block. If b, then how to calculate the volume that part of the small block within the large block.
Thanks for any ideas.