Tetrahedral remeshing: Give up on a flip as soon as its angles stop improving - #9592
Open
IasonManolas wants to merge 1 commit into
Open
Tetrahedral remeshing: Give up on a flip as soon as its angles stop improving#9592IasonManolas wants to merge 1 commit into
IasonManolas wants to merge 1 commit into
Conversation
…mproving find_best_flip_to_improve_dh() tracks the worst dihedral-angle cosine seen so far for a candidate flip vertex, and only keeps the vertex if that worst angle beats the edge's current one. The running worst angle only ever grows as more cells are scanned, so once it reaches the edge's current worst angle the vertex is already disqualified and the remaining cells don't need scanning. The early exit is skipped when the edge's cells are inverted, since that path accepts the candidate regardless of the angle comparison.
janetournois
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
find_best_flip_to_improve_dh()searches, for each candidate flip vertex, over the cells theflip would produce, tracking the worst dihedral-angle cosine seen so far. A vertex is only kept
if that worst angle is better than the edge's current worst angle. The search does not stop once
a candidate can no longer win: it keeps scanning the remaining cells and comparing angles that
can only make its worst-case value grow, never shrink.
Once the re running worst angle for a candidate vertexaches the edge's current worst angle, that
vertex is already disqualified (worse case can only stay the same or grow from there), so the
loop can stop scanning it right there instead of finishing the remaining cells. The same pattern
appears twice: once for each of the two symmetric flip-direction loops in this function.
The well-oriented/inverted-cells exception is preserved: for a candidate whose cells are inverted
(not well-oriented), the running worst angle is not a valid signal to reject on, so the early exit
only fires when
is_sliver_well_orientedis true.Testing
Verdict equivalence. The early exit stops scanning a vertex only after it is already
guaranteed to be rejected by the existing "is this vertex worth keeping" test, so it changes when
the loop stops, not what any candidate's outcome is. Full test suite (all executables in
test/Tetrahedral_remeshing) passes.Byte-identical output, against plain
cgal/main:Performance.
perf stat -e instructions, Linux, Release, sequential, against plaincgal/main.cgal/maininstrRelease Management