Do not join wrapped lines in comments
Add closest point on triangle function
Check faces and edges for closest point

Previously, only the vertices of convex hulls were used for distance calculations and nearest point computations. Now the triangles are used.

The faces of the foreground and background convex hulls are triangulated so that the creation of an array of triangles (by using the first 3 vertices of each face) from a hull results in an airtight mesh.
Remove unused variables