4

Supposed you to want find out if an ellipsoid fully contains a convex shape. In the picture below I have drawn two situations. The left shape is overlapping with the ellipsoid, and the right shape is fully contained in it. enter image description here Using an algorithm like the GJK Expanding Polytope algorith (see e.g. 'Collision Detection in Interactive 3D Environments'), we can get a penetration depth vector, $\vec{d}$. Using the support function of the shape ($S$), and the ellipsoid ($E$), we can find the extreme points of the shape along the penetration depth vector. If S is fully contained, then $S_{max} < E_{max}$ and $S_{min} > E_{min}$, as is seen in the right-hand of the picture (in red), and where $S_{max} = s_S(\vec{d})$, $S_{min} = s_S(-\vec{d})$, and analogously for shape $E$.

I have drawn a 2D example for simplicity, but I'm mostly interested in the 3D case. I can't find anything wrong with this approach, but it would be quite slow for my needs. Unfortunately, I don't know the formal name of this kind of problem and could thus not find any other solutions that might have a better performance. It would be nice if any alternative approaches would work for general convex-shaped containers.

1 Answers1

1

You can call this the tightest enclosing ellipsoid.

For a point set, a solution was developed by Welzl. It is relatively easy for a sphere, and AFAIK arduous for an ellipsoid, as you have to solve some difficult intermediate subproblems (smallest ellipsoid containing 2 given points, 3 given points... up to 9 points on the border). These are not detailed in the original paper. Alternative methods are available, but none is simple.

Your case is even harder as you have shapes rather than points. An option could be to sample points on the outline of your object and fit the ellipsoid to those points, possibly with a safety margin.