Merge branch 'occ_fix_maxh' into 'master'

OCC fix maxh settings

See merge request jschoeberl/netgen!411
This commit is contained in:
Matthias Hochsteger 2021-09-13 11:50:00 +00:00
commit 992b47a561
2 changed files with 10 additions and 1 deletions

View File

@ -1095,6 +1095,10 @@ namespace netgen
maxhdom.SetSize (geom.NrSolids());
maxhdom = mparam.maxh;
int dom = 0;
for (TopExp_Explorer e(geom.GetShape(), TopAbs_SOLID); e.More(); e.Next(), dom++)
maxhdom[dom] = min2(maxhdom[dom], OCCGeometry::global_shape_properties[e.Current().TShape()].maxh);
mesh.SetMaxHDomain (maxhdom);
Box<3> bb = geom.GetBoundingBox();

View File

@ -792,7 +792,12 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
},
[](TopoDS_Shape& self, double val)
{
OCCGeometry::global_shape_properties[self.TShape()].maxh = val;
for (auto typ : { TopAbs_SOLID, TopAbs_FACE, TopAbs_EDGE })
for (TopExp_Explorer e(self, typ); e.More(); e.Next())
{
auto & maxh = OCCGeometry::global_shape_properties[e.Current().TShape()].maxh;
maxh = min2(val, maxh);
}
}, "maximal mesh-size for shape")
.def_property("col", [](const TopoDS_Shape & self) {