Fixes the issue in 2D where project_local_point_and_get_feature of TriMesh would NOT return a triangle enclosing the point. This can happen when two triangles share an edge and that edge is closest to the query point.
This can happen because project_local_point_and_get_feature does not treat TriMesh as solid. However, in 2D TriMeshes can be treated as solid.
This change introduced by this PR is a subtly breaking change, because earlier versions would project to one of the edges.
I think breaking this API "contract" is reasonable, because the earlier behavior was misleading, with the returned PointProjection telling that the point was not inside and the feature id being incorrect, and always being set to a Face variant anyway.
Fixes the issue in 2D where
project_local_point_and_get_feature
ofTriMesh
would NOT return a triangle enclosing the point. This can happen when two triangles share an edge and that edge is closest to the query point.This can happen because
project_local_point_and_get_feature
does not treatTriMesh
as solid. However, in 2D TriMeshes can be treated as solid.This change introduced by this PR is a subtly breaking change, because earlier versions would project to one of the edges. I think breaking this API "contract" is reasonable, because the earlier behavior was misleading, with the returned
PointProjection
telling that the point was not inside and the feature id being incorrect, and always being set to a Face variant anyway.