This question seems to have been asked before without an answer here and with a pointer to this answer, which, however, refers to intersections.
What would be the solution for meshes that just touch (or are closer than a certain distance)?
I am leaning towards brute force - find the two closest triangles, calculate the distance - but that seems way too computationally expensive.
For context - I am trying to tell what part modelled stitches are swen onto.