{"id":18299427,"url":"https://github.com/jankozik/delaunator_cpp","last_synced_at":"2025-04-05T13:34:52.230Z","repository":{"id":181249120,"uuid":"646072218","full_name":"jankozik/delaunator_cpp","owner":"jankozik","description":"A really fast C++ library for Delaunay triangulation of 2D points","archived":false,"fork":false,"pushed_at":"2023-07-14T15:53:38.000Z","size":2335,"stargazers_count":27,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-07-14T16:57:31.174Z","etag":null,"topics":["2d","algorithm","computational-geometry","cpp","delaunay","mapbox","triangulation"],"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/jankozik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-27T07:35:37.000Z","updated_at":"2023-07-14T16:57:34.047Z","dependencies_parsed_at":"2023-07-14T17:07:35.085Z","dependency_job_id":null,"html_url":"https://github.com/jankozik/delaunator_cpp","commit_stats":null,"previous_names":["jankozik/delaunator_cpp"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankozik%2Fdelaunator_cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankozik%2Fdelaunator_cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankozik%2Fdelaunator_cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankozik%2Fdelaunator_cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jankozik","download_url":"https://codeload.github.com/jankozik/delaunator_cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223192592,"owners_count":17103564,"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":["2d","algorithm","computational-geometry","cpp","delaunay","mapbox","triangulation"],"created_at":"2024-11-05T15:09:02.182Z","updated_at":"2024-11-05T15:09:03.176Z","avatar_url":"https://github.com/jankozik.png","language":"C++","readme":"# delaunator-cpp\n\nA really fast C++ library for\n[Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) of 2D points.\n\ndelaunator-cpp is a C++ port from https://github.com/mapbox/delaunator a JavaScript implementation of very fast 2D Delaunay algorithm.\n\n## Features\n\n* Probably the fastest C++ open source 2D Delaunay implementation\n* Example showing triangulation of GeoJson points\n\n## Usage\n\n`examples/basic.cpp`\n\n```CPP\n#include \u003cdelaunator.hpp\u003e\n#include \u003ccstdio\u003e\n\nint main() {\n    /* x0, y0, x1, y1, ... */\n    std::vector\u003cdouble\u003e coords = {-1, 1, 1, 1, 1, -1, -1, -1};\n\n    //triangulation happens here\n    delaunator::Delaunator d(coords);\n\n    for(std::size_t i = 0; i \u003c d.triangles.size(); i+=3) {\n        printf(\n            \"Triangle points: [[%f, %f], [%f, %f], [%f, %f]]\\n\",\n            d.coords[2 * d.triangles[i]],        //tx0\n            d.coords[2 * d.triangles[i] + 1],    //ty0\n            d.coords[2 * d.triangles[i + 1]],    //tx1\n            d.coords[2 * d.triangles[i + 1] + 1],//ty1\n            d.coords[2 * d.triangles[i + 2]],    //tx2\n            d.coords[2 * d.triangles[i + 2] + 1] //ty2\n        );\n    }\n}\n```\n\n[See more examples here](./examples)\n\n## Benchmarks\n\n```\nRun on (4 X 2300 MHz CPU s)\n2018-09-29 09:27:28\n------------------------------------------------------------\nBenchmark                     Time           CPU Iterations\n------------------------------------------------------------\nBM_45K_geojson_nodes         22 ms         22 ms         32\nBM_uniform/2000               1 ms          1 ms        982\nBM_uniform/100000            63 ms         62 ms          9\nBM_uniform/200000           140 ms        140 ms          4\nBM_uniform/500000           400 ms        399 ms          2\nBM_uniform/1000000          994 ms        993 ms          1\n```\n\nLibrary is ~10% faster then JS version for 1M uniform points.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjankozik%2Fdelaunator_cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjankozik%2Fdelaunator_cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjankozik%2Fdelaunator_cpp/lists"}