{"id":13784523,"url":"https://github.com/mattatz/unity-triangulation2D","last_synced_at":"2025-05-11T19:33:18.463Z","repository":{"id":50495848,"uuid":"61874317","full_name":"mattatz/unity-triangulation2D","owner":"mattatz","description":"Ruppert's Delaunay Refinement Algorithm in Unity","archived":false,"fork":false,"pushed_at":"2016-09-10T09:59:16.000Z","size":3087,"stargazers_count":570,"open_issues_count":5,"forks_count":82,"subscribers_count":36,"default_branch":"master","last_synced_at":"2024-11-13T23:05:20.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mattatz.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}},"created_at":"2016-06-24T09:42:41.000Z","updated_at":"2024-11-07T11:55:28.000Z","dependencies_parsed_at":"2022-08-12T21:40:09.882Z","dependency_job_id":null,"html_url":"https://github.com/mattatz/unity-triangulation2D","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Funity-triangulation2D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Funity-triangulation2D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Funity-triangulation2D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Funity-triangulation2D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattatz","download_url":"https://codeload.github.com/mattatz/unity-triangulation2D/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225086633,"owners_count":17418768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-08-03T19:00:46.909Z","updated_at":"2024-11-17T20:32:03.318Z","avatar_url":"https://github.com/mattatz.png","language":"C#","readme":"unity-triangulation2D\n=====================\n\nDelaunay Triangulation and Ruppert's Delaunay Refinement Algorithm in Unity.\n\n\u003cimg src=\"https://raw.githubusercontent.com/mattatz/unity-triangulation2D/master/Captures/drawing.gif\" width=\"350px\"\u003e\n\nInput contour points for [planar straight-line graph](https://en.wikipedia.org/wiki/Planar_straight-line_graph)\n\n\u003cimg src=\"https://raw.githubusercontent.com/mattatz/unity-triangulation2D/master/Captures/input.png\" width=\"350px\"\u003e\n\nDelaunay Triangulation\n\n\u003cimg src=\"https://raw.githubusercontent.com/mattatz/unity-triangulation2D/master/Captures/delaunay_triangulation.png\" width=\"350px\"\u003e\n\nMesh Refinement with minimum angle α(22.5)\n\n\u003cimg src=\"https://raw.githubusercontent.com/mattatz/unity-triangulation2D/master/Captures/mesh_refinement.png\" width=\"350px\"\u003e\n\n## Usage\n\n```cs\n// input points for a polygon2D contor\nList\u003cVector2\u003e points = new List\u003cVector2\u003e();\n\n// Add Vector2 to points\npoints.Add(new Vector2(-2.5f, -2.5f));\npoints.Add(new Vector2(2.5f, -2.5f));\npoints.Add(new Vector2(4.5f, 2.5f));\npoints.Add(new Vector2(0.5f, 4.5f));\npoints.Add(new Vector2(-3.5f, 2.5f));\n\n// construct Polygon2D \nPolygon2D polygon = Polygon2D.Contour(points.ToArray());\n\n// construct Triangulation2D with Polygon2D and threshold angle (18f ~ 27f recommended)\nTriangulation2D triangulation = new Triangulation2D(polygon, 22.5f);\n\n// build a mesh from triangles in a Triangulation2D instance\nMesh mesh = triangulation.Build();\n// GetComponent\u003cMeshFilter\u003e().sharedMesh = mesh;\n```\n\n## Demo\n\n\u003cimg src=\"https://raw.githubusercontent.com/mattatz/unity-triangulation2D/master/Captures/demo.gif\" width=\"350px\"\u003e\n\n## Sources\n\n- Jim Ruppert. A Delaunay Refinement Algorithm for Quality 2-Dimensional Mesh Generation - http://www.cis.upenn.edu/~cis610/ruppert.pdf\n\n- Ruppert's algorithm - https://en.wikipedia.org/wiki/Ruppert%27s_algorithm\n\n- Ruppert's Delaunay Refinement Algorithm - https://www.cs.cmu.edu/~quake/tripaper/triangle3.html\n\n- Chapter 7.pdf - http://www.ti.inf.ethz.ch/ew/Lehre/CG13/lecture/Chapter%207.pdf\n\n","funding_links":[],"categories":["Builder"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattatz%2Funity-triangulation2D","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattatz%2Funity-triangulation2D","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattatz%2Funity-triangulation2D/lists"}