Skip to content

Fix Tessellation error for holes that share the same leftmost vertex with an outer ring vertex#15700

Open
roblburris wants to merge 4 commits intoapache:mainfrom
roblburris:fix-tessellation-error-many-holes
Open

Fix Tessellation error for holes that share the same leftmost vertex with an outer ring vertex#15700
roblburris wants to merge 4 commits intoapache:mainfrom
roblburris:fix-tessellation-error-many-holes

Conversation

@roblburris
Copy link

@roblburris roblburris commented Feb 11, 2026

Description

Apologies in advance if this is garbage, but I had Claude make an attempt at fixing the Tessellation error for the geometry in #15695:

When holes are eliminated left-to-right, splitPolygon creates copies of bridge endpoints in the ring. If multiple holes share the same leftmost vertex, the ring accumulates multiple copies of that vertex (all with the same idx). The angle-based getSharedInsideVertex tiebreaker could select the wrong copy when merging subsequent holes, producing a malformed ring that fails ear-clipping.

This is fixed by taking the first match in ring order from outerNode for leftmost shared vertices instead of using the angle-based tiebreaker. When multiple copies exist, outerNode is updated to the bridge position so subsequent holes start scanning from the correct place.

All tests pass including a new one for the geometry linked in #15695. The description of the problem and fix seem correct but I'll defer to people more familiar with the nuances of Tessellator to verify this 😄

@roblburris roblburris changed the title fix: Tessellation error for holes that share the same leftmost vertex with an outer ring vertex Fix Tessellation error for holes that share the same leftmost vertex with an outer ring vertex Feb 11, 2026
@github-actions github-actions bot added this to the 10.4.0 milestone Feb 11, 2026
@roblburris roblburris marked this pull request as ready for review February 11, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant