Skip to content

Prevent the merge vertex fixup during error recovery from placing the… - #966

Merged
nical merged 1 commit into
mainfrom
issue-963
Sep 6, 2026
Merged

nical merged 1 commit into
mainfrom
issue-963

Conversation

@nical

@nical nical commented Sep 6, 2026

Copy link
Copy Markdown
Owner

… merge vertex outside of the shape

The test case provided in issue 963 triggered the error recorvery path which sorts all acitve edges. After the sort there is a fixup pass for merge vertices which swaps them with the previous edge if the merge vertex is outside of the shape (working under the over-simplified assumption that if the merge vertex is outside, then the previous edge is the in-out boundary). However if the previous edge was the result of fusing two overlapping edges with opposite windings, that edge would have zero-winding and would therefore not be the boundary, leaving the merge vertex outside of the shape, still. The fix is to search for the closest edge that is inside of the shape instead of blindly picking the previous one. If none is found on the left, then search on the right side. It is still technically possible that all active edges have zero-winding, which means that there is nowhere to put the merge vertex. That case seems pretty difficult to construct, and there isn't much that can be done in this case.

Fixes #963.

… merge vertex outside of the shape

The test case provided in issue 963 triggered the error recorvery path which sorts all acitve edges. After the sort there is a fixup pass for merge vertices which swaps them with the previous edge if the merge vertex is outside of the shape (working under the over-simplified assumption that if the merge vertex is outside, then the previous edge is the in-out boundary). However if the previous edge was the result of fusing two overlapping edges with opposite windings, that edge would have zero-winding and would therefore not be the boundary, leaving the merge vertex outside of the shape, still. The fix is to search for the closest edge that is inside of the shape instead of blindly picking the previous one. If none is found on the left, then search on the right side. It is still technically possible that all active edges have zero-winding, which means that there is nowhere to put the merge vertex. That case seems pretty difficult to construct, and there isn't much that can be done in this case.
@nical
nical merged commit 1dadf05 into main Sep 6, 2026
3 checks passed
@nical
nical deleted the issue-963 branch September 6, 2026 20:18
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.

FillTessellator debug assert firing on a path with big coordinates

1 participant