Simple Delaunay triangulator for Cinder based on Triangulate by Paul Bourke and Gilles Dumoulin's C++ implementation. Requires Cinder glNext
Clone into your blocks repo and add the following references to your project:
- <cinder_root>\blocks\Cinder-Delaunay\src
- <cinder_root>\blocks\Cinder-Delaunay\src\Delaunay
Cinder-Delaunay has one main function, CiDelaunay::triangulate. Using it is as simple as:
TriMeshRef triangulatedPoints;
void DelaunayApp::setup()
{
vector<vec3> pointsToTriangulate;
//fill vector with points,
//then call:
triangulatedPoints = CiDelaunay::triangulate(pointsToTriangulate);
}
void DelaunayApp::draw()
{
gl::enableWireframe();
gl::draw(triangulatedPoints);
//or whatever you want to do with it
}
Questions, comments, diatribes, feature requests, bugs'n'sugs? Send 'em to [email protected]. Also, I love PRs.