From a1496ea6455d93a0ab4291cbb1952d571c442ca3 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Sat, 6 Aug 2016 13:15:21 +0200 Subject: [PATCH] property --- libsrc/meshing/python_mesh.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 32b8834d..3bd8b1f1 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -105,6 +105,14 @@ DLL_HEADER void ExportNetgenMeshing() .def(bp::init>()) .def("__str__", &ToString) .def("__repr__", &ToString) + .add_property("p", FunctionPointer([](const MeshPoint & self) + { + bp::list l; + l.append ( self[0] ); + l.append ( self[1] ); + l.append ( self[2] ); + return bp::tuple(l); + })) .def("__getitem__", FunctionPointer([](const MeshPoint & self, int index) { if(index<0 || index>2) bp::exec("raise IndexError()\n");