Implementation of the Bowyer-Watson algorithm, heavily inspired from: http://paulbourke.net/papers/triangulate.
- C++11 compliant compiler
- (OpenGL for the demo)
- just include the
delaunay.hpp
header file - do not use in production, more efficient implementation of Delaunay's triangulation can be found elsewhere.
-
... #include "delaunay.hpp" ... std::vector<delaunay::Point<float>> points; /* Initialize the points. */ ... /* Triangulate. */ const auto triangulation = delaunay::triangulate(point); ... /* Do domething with the edges or the triangles. */ for (auto const& e : triangulation.edges) { ... } ....
-
a working example can be found in the
demo.cpp
file, in addition thedelaunay.hpp
header file should be self-explanatory.