A C++ implementation of the Delaunay Triangulation algorithm and Voronoi Diagram construction. Delaunay Triangulation uses the Bowyer-Watson method.
v
: Draw Voronoi Diagram.c
: Draw circumcircles around triangles.t
: Display the coordinates of vertices.s
: Show super triangles used in the algorithm.z
: Remove the last added vertex.f
: Fill triangles with color.Esc
: Exit.
Ensure you have the following installed:
- CMake
- YAML-CPP library (
libyaml-cpp-dev
) - OpenCV library (
libopencv-dev
) - C++ Compiler (supporting C++20 or later)
-
Update Package Lists
sudo apt update
-
Install Dependencies
sudo apt install cmake libyaml-cpp-dev libopencv-dev
-
Clone the Repository
git clone https://github.com/KentaKato/DelaunayVoronoiCpp.git
-
Build the Project
cd DelaunayVoronoiCpp mkdir build cd build cmake .. make
After building the project, run the executable:
./delaunay_voronoi
- Add Vertex: Click on the canvas to add a new vertex.
- Keyboard Shortcuts:
v
: Toggle drawing of Voronoi Diagram.c
: Toggle drawing of circumcircles.t
: Toggle display of vertex coordinates.s
: Toggle display of super triangles.z
: Undo the last added vertex.f
: Toggle filling of triangles.Esc
: Exit.
This project is licensed under the MIT License.