delaunayRefine: guard against inserting a circumcenter coincident with an existing vertex#249
Open
designbynumbers wants to merge 1 commit into
Open
Conversation
…ng vertex Constrained delaunayRefine (edges fixed via setMarkedEdges) could trace a circumcenter onto an existing vertex -- it ends as a Face point on a triangle corner -- creating a zero-area "needle" triangle that poisons downstream cotan-Laplacian / BFF solves. After insertVertex, if the new vertex has a near-zero incident edge (minInc <= 1e-9 * maxInc) it landed on existing geometry: undo the insertion and return Vertex(). delaunayRefine already treats a Vertex() return as "insertion failed" and continues, leaving the unrefinable constrained corner as a healthy (non-degenerate) triangle. Upstream report: nmwsharp#246
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.
Fix for #246.
Constrained
delaunayRefine(edges fixed viasetMarkedEdges) can trace acircumcenter onto an existing vertex — it ends as a
Facepoint on a trianglecorner — producing a zero-area "needle" triangle (min angle 0°, ~1e-9 edge)
that then poisons downstream cotan-Laplacian / BFF solves. The same mesh and
metric refine cleanly to the angle bound when no interior edges are marked, so
only the segment-constrained path hits it.
This adds a proximity guard in
IntrinsicTriangulation::insertCircumcenter:after
insertVertex, if the new vertex has a near-zero incident edge(
minInc <= 1e-9 * maxInc) it landed on existing geometry, so undo theinsertion and return
Vertex().delaunayRefinealready treats aVertex()return as "insertion failed" and continues, leaving the unrefinable constrained
corner as a healthy (non-degenerate) triangle.
On the reproducer in #246 (stock build, otherwise unchanged): constrained refine
0° → 4.21°, no degeneracy, deterministic; the unmarked control on the
identical mesh is unchanged at 25.12°.
Full analysis + runnable reproducer: #246.
Fixes #246.