Merge branch 'shape_solids' into 'master'

Add property .solids to occ shape

See merge request jschoeberl/netgen!415
This commit is contained in:
Joachim Schöberl 2021-09-13 16:48:59 +00:00
commit bec02c79eb

View File

@ -645,6 +645,13 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
return sub; return sub;
}, py::arg("type"), "returns list of sub-shapes of type 'type'") }, py::arg("type"), "returns list of sub-shapes of type 'type'")
.def_property_readonly("solids", [] (const TopoDS_Shape & shape)
{
ListOfShapes solids;
for(TopExp_Explorer e(shape, TopAbs_SOLID); e.More(); e.Next())
solids.push_back(e.Current());
return solids;
}, "returns all sub-shapes of type 'SOLID'")
.def_property_readonly("faces", [] (const TopoDS_Shape & shape) .def_property_readonly("faces", [] (const TopoDS_Shape & shape)
{ {
ListOfShapes sub; ListOfShapes sub;