Skip to content

Port upstream earcut changes to C# (b68b344) — 2026-06-29 #14

Description

@github-actions

Upstream Sync Task

@Copilot please port the upstream changes listed below to C# and open a pull request.

New commits have been pushed to mapbox/earcut since the last sync.

Previous synced commit: 018bcc1
New upstream commit: b68b344
Full diff: mapbox/earcut@018bcc1...b68b344

Upstream commits to port

  • b68b344 switch to radix sort for z-order hashing
  • 4560add simplify earcutLinked
  • e452ba0 simplify isEar / isEarHashed checks
  • da52dc0 slightly faster isValidDiagonal
  • f52d2f3 better filtering for pathological cases
  • 337e518 v3.1.0
  • f8356be Improve readme (#199)
  • 8593b2c fix and edge case with coincident holes, close #147 (#198)
  • 5996fff add a note on winding order, close #44 (#197)
  • 2cea508 add first-class types (#196)
  • 9048fef update readme
  • 11fd8c0 remove a few redundant checks
  • 72af66d add regression tests over MVT 120k polys fixture
  • 4def7cb fix a rare self-tangency issue
  • 7d71add fix correctness issue with block index
  • dfeb5de add an extensive MVT benchmark (120k polygons)
  • 414b2db fix hole point filtering + drop vertex skipping
  • 45cafa0 inline point in triangle checks in isEarHashed
  • 8f5c3f5 inline reflex check in earcutLinked (6% faster)
  • 0a76652 smaller node shape, cleanup
  • f0a5baa more steiner field from node shape
  • d7bd0c5 fix a correctness issue with block index
  • 1363b26 microoptimizations
  • 1c38eef switch to flat quicksort for z-order indexing
  • e173c18 optimize diagonal search
  • fa4b50a speed up hole bridge triangle scan with block index
  • 526aefd speed up hole bridge raycast with block index
  • de94f53 minor updates
  • 962024e upgrade dev deps

What to port

Please port all upstream changes to C# and open a pull request. Follow the PORTING_GUIDE.md for language mapping conventions.

Key files to check in the upstream diff:

  • src/earcut.js → port any algorithm changes to src/Earcut/Earcut.cs
  • test/fixtures/*.json → copy any new/changed fixtures to test/Earcut.Tests/fixtures/
  • test/expected.json → update test/Earcut.Tests/expected.json to match

After porting:

  1. Run dotnet test and ensure all tests pass
  2. Update PORTING_GUIDE.md if new language patterns were introduced

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-syncAutomatically generated upstream sync issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions