mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Merge branch 'layer_for_2d_occ' into 'master'
separate_layers now also working for 2d occ geometries See merge request ngsolve/netgen!577
This commit is contained in:
commit
e577c0a1a2
@ -486,13 +486,21 @@ namespace netgen
|
||||
int maxlayer = 1;
|
||||
|
||||
int dom = 0;
|
||||
for (TopExp_Explorer e(geom.GetShape(), TopAbs_SOLID); e.More(); e.Next(), dom++)
|
||||
for(const auto& s : GetSolids(geom.GetShape()))
|
||||
{
|
||||
auto& props = OCCGeometry::GetProperties(e.Current());
|
||||
if(!OCCGeometry::HaveProperties(s))
|
||||
continue;
|
||||
auto& props = OCCGeometry::GetProperties(s);
|
||||
maxhdom[dom] = min2(maxhdom[dom], props.maxh);
|
||||
maxlayer = max2(maxlayer, props.layer);
|
||||
dom++;
|
||||
}
|
||||
|
||||
for(const auto& f : GetFaces(geom.GetShape()))
|
||||
if(OCCGeometry::HaveProperties(f))
|
||||
maxlayer = max2(maxlayer, OCCGeometry::GetProperties(f).layer);
|
||||
for(const auto& e : GetEdges(geom.GetShape()))
|
||||
if(OCCGeometry::HaveProperties(e))
|
||||
maxlayer = max2(maxlayer, OCCGeometry::GetProperties(e).layer);
|
||||
|
||||
mesh.SetMaxHDomain (maxhdom);
|
||||
|
||||
|
@ -846,6 +846,13 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
||||
col[3] = c[3];
|
||||
OCCGeometry::GetProperties(self).col = col;
|
||||
}, "color of shape as RGB - tuple")
|
||||
.def_property("layer", [](const TopoDS_Shape& self) {
|
||||
if (!OCCGeometry::HaveProperties(self))
|
||||
return 1;
|
||||
return OCCGeometry::GetProperties(self).layer;
|
||||
}, [](const TopoDS_Shape& self, int layer) {
|
||||
OCCGeometry::GetProperties(self).layer = layer;
|
||||
}, "layer of shape")
|
||||
.def("UnifySameDomain", [](const TopoDS_Shape& shape,
|
||||
bool edges, bool faces,
|
||||
bool concatBSplines)
|
||||
|
Loading…
Reference in New Issue
Block a user