From bc7e632368559a7447f9db1362d83632ebc74fb0 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 13 Aug 2019 18:45:27 +0200 Subject: [PATCH] set meshsize for occ face from python --- libsrc/occ/occgeom.hpp | 8 ++++++++ libsrc/occ/python_occ.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/libsrc/occ/occgeom.hpp b/libsrc/occ/occgeom.hpp index fc2c68b9..af76155c 100644 --- a/libsrc/occ/occgeom.hpp +++ b/libsrc/occ/occgeom.hpp @@ -319,6 +319,14 @@ namespace netgen } } + void SetFaceMaxH(size_t facenr, double faceh) + { + if(facenr >= fmap.Extent()) + throw RangeException("OCCGeometry faces", facenr, 0, fmap.Extent()); + face_maxh[facenr] = faceh; + face_maxh_modified[facenr] = true; + } + // Philippose - 15/01/2009 // Returns the local mesh size of a given face double GetFaceMaxH(int facenr) diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index 311fd78c..3a8568ca 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -48,6 +48,10 @@ DLL_HEADER void ExportNgOCC(py::module &m) 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",py::call_guard()) + .def("SetFaceMeshsize", [](OCCGeometry& self, size_t fnr, double meshsize) + { + self.SetFaceMaxH(fnr, meshsize); + }, "Set maximum meshsize for face fnr. Face numbers are 0 based.") .def("_visualizationData", [] (shared_ptr occ_geo) { std::vector vertices;