All Projects → delfrrr → Delaunator Cpp

delfrrr / Delaunator Cpp

Licence: mit
A really fast C++ library for Delaunay triangulation of 2D points

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Delaunator Cpp

Delaunator
An incredibly fast JavaScript library for Delaunay triangulation of 2D points
Stars: ✭ 1,641 (+572.54%)
Mutual labels:  algorithm, 2d, computational-geometry, triangulation
Cavaliercontours
2D polyline library for offsetting, combining, etc.
Stars: ✭ 135 (-44.67%)
Mutual labels:  algorithm, 2d, computational-geometry
Earcut
The fastest and smallest JavaScript polygon triangulation library for your WebGL apps
Stars: ✭ 1,359 (+456.97%)
Mutual labels:  algorithm, computational-geometry, triangulation
Connected Components 3d
Connected components on multilabel 3D & 2D images. Handles 26, 18, and 6 connected variants.
Stars: ✭ 90 (-63.11%)
Mutual labels:  algorithm, 2d
Flatbush
A very fast static spatial index for 2D points and rectangles in JavaScript
Stars: ✭ 1,031 (+322.54%)
Mutual labels:  algorithm, computational-geometry
Supercluster
A very fast geospatial point clustering library for browsers and Node.
Stars: ✭ 1,246 (+410.66%)
Mutual labels:  algorithm, computational-geometry
Turf Swift
A Swift language port of Turf.js.
Stars: ✭ 123 (-49.59%)
Mutual labels:  algorithm, computational-geometry
Data structure and algorithms library
A collection of classical algorithms and data-structures implementation in C++ for coding interview and competitive programming
Stars: ✭ 133 (-45.49%)
Mutual labels:  algorithm, computational-geometry
Skeleton Tracing
A new algorithm for retrieving topological skeleton as a set of polylines from binary images
Stars: ✭ 241 (-1.23%)
Mutual labels:  algorithm, computational-geometry
Rbush
RBush — a high-performance JavaScript R-tree-based 2D spatial index for points and rectangles
Stars: ✭ 1,881 (+670.9%)
Mutual labels:  algorithm, computational-geometry
Wechart
Create all the [ch]arts by cax or three.js - Cax 和 three.js 创造一切图[表]
Stars: ✭ 152 (-37.7%)
Mutual labels:  algorithm, 2d
Geometry2d
Unity3D: A set of helper classes for 2D geometric calculations.
Stars: ✭ 40 (-83.61%)
Mutual labels:  2d, triangulation
Polytri
🔺 Fast and simple polygon triangulation library.
Stars: ✭ 37 (-84.84%)
Mutual labels:  computational-geometry, triangulation
Polysnap
A work in progress polygon operations library with integer snap-rounding
Stars: ✭ 14 (-94.26%)
Mutual labels:  algorithm, computational-geometry
Greinerhormann
Greiner-Hormann polygon clipping algorithm. Does AND, OR, XOR. Plays nicely with Leaflet. Handles non-convex polygons and multiple clipping areas. ~3kb footprint, no dependencies
Stars: ✭ 176 (-27.87%)
Mutual labels:  algorithm, computational-geometry
Turf
A modular geospatial engine written in JavaScript
Stars: ✭ 6,659 (+2629.1%)
Mutual labels:  algorithm, computational-geometry
Kdbush
A fast static index for 2D points
Stars: ✭ 412 (+68.85%)
Mutual labels:  algorithm, computational-geometry
Earcut.hpp
Fast, header-only polygon triangulation
Stars: ✭ 447 (+83.2%)
Mutual labels:  algorithm, triangulation
Hxgeomalgo
Small collection of computational geometry algorithms in Haxe.
Stars: ✭ 133 (-45.49%)
Mutual labels:  computational-geometry, triangulation
Cdt
C++ library for constrained Delaunay triangulation (CDT)
Stars: ✭ 165 (-32.38%)
Mutual labels:  computational-geometry, triangulation

delaunator-cpp

A really fast C++ library for Delaunay triangulation of 2D points.

delaunator-cpp is a C++ port from https://github.com/mapbox/delaunator a JavaScript implementation of very fast 2D Delaunay algorithm.

Build Status badge

Features

  • Probably the fastest C++ open source 2D Delaunay implementation
  • Example showing triangulation of GeoJson points

Usage

examples/basic.cpp

#include <delaunator.hpp>
#include <cstdio>

int main() {
    /* x0, y0, x1, y1, ... */
    std::vector<double> coords = {-1, 1, 1, 1, 1, -1, -1, -1};

    //triangulation happens here
    delaunator::Delaunator d(coords);

    for(std::size_t i = 0; i < d.triangles.size(); i+=3) {
        printf(
            "Triangle points: [[%f, %f], [%f, %f], [%f, %f]]\n",
            d.coords[2 * d.triangles[i]],        //tx0
            d.coords[2 * d.triangles[i] + 1],    //ty0
            d.coords[2 * d.triangles[i + 1]],    //tx1
            d.coords[2 * d.triangles[i + 1] + 1],//ty1
            d.coords[2 * d.triangles[i + 2]],    //tx2
            d.coords[2 * d.triangles[i + 2] + 1] //ty2
        );
    }
}

See more examples here

Benchmarks

Run on (4 X 2300 MHz CPU s)
2018-09-29 09:27:28
------------------------------------------------------------
Benchmark                     Time           CPU Iterations
------------------------------------------------------------
BM_45K_geojson_nodes         22 ms         22 ms         32
BM_uniform/2000               1 ms          1 ms        982
BM_uniform/100000            63 ms         62 ms          9
BM_uniform/200000           140 ms        140 ms          4
BM_uniform/500000           400 ms        399 ms          2
BM_uniform/1000000          994 ms        993 ms          1

Library is ~10% faster then JS version for 1M uniform points (details)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].