Skip to main content

2D Delaunay Triangulation in C++ with Python wrapper

Project description

# Delaunator
2D Delaunay Triangulation in C++ with Python wrapper.
(or wathever you want, thanks to SWIG)

__LICENSE:__ _GPL-2.0_; for use, help and share. cf LICENSE.txt file.
__Portability:__ code and tests on Debian Stable, with c++11, gcc 4.7.2, make 3.81, python 3.2 and SWIG 2.0; i don't know for others platforms, but except for windows, i think portability is totally possible, maybe already done.




## PROGRADE DIRECTION
- [x] do triangulation;
- [x] print it by Python script and pygame;
- [x] do delaunay triangulation;
- [x] manage movement;
- [x] do a victory cry;
- [x] upload packaged lib on pypi;
- [ ] manage big/precise moves;
- [ ] use threads;
- [ ] find a better way than TTL limit for fix infinite recursion problem;
- [ ] implements DAG version of coordinates' container finding;
- [ ] do benchmarks between DAG and current vertex finder;
- [ ] vertex deleting;


## MAYBE-A-DAY DO LIST
- support the third dimension;
- support constraints;
- built-in collision API;
- do a technical tutorial on quad-edge and other structure/algo used by this module;
- do a technical tutorial on methodology for creat a package like this;




## EXAMPLE OF USE
See github repo, pydelaunator repertory, for built-in example.

from delaunator import Delaunator

dt = Delaunator(600, 600)
vtx = dt.addVertexAt(342, 23)

dt.moveVertex(vtx, .5, -31)

# print all neighbour vertices
print([_ for _ in dt.getNeighbors(vtx)]])

API will be improved with time and ideas.





## INSTALLATION
A simple

pip install delaunator

must be enough.
Please note that SWIG is needed. (see links below; SWIG is in official repositories in most of cases)

Some problems can appear :
- on my debian stable, SWIG is named *swig2.0*, but setuptools use *swig*. You can can correct that with command *python3 setup.py setopt --command=build_ext --option=swig --set-value=swig2.0*, or something like that.
- be sur to have only one version of setuptools, sometimes there are problems when two different versions are installed.

Contact maintainer by mail for help if necessary.





### Some links
https://github.com/Aluriak/Delaunator

http://swig.org
http://swig.org/tutorial.html

http://totologic.blogspot.fr/2013/11/core-quad-edge-implementation-explained.html

http://stackoverflow.com/questions/10121957/swig-to-python-import-errordynamic-module-does-not-define-init-function

http://sametmax.com/creer-un-setup-py-et-mettre-sa-bibliotheque-python-en-ligne-sur-pypi/
https://docs.python.org/3.2/distutils/setupscript.html#extension-source-files
https://pythonhosted.org/setuptools/setuptools.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

delaunator-0.0.2.tar.gz (86.1 kB view details)

Uploaded Source

File details

Details for the file delaunator-0.0.2.tar.gz.

File metadata

  • Download URL: delaunator-0.0.2.tar.gz
  • Upload date:
  • Size: 86.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for delaunator-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6ac0e77bcd5080baa731f0b4ac354fbc1f37b78060a4bff40d065dfab015a7eb
MD5 12885679c2b6ac20bf61569a01a328d7
BLAKE2b-256 71a50348a807c61fd9ef255b04e9e1816ea3ee07e4e11d6793649d365df9098f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page