mapbox / delaunator

An incredibly fast JavaScript library for Delaunay triangulation of 2D points
https://mapbox.github.io/delaunator/
ISC License
2.33k stars 142 forks source link

Use hash table for convex hull edges (2x perf gain) #3

Closed mourner closed 7 years ago

mourner commented 7 years ago

Almost 2x performance improvement — check out the updated numbers! ⚡️⚡️⚡️

Introduces a hash table for storing edges of the advancing convex hull, an idea I got from this paper. The edges are hashed by the angle between their start point and the seed center, and this is used during the sweep process to quickly find a visible edge from each point.

cc @mbostock

lukasmartinelli commented 7 years ago

giphy 26