A lightweight collection of helper classes and methods to create a delaunay triangulation.
Python 3.6 or higher is required
other than that it's just as simple as
pip install delaunay-triangulation
Geometry Math Classes - typing.py
A line in a coordinate grid described in standard form (ax + by = c).
A single x or y coordinate that doesn't have a specific value yet.
A Vertex - a point in 2D space described by an x and y value.
An Edge - a line(AB) in 2D space described by 2 vertices
A Triangle represented as 3 vertices a, b, c
A Circle described by its center and its radius
Calculation Methods - triangulation.py
helper method to scatter random vertices on a specified plane.
get super triangle from vertices
the crux of this package. A method to Delaunay Triangulate a list of vertices using the Bowyer-Watson algorithm.
from delaunay_triangulation.triangulate import scatter_vertices, delaunay width = 1920 height = 1080 spacing = 250 scatter = 0.75 vertices = scatter_vertices( plane_width=width, plane_height=height, spacing=spacing, scatter=scatter ) # delete_super_shared is True by default but can be turned off if you need to fill a plane completely triangles = delaunay( vertices=vertices, delete_super_shared=False )
You are now free to do with those triangles what ever you may desire!
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size delaunay_triangulation-1.0.0-py3-none-any.whl (7.3 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size delaunay-triangulation-1.0.0.tar.gz (5.5 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for delaunay_triangulation-1.0.0-py3-none-any.whl
Hashes for delaunay-triangulation-1.0.0.tar.gz