I've been thinking about an algorithm which fits a given polygon into a quad. I've stumbled upon this while trying to fit the largest possible polygon out of a set of different polygons into a quadliteral. What I want to find is the best-fit-polygon which can be contained completely in the quadliteral. The polygon and quad can be assumed to be convex. An nice feature would be to calculate the error as a function of the area which doesn't fit into the quad for every polygon I throw at the quad.

I'm working in 2D right now, but might want to expand the problem for a later application into a 3D case (fit a polyhedra into a hexahedron).

Any ideas how to solve this problem?