Nick Retallack
Nick Retallack

Reputation: 19571

What happened to the python bindings for CGAL?

I found the Computational Geometry Algorithms Library in my search for an algorithm to decompose a concave polygon into the minimum number of convex components. Links off the site and numerous google results indicate there are python bindings for it, which would be really handy, but all the links are dead! What happened to it? Where can I get it now?

Upvotes: 10

Views: 9449

Answers (6)

adam.hendry
adam.hendry

Reputation: 5653

Try this for now:

pip install -i https://test.pypi.org/simple/ cgal

It is experimental, but available on here

Upvotes: 1

Drew Dara-Abrams
Drew Dara-Abrams

Reputation: 8054

You may also be interested in the GEOS library, which is available in Python through Shapely and the GEOS API included in GeoDjango.

Upvotes: 4

Paul Harrison
Paul Harrison

Reputation: 545

Bindings for CGAL are inherently difficult. Because the library is heavily template based there's a combinatorial explosion of possible ways to use it. Any binding would need to pick and choose what to include.

However: Python package demakein (which I wrote), includes a module to compile C++ snippets on the fly then load them with cffi. The code snippets are cached to make subsequent runs faster. There's code in there that wraps up the parts of CGAL I needed, these are probably different to what you need but should give you an idea of how to use it. It can be used with CPython or PyPy, on Linux or OS X.

Upvotes: 2

Sylvain Pion
Sylvain Pion

Reputation: 585

A rewrite of the CGAL-Python bindings has been done as part of the cgal-bindings project. Check it out : http://code.google.com/p/cgal-bindings/

Upvotes: 12

Berufsstudent
Berufsstudent

Reputation: 311

CGAL-Python has been inert for over a year but the code (available through the "Download" link) seems to work fine, though not with Python 3.

Upvotes: 3

shoosh
shoosh

Reputation: 79006

The fastest would probably be just to look at the code and re-implement it yourself in python. carrying around all of CGAL just for this tiny bit seems redundant.
Also this calculation doesn't strike me as something that would extremely benefit by running compiled.

Upvotes: 1

Related Questions