libigl-python-bindings icon indicating copy to clipboard operation
libigl-python-bindings copied to clipboard

CGAL module

Open alecjacobson opened this issue 2 years ago • 1 comments

This is a work in progress that for now shows a proof of concept of adding igl::copyleft::cgal::convex_hull to the python bindings.

This PR might get fleshed out with all the cgal functions or it might get superseded by a PR that adds all the igl module functions.

I'm curious whether there's a nice way to make this binding show up as something like igl.copyleft.cgal.convex_hull rather than (currently) igl.convex_hull. Any suggestions ?

alecjacobson avatar Feb 26 '22 01:02 alecjacobson

I'm not really sure what the convention would be in python. Currently we have:

igl/
  __init__.py

so if you do import igl all the functions appear as igl.cotmatrix , igl.convex_hull, etc.

If we have

igl/
  __init__.py
  cgal/
      __init__.py

Then import igl will bring in igl.cotmatrix etc. but not igl.cgal.convex_hull. I can do import igl.cgal and then call igl.cgal.convex_hull.

Is this expected? The python caller must explicitly name each submodule to import?

alecjacobson avatar Feb 27 '22 00:02 alecjacobson