• This repository has been archived on 18/Apr/2020
  • Stars
    star
    778
  • Rank 58,431 (Top 2 %)
  • Language
    JavaScript
  • Created over 12 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fast Delaunay Triangulation in JavaScript.

This is just a quick little implementation of Delaunay Triangulation in JavaScript. It was mostly ported from Paul Bourke's C implementation, but I referenced some bits from another JavaScript implementation and rewrote a bunch of things in ways more amenable to fast JavaScript execution.

Essentially, you pass Delaunay.triangulate a list of vertices (which should be a bunch of two-element arrays, representing 2D Euclidean points), and it will return you a giant array, arranged in triplets, representing triangles by indices into the passed array. (This representation is a little bizarre, but object allocation is too slow for this library's original use case. Yes, really.)

Beware of using vertices that are too close to each other (say, within 0.01 on either axis): numerical precision issues may result, causing your mesh to be invalid. (If you encounter this, simply multiply each of your vertices' positions by a constant factor.)

License

To the extent possible by law, I have waived all copyright and related or neighboring rights to this library.

Related

More Repositories

1

skycons

JavaScript
1,249
star
2

string-hash

Fast string hashing function for Node.JS.
JavaScript
309
star
3

forecast-ruby

Ruby gem for retrieving data from the Forecast Weather API.
Ruby
240
star
4

tz-lookup-oss

JavaScript Library for Timezone Lookup by Location
JavaScript
208
star
5

translations

translate Dark Sky API summaries into any language
JavaScript
139
star
6

sphere-knn

Find the k nearest neighbors for points on a sphere.
JavaScript
121
star
7

binary-search

Tiny binary search library for Node.JS.
JavaScript
85
star
8

pngparse

100%-JavaScript PNG Parser for Node.JS
JavaScript
78
star
9

darksky-ruby

Ruby gem for retrieving data from the Dark Sky API
Ruby
48
star
10

astro

JavaScript
30
star
11

delaunay

Delaunay triangulation in arbitrary dimensions.
JavaScript
23
star
12

inhabited

quickly determine if a lat/lon may be inhabited or not
JavaScript
18
star
13

node-sarra

consume data from Environment and Climate Change Canada
JavaScript
13
star
14

metaregexp

A simple way to keep long regexes organized.
JavaScript
9
star
15

lowres-rgeo

low resolution reverse geocoder for Node.JS
JavaScript
9
star
16

elevation

Finds the elevation of a lat/lon with low-to-moderate resolution
JavaScript
7
star
17

pbj

tiny, stupid bitmap image format
JavaScript
6
star
18

cache

An in-memory, promise-backed cache
JavaScript
5
star
19

bounding

calculate bounding areas of points
JavaScript
4
star
20

zqueue

A little redis-backed queue dingus.
JavaScript
4
star
21

cache-helpers

Caching helper functions for Node.JS.
JavaScript
4
star
22

regression

A tiny Javascript toolkit for regression analysis.
JavaScript
4
star
23

shape

spherical geometry library
JavaScript
1
star