Home

Awesome

Delaunay Triangulation

Fast Delaunay triangulation implemented in Go.

This code was ported from Mapbox's Delaunator project (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

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 PointsTime
101.559µs
10037.645µs
1,000485.625µs
10,0005.552ms
100,00079.895ms
1,000,0001.272s
10,000,00023.481s

Example