I am working on a basic packing algorithm that treats all objects as rectangles. This is done by finding the shape's x-low, z-low, z-high, and x-high. Vertices of the rectangle are then formed at:
(x-low, z-low), (x-high, z-low), (z-low, z-high), (x-high, z-high).
This axes-aligned rectangle is considered the footprint of the shape for packing. My question becomes, how can the initial shape be rotated around its local y-axis to minimize the area of this bounding rectangle?
As to how I have started solving this problem, I first projected all vertices of the shape to the XZ plane (setting the y value to zero) and removed duplicates. From here, generate the convex hull of the projection, as these vertices decide the extremes. The problem simplifies from rotating a 3D shape to just rotating the convex hull. As to where I go from here is where I request your help.