From 07b84024ca49724483d439e7730af346ec810fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Sun, 11 Mar 2018 16:28:43 +0100 Subject: [PATCH] enable tables to disable edge/face generation if not needed --- libsrc/meshing/python_mesh.cpp | 10 +++++++++- libsrc/meshing/topology.cpp | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index f4c461ab..f549981c 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -122,7 +122,6 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) py::class_> (m, "Trafo") .def(py::init>()) .def("__call__", [] (Transformation<3> trafo, Point<3> p) { return trafo(p); }) - // .def ("__str__", &ToString>) ; m.def ("SetTransformation", FunctionPointer @@ -786,6 +785,15 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) } )) + .def ("EnableTable", [] (Mesh & self, string name, bool set) + { + if (name == "edges") + const_cast(self.GetTopology()).SetBuildEdges(set); + if (name == "faces") + const_cast(self.GetTopology()).SetBuildFaces(set); + }, + py::arg("name"), py::arg("set")=true) + .def ("Scale", FunctionPointer([](Mesh & self, double factor) { for(auto i = 0; i