The code is based on this article.
Delaunay Triangulation implemented in python and solved using Bowyer-Watson algorithm. The program takes a set of points and connects them using a mesh.
Running the main.py
will create a delaunay triangulated mesh out of random points. Clicking on the screen will create a new point the mesh is recalculated to add the new point into the mesh. The mesh and its heatmap are rendered using Pygame.
The Delaunay triangulation code can be used without using any renderer.
from delaunayTriangulation import DelaunayTriangulation
from random import randint
N = 50
for i in range(N):
point = Point(randint(0, 100), randint(0, 100), randint(0, 50))
DT.AddPoint(point)
DT.Triangulate()
# The DT.mesh contains the triangles that make up the delaunay triangulated mesh