diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 3502c38a..2fa9c14e 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -262,7 +262,22 @@ DLL_HEADER void ExportNetgenMeshing() bp::class_,boost::noncopyable>("Mesh", bp::no_init) - .def(bp::init<>("create empty mesh")) + // .def(bp::init<>("create empty mesh")) + + .def("__init__", bp::make_constructor + (FunctionPointer ([](int dim) + { + auto mesh = make_shared(); + mesh->SetDimension(dim); + return mesh; + }), + bp::default_call_policies(), // need it to use named arguments + ( + bp::arg("dim")=3 + ) + )) + + .def("__str__", &ToString) .def("Load", FunctionPointer ([](Mesh & self, const string & filename)