Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delaunay Tesselation
#1
Dear All,

On the net, when I look for Python 2D tesselation libraries, I can find different ones in Scipy, matplotlib, etc; does somebody has ever experienced it and tell me what's the most robust when treating dozens of thousand of points?

Thanks for any feedback

Paul
Reply
#2
Scipy, matplotlib, etc are packages that are used by the various tesselation libraries, and should be installed when running pip on the package.
You don't specify how you are looking for 'libaries' (packages in python) you should be looking here first: https://pypi.org/search/?q=+Python+2D+tesselation
anything found on PyPi can be installed simply, with pip for example, for the tessagon package()
pip3 install tessagon
would do the trick.
Reply
#3
In case of Scipy or matplotlib, they both invoke triangulation algorithm implemented in the qhull library. So, they are
almost the same, may be some preprocessing steps differ between scipy.spatial.Delaunay and matplotlib.tri.triangulation.

You can easily test efficiency of such triangulation,e.g.

import numpy as np
from scipy.spatial import Delaunay
data = np.random.rand(12000, 2)
def test():
    tri = Delaunay(data)
    tri.equations.shape
# in IPython
%timeit test
Output:
15.9 ns ± 0.243 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)
Qhull library is implemented in C, and it is quite fast. I used scipy's triangulation (not too much yet),
and it didn't show any crashes. I think it is sufficiently robust.
Reply
#4
Thanks both of you for the answer

I'm currently digging into the Scipy and matplotlib librariees + the example in order to determine wihch one is the most promissing for my application; I stated with matplotlib.tri.Triangulation, but I've not found so far how to get the vertices of the triangles?

scipy.spatial.Delaunay allows it using "simplices" attribut, but I cannot mask out triangles as in matplotlib: I need more time to decide which one to retain (I need a "stable" library)

Paul
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020