add Heal function to the python interface with the same functionality as the "Heal Geometry" button in the gui

This commit is contained in:
Christoph Wintersteiger 2017-11-03 17:44:01 +01:00
parent b269c9a2c9
commit 753c2280c0

View File

@ -16,8 +16,20 @@ namespace netgen
DLL_HEADER void ExportNgOCC(py::module &m) DLL_HEADER void ExportNgOCC(py::module &m)
{ {
py::class_<OCCGeometry, shared_ptr<OCCGeometry>> (m, "OCCGeometry") py::class_<OCCGeometry, shared_ptr<OCCGeometry>> (m, "OCCGeometry", R"raw_string(Use LoadOCCGeometry to load the geometry from a *.step file.)raw_string")
.def(py::init<>()) .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) m.def("LoadOCCGeometry",FunctionPointer([] (const string & filename)
{ {