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.1.tar.gz (86.0 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for delaunator-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9ba729b5389591e0c0bf81d0a67f99c97633b01dc6606df3896703c1375f7189
MD5 c9630d46495aed2b23f86f51ddc61c6d
BLAKE2b-256 80525e479c964abcb3f1e6fbc3e5224d8742b14ed9ee554aa7b3413364461879

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