{"id":45079319,"url":"https://github.com/michaco/earcut","last_synced_at":"2026-02-23T18:02:38.304Z","repository":{"id":339090326,"uuid":"1160271660","full_name":"MichaCo/Earcut","owner":"MichaCo","description":"Fast and robust ear-clipping polygon triangulation library for .NET 8+.","archived":false,"fork":false,"pushed_at":"2026-02-19T12:47:49.000Z","size":158,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-20T17:43:11.944Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MichaCo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-17T18:39:10.000Z","updated_at":"2026-02-19T12:47:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MichaCo/Earcut","commit_stats":null,"previous_names":["michaco/earcut"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/MichaCo/Earcut","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaCo%2FEarcut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaCo%2FEarcut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaCo%2FEarcut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaCo%2FEarcut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaCo","download_url":"https://codeload.github.com/MichaCo/Earcut/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaCo%2FEarcut/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29685018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-19T14:12:44.520Z","updated_at":"2026-02-21T16:00:54.464Z","avatar_url":"https://github.com/MichaCo.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Earcut.NET\n\n[![Build](https://github.com/MichaCo/Earcut/actions/workflows/ci-cd.yml/badge.svg?branch=main)](https://github.com/MichaCo/Earcut/actions/workflows/ci-cd.yml)\n[![NuGet](https://img.shields.io/nuget/v/Earcut.NET.svg)](https://www.nuget.org/packages/Earcut.NET)\n\nA C# port of the [mapbox/earcut](https://github.com/mapbox/earcut) polygon triangulation library.\n\n\u003e **Note:** This is a 100% AI-driven port, created entirely by AI agents to demonstrate modern .NET development practices.\n\nFast and robust ear-clipping polygon triangulation library for .NET 8+.\n\n## Features\n\n- Fast polygon triangulation using ear-clipping algorithm\n- Supports holes\n- Zero-order curve spatial indexing for performance\n- Modern C# implementation with .NET 8+ optimizations\n- Uses ReadOnlySpan for zero-copy performance\n\n## Installation\n\n```\ndotnet add package Earcut.NET\n```\n\n## Usage\n\n```csharp\nusing EarcutDotNet;\n\n// Simple triangle polygon (3 vertices)\ndouble[] coords = [0, 0, 1, 0, 0.5, 1];\nvar triangles = Earcut.Triangulate(coords);\n// triangles: [1, 0, 2] — indices into coords (each vertex is x,y pair)\n\n// Square polygon (4 vertices) — produces 2 triangles\ndouble[] square = [0, 0, 1, 0, 1, 1, 0, 1];\nvar squareTriangles = Earcut.Triangulate(square);\n// squareTriangles: [3, 0, 1, 3, 1, 2]\n\n// Polygon with a hole\ndouble[] polyWithHole = [\n    0, 0, 10, 0, 10, 10, 0, 10,   // outer ring (4 vertices)\n    2, 2, 2, 8,  8,  8, 8,  2,    // hole ring  (4 vertices, starting at vertex index 4)\n];\nint[] holeIndices = [4]; // hole starts at vertex index 4\nvar result = Earcut.Triangulate(polyWithHole, holeIndices);\n\n// Optional: verify triangulation quality (deviation should be close to 0)\ndouble deviation = Earcut.Deviation(polyWithHole, holeIndices, 2, result.ToArray());\n```\n\n### 3D coordinates\n\nPass `dim: 3` when your data contains x, y, z per vertex (only x and y are used for triangulation):\n\n```csharp\nusing EarcutDotNet;\n\ndouble[] coords3d = [0, 0, 1,  1, 0, 0,  0.5, 1, 0]; // x,y,z per vertex\nvar triangles = Earcut.Triangulate(coords3d, dim: 3);\n```\n\n## Building\n\n```bash\ndotnet build\n```\n\n## Testing\n\n```bash\ndotnet test\n```\n\n## Benchmarking\n\n```bash\ndotnet run -c Release --project bench/Earcut.Benchmarks\n```\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaco%2Fearcut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaco%2Fearcut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaco%2Fearcut/lists"}