Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

delaunator

Package Overview
Dependencies
Maintainers
144
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delaunator

A really fast JavaScript library for Delaunay triangulation of 2D points

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.5M
decreased by-22.88%
Maintainers
144
Weekly downloads
 
Created

What is delaunator?

The delaunator npm package is a fast library for Delaunay triangulation of 2D points. It is used to triangulate a set of points into a mesh of triangles, which is a fundamental operation in many geometric algorithms. The package is particularly useful in graphics, geographical information systems (GIS), and for performing various computational geometry tasks.

What are delaunator's main functionalities?

Triangulation

This feature allows you to perform Delaunay triangulation on an array of points. The 'triangles' property of the resulting object contains the indices of the points that form the triangles.

const Delaunator = require('delaunator');
const points = [[0, 0], [1, 0], [1, 1], [0, 1]];
const delaunay = Delaunator.from(points);
console.log(delaunay.triangles);

Hull

This feature provides the convex hull of the input points as an array of point indices that are in the hull. The hull is the outermost 'shell' of the triangulation.

const Delaunator = require('delaunator');
const points = [[0, 0], [1, 0], [1, 1], [0, 1]];
const delaunay = Delaunator.from(points);
console.log(delaunay.hull);

Coordinates Conversion

Delaunator can also take a flat array of coordinates and perform triangulation. This is useful when working with data that is not already structured as an array of points.

const Delaunator = require('delaunator');
const coords = [0, 0, 1, 0, 1, 1, 0, 1];
const delaunay = Delaunator.from(coords);
console.log(delaunay.triangles);

Other packages similar to delaunator

Keywords

FAQs

Package last updated on 02 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc