Signed distance errors/leaks

InVolume should be working (so that’s definitely always something to send). NearestPoint(Distance) has an unfortunate problem when certain types of edges or vertices are the “nearest” point. Since we are choosing 1 nearest point in this case but there are multiple faces and therefore multiple normals, it might choose a face that gives a different value than you expect in terms of sign.

NearestPointNormal.png

In this example, the shaded areas (pink & grey) are closest to the vertex ‘v1’. The areas in grey are fine if we sample there, since it is consistently “outside” of both edges. The areas in pink cannot be consistently determined inside or outside of the overall mesh since they are inside of one edge, but outside of the other. Therefore the NearestPoint(Distance) result should not be considered as an accurate measure of “inside” or “outside” unless your mesh is convex.