Skip to content

WIP: Fix hang when there are duplicate vertexes in ring#126

Closed
rijos wants to merge 83 commits into
3DGI:masterfrom
rijos:fix/earcuthang
Closed

WIP: Fix hang when there are duplicate vertexes in ring#126
rijos wants to merge 83 commits into
3DGI:masterfrom
rijos:fix/earcuthang

Conversation

@rijos

@rijos rijos commented May 18, 2026

Copy link
Copy Markdown
Contributor

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.

balazsdukai and others added 29 commits May 4, 2026 16:29
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
@rijos rijos changed the title WIP: Fix cargo format errors WIP: Fix hang when there are duplicate vertexes in ring May 18, 2026
balazsdukai and others added 28 commits May 21, 2026 09:52
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
@rijos rijos closed this May 21, 2026
@rijos

rijos commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

Closed the pull request to create a new clean PR.

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.

3 participants