From 753c2280c017ab88de08e9031e11c5a440bd7740 Mon Sep 17 00:00:00 2001 From: Christoph Wintersteiger Date: Fri, 3 Nov 2017 17:44:01 +0100 Subject: [PATCH] add Heal function to the python interface with the same functionality as the "Heal Geometry" button in the gui --- libsrc/occ/python_occ.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index dbd1eda6..34df71c0 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -16,8 +16,20 @@ namespace netgen DLL_HEADER void ExportNgOCC(py::module &m) { - py::class_> (m, "OCCGeometry") + py::class_> (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) + { + self.tolerance = tolerance; + self.fixsmalledges = fixsmalledges; + self.fixspotstripfaces = fixspotstripfaces; + self.sewfaces = sewfaces; + self.makesolids = makesolids; + self.splitpartitions = splitpartitions; + + self.HealGeometry(); + self.BuildFMap(); + },py::arg("tolerance")=1e-3, py::arg("fixsmalledges")=true, py::arg("fixspotstripfaces")=true, py::arg("sewfaces")=true, py::arg("makesolids")=true, py::arg("splitpartitions")=false,R"raw_string(Heal the OCCGeometry.)raw_string") ; m.def("LoadOCCGeometry",FunctionPointer([] (const string & filename) {