Minimum distance between subdivision bodies (source code)

= Minimum distance between subdivision bodies
{title2=$d(A,B)=\inf_{a\in A,b\in B}\|a-b\|$}

For disjoint compact bodies, the minimum occurs on their boundaries. Patch <bounding volumes> give certified lower bounds and evaluated limit-point pairs give upper bounds. A <branch and bound> search refines promising patch pairs until the global bounds differ by the tolerance. Boundary distance alone cannot detect containment; touching, crossing or nested solid bodies have ordinary set distance zero. Negative overlap values require an additional convention such as <translational penetration depth>.