Skip to content

A C++ implementation of the Delaunay Triangulation algorithm and Voronoi Diagram creation. Delaunay Triangulation uses the Bowyer-Watson method.

License

Notifications You must be signed in to change notification settings

KentaKato/DelaunayVoronoiCpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DelaunayVoronoiCpp

A C++ implementation of the Delaunay Triangulation algorithm and Voronoi Diagram construction. Delaunay Triangulation uses the Bowyer-Watson method.

Demo

Delaunay Triangulation Demo Voronoi Diagram Demo

Key Functions

  • 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.

Installation

Prerequisites

Ensure you have the following installed:

  • CMake
  • YAML-CPP library (libyaml-cpp-dev)
  • OpenCV library (libopencv-dev)
  • C++ Compiler (supporting C++20 or later)

Installation Steps

  1. Update Package Lists

    sudo apt update
  2. Install Dependencies

    sudo apt install cmake libyaml-cpp-dev libopencv-dev
  3. Clone the Repository

    git clone https://github.com/KentaKato/DelaunayVoronoiCpp.git
  4. Build the Project

    cd DelaunayVoronoiCpp
    mkdir build
    cd build
    cmake ..
    make

Usage

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.

License

This project is licensed under the MIT License.

About

A C++ implementation of the Delaunay Triangulation algorithm and Voronoi Diagram creation. Delaunay Triangulation uses the Bowyer-Watson method.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published