layer property for Solid2d

This commit is contained in:
Matthias Hochsteger 2021-09-01 14:38:45 +02:00
parent aca46c49c8
commit f53dad83ae
3 changed files with 12 additions and 0 deletions

View File

@ -2183,7 +2183,11 @@ shared_ptr<netgen::SplineGeometry2d> CSG2d :: GenerateSplineGeometry()
} }
} }
if(!is_solid_degenerated) if(!is_solid_degenerated)
{
geo->SetMaterial(dom, s.name); geo->SetMaterial(dom, s.name);
if(s.layer != 1)
geo->SetDomainLayer(dom, s.layer);
}
else else
dom--; // degenerated solid, use same domain index again dom--; // degenerated solid, use same domain index again
} }

View File

@ -630,6 +630,7 @@ struct Solid2d
{ {
Array<Loop> polys; Array<Loop> polys;
int layer = 1;
string name = MAT_DEFAULT; string name = MAT_DEFAULT;
Solid2d() = default; Solid2d() = default;
@ -708,6 +709,12 @@ struct Solid2d
return *this; return *this;
} }
Solid2d & Layer(int layer_)
{
layer = layer_;
return *this;
}
Box<2> GetBoundingBox() const; Box<2> GetBoundingBox() const;
}; };

View File

@ -433,6 +433,7 @@ NGCORE_API_EXPORT void ExportGeom2d(py::module &m)
.def("Mat", &Solid2d::Mat) .def("Mat", &Solid2d::Mat)
.def("BC", &Solid2d::BC) .def("BC", &Solid2d::BC)
.def("Maxh", &Solid2d::Maxh) .def("Maxh", &Solid2d::Maxh)
.def("Layer", &Solid2d::Layer)
.def("Copy", [](Solid2d & self) -> Solid2d { return self; }) .def("Copy", [](Solid2d & self) -> Solid2d { return self; })
.def("Move", &Solid2d::Move) .def("Move", &Solid2d::Move)