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

Fix supertriangle calculation for tiny bounding boxes #175

Merged
merged 2 commits into from
May 2, 2024

Conversation

artem-ogre
Copy link
Owner

@artem-ogre artem-ogre commented May 2, 2024

Input to reproduce the issue (txt-file):

3 3
45802.2779561576462583616375923 169208.540894783218391239643097
45802.2779561576317064464092255 169208.540894783218391239643097
45802.2779561576462583616375923 169208.540894783247495070099831
0 1
1 2
0 2

Because of the rounding errors when calculating super-triangle vertex positions the resulting super-triangle does not contain all the vertices. As the result triangulation fails at inserting vertices with the exception:

terminate called after throwing an instance of 'std::runtime_error'
  what():  No triangle was found at position

Make sure radius is big enough.

  • for tiny bounding boxes: use 1.0 as the smallest radius
  • multiply radius by 2.0 for extra safety margin

@artem-ogre artem-ogre linked an issue May 2, 2024 that may be closed by this pull request
@artem-ogre artem-ogre merged commit 21fae3b into master May 2, 2024
3 checks passed
@artem-ogre artem-ogre deleted the 174-bugfix-supertri branch May 2, 2024 13:12
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.

Wrong super-triangle calculated for tiny bounding box
1 participant