diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 3641ca15..64e3e0c8 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -163,6 +163,10 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) py::class_> (m, "Point2d") .def(py::init()) + .def(py::init( [] (std::pair xy) + { + return Point<2>{xy.first, xy.second}; + })) .def ("__str__", &ToString>) .def(py::self-py::self) .def(py::self+Vec<2>()) @@ -170,6 +174,8 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) .def("__getitem__", [](Point<2>& self, int index) { return self[index]; }) ; + py::implicitly_convertible>(); + py::class_> (m, "Point3d") .def(py::init()) .def ("__str__", &ToString>)