Database Reference
In-Depth Information
sudo easy_install
pyhull-1.3.5-py2.7-macosx-10.6-intel.egg
ForLinuxandsimilarsystems,simplyinstall
easy_install
anduseittoadd
py-
hull
directly from the repository:
sudo easy_install pyhull
For Debian-based systems, you may first require to install
python-setuptools
:
sudo apt-get install python-dev && sudo apt-get
install python-setuptools
InordertorunpyhullfromPostgreSQL,the
postgresql
daemonwillneedawrite
access to
/tmp/empty
. Fix it on the command line using:
sudo chmod 777 /tmp/empty
How to do it...
ThesyntaxforpyhulltoextractaVoronoidiagramisstraightforward.Totestthis,you
can follow the directions at
https://github.com/shyuep/pyhull
.
python
from pyhull.voronoi import VoronoiTess
pts = [[-0.5, -0.5], [-0.5, 0.5], [0.5, -0.5],
[0.5, 0.5], [0,0]]
v = VoronoiTess(pts)
v.vertices
The preceding code returns the following output:
[[-10.101000000000001, -10.101000000000001],
[0.0, -0.5], [-0.5, 0.0], [0.5, 0.0], [0.0,