Skip to content

Voronoi Diagrams and Delaunay Triangulations implemented in python

Notifications You must be signed in to change notification settings

josephsweeney/python-voronoi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-voronoi

Introduction

This project is designed to produce Voronoi diagrams and Delaunay triangulation in n-dimensions. Included is also a GUI that allows for the visualization of the creation of Delaunay Triangulations in 2D. This involves a visibility walk, as well as a "face-shattering" algorithm to keep the triangulation Delaunay. It is also possible to see the dual to the Delaunay triangulation (the Voronoi Diagram)

Testing

To run all the tests, run python3 -m unittest discover -v. To run a particular test, run python3 -m unittest -v pyVor.tests.testPredicates (optionally replacing testPredicates with the test you actually want to run).

Requirements

  • If running on Linux, the GUI requires tk to be installed via package manager (for example pacman -S tk) since it does not ship with the Linux version of python

Running Arbitrary Files

python3 -m pyVor.path.to.file

GUI

To run the GUI, simply run python3 main/gui.py Key bindings are as follows:

  • left click to add a point
  • c, right click, or middle button on a triangle to show the circumcircle (c does not work on MAC OS)
  • <backspace> to clear all circumcircles
  • s to toggle visualization
  • v to toggle showing the Voronoi diagram
  • p to print the points added to standard out

About

Voronoi Diagrams and Delaunay Triangulations implemented in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%