3
$\begingroup$

I need to process some polygons in 3D. They are typically loaded from an OFF or STL file. Then I need to do some transformations (rotation, move, resize), I'd like to check whether points are inside the polygon or not, whether polygons overalp, and I'd like to merge several polygons into one. I'd also like to have raw access on points and surface indices.

It seems that there are many libraries for 2D, but it's difficult to find something for 3D. Preferably usable with Python/NumPy.

$\endgroup$
2
  • $\begingroup$ Have you tried Numpy-STL? $\endgroup$
    – nicoguaro
    Commented Jul 8, 2016 at 12:56
  • $\begingroup$ If you have installed Blender, maybe you can try their API as well. $\endgroup$
    – nicoguaro
    Commented Jul 8, 2016 at 13:03

1 Answer 1

3
$\begingroup$

You may try GEOGRAM [1], a programming library that we are developing with my research team. It has import for several formats, including STL. If you love templates, there is also CGAL that has many functionalities [2] (but with it you will not have by-index access to the elements as you requested, CGAL uses pointers). There is also the GNU Triangulated Surface Library [3] with some interesting functionalities. Finally, you may try libIGL, it has index-based data structures (like geogram) and uses templates (like CGAL).

If you need a graphic user interface, then you can use Graphite [5], it is a shell around Geogram (also developed by my research team).

[1] GEOGRAM: http://alice.loria.fr/software/geogram/doc/html/index.html

[2] CGAL: http://www.cgal.org

[3] GTS: http://gts.sourceforge.net/

[4] libIGL: http://libigl.github.io/libigl/

[5] Graphite: http://alice.loria.fr/software/graphite/doc/html/

$\endgroup$
6
  • $\begingroup$ I'm currently evaluating which one to use. Do you know which of the libraries has reasonable Python bindings? $\endgroup$
    – Michael
    Commented Jul 18, 2016 at 7:11
  • 1
    $\begingroup$ To my knowledge, there exists some python bindings for CGAL, and my software Graphite has python scripting (but only for high level operations) $\endgroup$
    – BrunoLevy
    Commented Jul 20, 2016 at 12:12
  • $\begingroup$ After glancing through the libraries, it seems that CGAL is the largest in terms of functionality, while GTS only offers a relatively small set of functions. liblGL seems to be not as large as CGAL but easier to start with. With GEOGRAM, I do not see any particular strengths at a first glance. But maybe you as the developer can tell? $\endgroup$
    – Michael
    Commented Jul 20, 2016 at 14:07
  • 1
    $\begingroup$ GEOGRAM is more specialized (smaller number of functionalities, but faster and uses less memory for what it does). Easier to compile / self contained / has graphics with modern OpenGL. It is also fully documented (including implementation of algorithm). API is simple to use in my opinion (I do not like templates), but its a matter of taste. $\endgroup$
    – BrunoLevy
    Commented Jul 21, 2016 at 11:06
  • 1
    $\begingroup$ The tutorial is on its way. In the meanwhile, you can take a look at the example programs in src/bin, src/demos and src/tutorial, they are well commented. src/bin/geobox is a small GUI shell around the main functionalities of geogram, it can be used as a starting point. $\endgroup$
    – BrunoLevy
    Commented Jul 28, 2016 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.