Skip to content
/ voronoi Public

Simple Python computational geometry code for computing voronoi diagrams, and its dual graph, the Delauney triangulation.

License

Notifications You must be signed in to change notification settings

t9nzin/voronoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voronoi

Simple Python computational geometry code for computing voronoi diagrams, and its dual graph, the Delauney triangulation.

Description

Voronoi diagrams are a type of tesselation pattern that emerges when every point in a plane is segmented into n cells through the computation of euclidean distances for a given set of n points.

For example, if n = 6, then the euclidean distance between every point in the plane and each n-th given point will be calculated. Each point will be colour-assigned to whichever n-th point it is closest to, creating colour-separated sites.

The pattern of voronoi diagrams may look familiar, that's because it shows up quite often: from cells to giraffe coat patterns. You can read more about it here, from this article which inspired me to create this repository. the-fascinating-world-of-voronoi-diagrams

Delauney triangulations are known as the dual graph of the Voronoi diagrams. The Delauney is an efficient triangulation in which for a given set of points, no point is inside the circumcircle of any triangle within the Delauney triangulation.

voronoi diagram delauney triangulation

Getting Started

Dependencies

  • Pygame 2.5.2
  • Matplotlib 3.5.1
  • Numpy 1.22.0

Installing

  • Clone the repository

Executing program

  • Run voronoi.py in the voronoi folder
  • Run delauney_triangulation.py in the delauney folder
python voronoi.py
python delauney_triangulation.py

Notes

Feel free to open a pull request if you see any changes to make. :-)

Authors

@t9nz

Version History

  • 0.1
    • Initial Release

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Math resources/references,

About

Simple Python computational geometry code for computing voronoi diagrams, and its dual graph, the Delauney triangulation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages