Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msokalski/delabella
2D Delaunay triangulation (dela) - super stable (bella!)
https://github.com/msokalski/delabella
Last synced: 6 days ago
JSON representation
2D Delaunay triangulation (dela) - super stable (bella!)
- Host: GitHub
- URL: https://github.com/msokalski/delabella
- Owner: msokalski
- License: other
- Created: 2018-07-18T16:22:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-13T17:22:01.000Z (9 months ago)
- Last Synced: 2024-08-02T07:18:23.751Z (3 months ago)
- Language: C++
- Size: 10.3 MB
- Stars: 216
- Watchers: 11
- Forks: 26
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-game-engine-dev - Delabella - Super stable 2D delaunay triangulation. (Libraries / C++)
- AwesomeCppGameDev - delabella - super stable (bella!) (Maths)
README
# DelaBella
## 2D Exact Delaunay triangulation- Bunch of credits must go to David for inventing such beautiful algorithm (Newton Apple Wrapper):
http://www.s-hull.org/
- It is pretty well described in this paper:
https://arxiv.org/ftp/arxiv/papers/1602/1602.04707.pdf
- Currently DelaBella makes use of adaptive-exact predicates by William C. Lenthe
https://github.com/wlenthe/GeometricPredicates
## What you can do with DelaBella?- Delaunay triangulations
![delaunay](images/delaunay.png)
- Voronoi diagrams
![voronoi](images/voronoi.png)
- Constrained Delaunay triangulations
![constraints](images/constraints.png)
- Interior / exterior detection based on constraint edges
![floodfill](images/floodfill.png)
## Minimalistic DelaBella usage:
```cpp
#include "delabella.h"
// ...// somewhere in your code ...
int POINTS = 1000000;
typedef double MyCoord;
struct MyPoint
{
MyCoord x;
MyCoord y;
// ...
};MyPoint* cloud = new MyPoint[POINTS];
srand(36341);
// gen some random input
for (int i = 0; i < POINTS; i++)
{
cloud[i].x = rand();
cloud[i].y = rand();
}IDelaBella2* idb = IDelaBella2::Create();
int verts = idb->Triangulate(POINTS, &cloud->x, &cloud->y, sizeof(MyPoint));
// if positive, all ok
if (verts>0)
{
int tris = idb->GetNumPolygons();
const IDelaBella2::Simplex* dela = idb->GetFirstDelaunaySimplex();
for (int i = 0; inext;
}
}
else
{
// no points given or all points are colinear
// make emergency call ...
}delete[] cloud;
idb->Destroy();// ...
```
## On the go progress information for all lengthy functions
![terminal](images/terminal.gif)
## Benchmarks
![Benchmarks](./bench/bar1.svg)
For more tests and informations please see [Benchmarks](./bench/bench.md)