Signed distance errors/leaks

For both InVolume and NearestPoint(Distance), I’m getting bad results from certain meshes. Some vertices are reporting they are in the mesh (or have negative distance) when they are actually far away.

Is this something we should consider a known risk, or should we send in these cases for review?

Cases please!
I have seen intersectRay missing a dense mesh, so there is certainly room for improvements.

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.