WIP: Fix hang when there are duplicate vertexes in ring#126
Closed
rijos wants to merge 83 commits into
Closed
Conversation
tyler-109 Refactor main to allow multiple formats
Add CityJSON and CityJSONSeq format outputs to tyler
Add ADR for Tyler v1 public surface
Add CLI format validation gate
…revent infinite loops in earcutr
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* We do an exact vertex match on purpose * instead of as usize, use try_from
…tive duplicates and maintain topology
…fix/earcuthang
Contributor
Author
|
Closed the pull request to create a new clean PR. |
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.
earcut 0.5.0 can hang when rings contain repeating vertices, the process will hang with 100% CPU utilization.
I've included a file with the invalid polygon rings, it contains the following duplicate vertices:
v12, v13 → (795.5322, 799.7379) ×2
v19, v20, v21 → (795.5322, 799.7379) ×3 (same point again)
v22, v23, v24, v25 → (779.4183, 813.6092) ×4 in a row at the tail
The code dedupe_polygon_rings reads the rings and simply skips the vertexes if the coordinate of the previous vertex is the same.
Small warning, I've used AI tooling for finding the bug and creating the tests. I'll be validating the results before removing the WIP tag.