# How Do You Cut the Maximum Volume Cuboid from a General 3D Shape

3dalgorithmseuclidean-geometrygeometry

I would like to find a way to cut the maximum cuboid slab out of 3D crystalline structures. For example, say I have some 3D convex polyhedral shape, how would I go about finding the maximum cuboid that could be enclosed by that shape? With the extra limiting factor that the cuboid edges must be parallel to the x, y, z axes.

I am unaware of any algorithm for solving this problem in 2D or 3D.

Currently I am thinking of dividing the space into cubes and slowly expanding the cube surface in each direction around a central point until I can't expand anymore in each direction. Would this be an appropriate method?

Is there a general method I am unaware of? Ideally it should be possible to port the method to a computer. A 2D example of the 3D problem is given below:

Each point represents an atom in a crystal plane, and the blue rectangle represents and estimate of the maximum inscribable rectangle. Ideally I would like an algorithmic way to define the blue box. In 3D the blue box would be represented by a cuboid instead.