diff --git a/libsrc/geom2d/python_geom2d.cpp b/libsrc/geom2d/python_geom2d.cpp index 5b71b980..5ca29046 100644 --- a/libsrc/geom2d/python_geom2d.cpp +++ b/libsrc/geom2d/python_geom2d.cpp @@ -250,7 +250,7 @@ DLL_HEADER void ExportGeom2d(py::module &m) //cout << i << " : " << self.splines[i]->GetPoint(0.1) << " , " << self.splines[i]->GetPoint(0.5) << endl; } })) - .def("GenerateMesh", FunctionPointer([](shared_ptr self, MeshingParameters & mparam) + .def("GenerateMesh", [](shared_ptr self, MeshingParameters & mparam) { shared_ptr mesh = make_shared (); mesh->SetGeometry(self); @@ -258,7 +258,7 @@ DLL_HEADER void ExportGeom2d(py::module &m) ng_geometry = self; self->GenerateMesh(mesh, mparam); return mesh; - })) + },py::call_guard()) ; diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index f549981c..15595887 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -449,7 +449,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) py::implicitly_convertible< int, PointIndex>(); - py::class_> (m, "NetgenGeometry") + py::class_> (m, "NetgenGeometry", py::dynamic_attr()) ; py::class_>(m, "Mesh") diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index 34df71c0..2968638b 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -16,7 +16,7 @@ namespace netgen DLL_HEADER void ExportNgOCC(py::module &m) { - py::class_> (m, "OCCGeometry", R"raw_string(Use LoadOCCGeometry to load the geometry from a *.step file.)raw_string") + py::class_, NetgenGeometry> (m, "OCCGeometry", R"raw_string(Use LoadOCCGeometry to load the geometry from a *.step file.)raw_string") .def(py::init<>()) .def("Heal",[](OCCGeometry & self, double tolerance, bool fixsmalledges, bool fixspotstripfaces, bool sewfaces, bool makesolids, bool splitpartitions) { diff --git a/libsrc/stlgeom/python_stl.cpp b/libsrc/stlgeom/python_stl.cpp index 37d3e1fc..f8f04caa 100644 --- a/libsrc/stlgeom/python_stl.cpp +++ b/libsrc/stlgeom/python_stl.cpp @@ -18,7 +18,7 @@ namespace netgen DLL_HEADER void ExportSTL(py::module & m) { - py::class_> (m,"STLGeometry") + py::class_, NetgenGeometry> (m,"STLGeometry") .def(py::init<>()) ; m.def("LoadSTLGeometry", FunctionPointer([] (const string & filename) diff --git a/libsrc/stlgeom/stlgeom.hpp b/libsrc/stlgeom/stlgeom.hpp index cb51cfae..7b1d814d 100644 --- a/libsrc/stlgeom/stlgeom.hpp +++ b/libsrc/stlgeom/stlgeom.hpp @@ -98,7 +98,7 @@ namespace netgen - class STLGeometry : public STLTopology, public NetgenGeometry + class STLGeometry : public NetgenGeometry, public STLTopology { // edges to be meshed: Array edges;