{"id":18722520,"url":"https://github.com/mdsumner/delaunator","last_synced_at":"2026-03-01T08:34:16.814Z","repository":{"id":252862519,"uuid":"841577448","full_name":"mdsumner/delaunator","owner":"mdsumner","description":"R Wrapper of C++ 'delaunator'","archived":false,"fork":false,"pushed_at":"2024-08-12T23:55:14.000Z","size":177,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T02:48:09.100Z","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/mdsumner.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2024-08-12T17:24:40.000Z","updated_at":"2024-08-14T08:42:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"e69c13e5-ffcd-426a-a105-97909cb418cd","html_url":"https://github.com/mdsumner/delaunator","commit_stats":null,"previous_names":["mdsumner/delaunator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mdsumner/delaunator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fdelaunator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fdelaunator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fdelaunator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fdelaunator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdsumner","download_url":"https://codeload.github.com/mdsumner/delaunator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fdelaunator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29965406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T06:55:38.174Z","status":"ssl_error","status_checked_at":"2026-03-01T06:53:04.810Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":"2024-11-07T13:41:48.571Z","updated_at":"2026-03-01T08:34:16.789Z","avatar_url":"https://github.com/mdsumner.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# delaunator\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nThe goal of delaunator is to triangulate point sets fast. \n\nWe have only wrapped this library for use in R: \nhttps://github.com/abellgithub/delaunator-cpp\n\n\n\n\n## Installation\n\nYou can install the development version of delaunator like so:\n\n``` r\n#install.packages(\"remotes\")\nremotes::install_github(\"mdsumner/delaunator\")\n```\n\n## Example\n\n\n\n```{r example}\nlibrary(delaunator)\ndelaunator_triangulate(matrix(runif(6), ncol = 2))\n\ndelaunator_triangulate(cbind(1:4, runif(4)))\n\n```\n\n\nIn the R level we sort out the orientation of inputs and outputs, and return a matrix of triangle triplets as rows (1-based). \n\n```{r orientation}\nxy \u003c- matrix(rnorm(1024), ncol = 2)\ni \u003c- delaunator_triangulate(xy)\nplot(xy, asp = 1)\npolygon(xy[t(cbind(i, NA)), ])\n\n```\n\n\n## No constrained triangulation here\n\nIf you're looking for constrained, conformant, or quality-of-mesh-controllable triangulation you won't find it here. These features are in RTriangle on CRAN, and there is some exposure of the CGAL library in R, and a functional version using RTriangle for some spatial data formats is in hypertidy/anglr. \n\n\n## Benchmark \n\nWIP: An old benchmark to use for comparison: \n\nhttps://rpubs.com/cyclemumner/416456\n\n``` r\n  n \u003c- 150000\nxy \u003c- cbind(runif(n), runif(n))\nlibrary(delaunator)\nlibrary(geometry)\nlibrary(RTriangle)\nlibrary(tripack)\n## these choices were\n## 1) easy for me to try out (CGAL is todo again)\n## 2) are pure Delaunay convex hull triangulation on bare points\n## 3) fast enough (some are commented out)\nrbenchmark::benchmark(\n  delaunator = delaunator::delaunator_triangulate(xy),\n\n  #CGAL = laridae::tri_xy(xy[,1], xy[,2]),\n  geometry = geometry::delaunayn(xy, options = \"Pp\"),\n  RTriangle = RTriangle::triangulate(RTriangle::pslg(xy)),\n  tripack = tripack::tri.mesh(xy[,1], xy[,2]),\n  ## too slow\n  ##sf = sf::st_triangulate(sf::st_sfc(sf::st_multipoint(xy))),\n  ## too slow\n  #deldir = deldir::deldir(xy[,1], xy[,2], suppressMsge = TRUE),\n  ## akima doesn't really belong\n  #akima = akima::interpp(xy[,1], xy[,2], z = rep(0, n), xo = grid$x, yo = grid$y),\n  ## spatstat belongs but was (2018) the slowest\n  #spatstat = spatstat::delaunay(spatstat::ppp(xy[,1], xy[,2], window = spatstat::owin(range(xy[,1]), range(xy[,2])))),\n # rgeos = rgeos::gDelaunayTriangulation(sp::SpatialPoints(xy)),\n  \n  replications = 50,\n  order = \"relative\",\n  columns = c('test', 'elapsed', 'relative', 'user.self', 'sys.self')\n)\n#\u003e         test elapsed relative user.self sys.self\n#\u003e 1 delaunator  13.552    1.000    13.426    0.120\n#\u003e 3  RTriangle  41.934    3.094    41.682    0.239\n#\u003e 4    tripack  89.731    6.621    89.669    0.039\n#\u003e 2   geometry 100.935    7.448    97.937    2.961\n```\n\n\u003csup\u003eCreated on 2024-08-12 with [reprex v2.0.2](https://reprex.tidyverse.org)\u003c/sup\u003e\n\n\n\n## Code of Conduct\n  \nPlease note that the delaunator project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdsumner%2Fdelaunator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdsumner%2Fdelaunator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdsumner%2Fdelaunator/lists"}