Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat TriMesh as solid in project_local_point_and_get_feature with dim2 #196

Conversation

wlinna
Copy link
Contributor

@wlinna wlinna commented May 1, 2024

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.

wlinna and others added 2 commits May 1, 2024 23:00
@sebcrozet sebcrozet merged commit dfa638c into dimforge:master May 2, 2024
5 checks passed
@sebcrozet
Copy link
Member

That makes sense. Thank you @wlinna for the fix and test cases!
And thank you @Ralith for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants