Skip to content

delaunayRefine: guard against inserting a circumcenter coincident with an existing vertex#249

Open
designbynumbers wants to merge 1 commit into
nmwsharp:masterfrom
designbynumbers:fix/delaunayrefine-dup-246
Open

delaunayRefine: guard against inserting a circumcenter coincident with an existing vertex#249
designbynumbers wants to merge 1 commit into
nmwsharp:masterfrom
designbynumbers:fix/delaunayrefine-dup-246

Conversation

@designbynumbers
Copy link
Copy Markdown

Fix for #246.

Constrained delaunayRefine (edges fixed via setMarkedEdges) can trace a
circumcenter onto an existing vertex — it ends as a Face point on a triangle
corner — 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 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.

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.

…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
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.

constrained delaunayRefine inserts two circumcenters at the same point → zero-area triangle

1 participant