CGAL / cgal-swig-bindings

CGAL bindings using SWIG
Other
338 stars 92 forks source link

Install and use pmp.refine with faces and points as input #221

Open zhaoyuanyuan2011 opened 1 year ago

zhaoyuanyuan2011 commented 1 year ago

Hi, I'm trying to install this binding, and my only usage is the pmp.refine function. I tested the function with test_pmp.py but it turns out that at line 58, outf and outv are always empty. I'm wondering is this because the make is not successful? Because I never succeeded in building the whole project, but python test_pmp.py works somehow so I assume building for what I need to run pmp.refine succeeds.

The error message is as follows:

/Users/cgal-swig-bindings/examples/python/CGAL/CGAL_ClassificationPYTHON_wrap.cxx:4270:39: error: call to constructor of 'Feature_set_wrapper<CGAL_Feature_set, Feature_wrapper>::Feature' (aka 'Feature_wrapper') is ambiguous resultobj = SWIG_NewPointerObj((new Feature_set_wrapper< CGAL_Feature_set,Feature_wrapper< CGAL_Feature > >::Feature(result)), SWIGTYPE_p_Feature_wrapperT_CGAL_Feature_t, SWIG_POINTER_OWN | 0 ); ^ ~~ /Users/cgal-swig-bindings/examples/python/CGAL/CGAL_ClassificationPYTHON_wrap.cxx:1084:89: note: expanded from macro 'SWIG_NewPointerObj'

define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)

^~~ /Users/cgal-swig-bindings/SWIG_CGAL/Classification/Feature_set.h:13:7: note: candidate constructor (the implicit move constructor) class Feature_wrapper ^ /Users/cgal-swig-bindings/SWIG_CGAL/Classification/Feature_set.h:13:7: note: candidate constructor (the implicit copy constructor) /Users/cgal-swig-bindings/SWIG_CGAL/Classification/Feature_set.h:19:3: note: candidate constructor Feature_wrapper (Feature_base base) : data_sptr (new Feature_base(base)) { } ^ 5 warnings and 1 error generated. make[2]: [SWIG_CGAL/Classification/CMakeFiles/CGAL_Classification_python.dir///examples/python/CGAL/CGAL_ClassificationPYTHON_wrap.cxx.o] Error 1 make[1]: [SWIG_CGAL/Classification/CMakeFiles/CGAL_Classification_python.dir/all] Error 2 make: *** [all] Error 2

In addition, in order to give the correct input to pmp.refine, I currently use a P = Polyhedron_3(filename). To make it cleaner, I actually want to give an array of vertices and faces to make a Polyhedron_3() object. I'm wondering would anyone mind giving an example of how to use an array or a python list of vertices and faces as input and get a Polyhedron_3() object?

Thank you in advance!!