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

Prevent potential floating-point accuracy issues in triangulation #133

Merged
merged 17 commits into from
Feb 5, 2022

Conversation

hannobraun
Copy link
Owner

This PR adds infrastructure to track the origin 3D points that surface points are converted from, making it possible to remove any conversions that could potentially introduce accuracy problems. See #78 for a wider context and discussion of the issue.

This infrastructure is added in the first few commits. Then follows a whole lot of refactoring, with the pay-off in the second-to-last commit, when the potentially problematic conversions are removed.

This new form might be a bit easier to read, and the duplication is
minimal. It also makes it a bit easier to add more targeted output
during debugging.
Due to floating-point accuracy issues, the conversion from 2D point back
into 3D points can result in 3D points that are slightly different than
the original points. This could lead to a triangle mesh that doesn't fit
together around face boundaries.

This change sidesteps that potential issue, by using the previously
stored original 3D point instead of doing the conversion.
@hannobraun hannobraun enabled auto-merge February 5, 2022 11:35
@hannobraun hannobraun merged commit 621ff19 into main Feb 5, 2022
@hannobraun hannobraun deleted the surface-point branch February 5, 2022 11:37
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.

1 participant