https://github.com/fogleman/delaunay
Fast Delaunay triangulation implemented in Go.
https://github.com/fogleman/delaunay
delaunay delaunay-triangulation go golang
Last synced: 11 months ago
JSON representation
Fast Delaunay triangulation implemented in Go.
- Host: GitHub
- URL: https://github.com/fogleman/delaunay
- Owner: fogleman
- License: mit
- Created: 2018-08-27T21:48:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-21T17:48:25.000Z (about 3 years ago)
- Last Synced: 2024-06-18T16:57:51.345Z (almost 2 years ago)
- Topics: delaunay, delaunay-triangulation, go, golang
- Language: Go
- Size: 73.2 KB
- Stars: 115
- Watchers: 5
- Forks: 16
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Delaunay Triangulation
Fast Delaunay triangulation implemented in Go.
This code was ported from [Mapbox's Delaunator project](https://github.com/mapbox/delaunator) (JavaScript).
### Installation
$ go get -u github.com/fogleman/delaunay
### Documentation
https://godoc.org/github.com/fogleman/delaunay
See https://mapbox.github.io/delaunator/ for more information about the `Triangles` and `Halfedges` data structures.
### Usage
```go
var points []delaunay.Point
// populate points...
triangulation, err := delaunay.Triangulate(points)
// handle err...
// use triangulation.Triangles, triangulation.Halfedges
```
### Performance
3.3 GHz Intel Core i5
| # of Points | Time |
| ---: | ---: |
| 10 | 1.559µs |
| 100 | 37.645µs |
| 1,000 | 485.625µs |
| 10,000 | 5.552ms |
| 100,000 | 79.895ms |
| 1,000,000 | 1.272s |
| 10,000,000 | 23.481s |
