Better flip-check criterion for almost degenerate face removal #8743
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of Changes
While trying to remove caps,
PMP::remove_almost_degenerate_faces()
does a Delaunay-like check before allowing the edge flip. Unfortunately, the current criterion (see #7125) can prevent some edge flips that would resolve a cap because sometimes this Delaunay-like criterion can prefer a cap if it is balanced by a very small angle on the other side. Then you have alpha + beta < 180 and you're stuck with the cap, but maybe you would have liked to flip still because the largest angles created by a flip would be e.g. 120 and 120, which is not that bad.However in this function, we are maybe not so interested in having nicely shaped elements as much as we are trying to remove the worst elements. So this PR tries to improve the worst cap angle instead, by checking only (and greedily) if we do not create a worse cap angle when we flip.
This produces better results for the cases that were problematic with alpha + beta < 180
1
2
3
Release Management
PMP