Merge branch 'multiply_occ_listofshapes' into 'master'

Multiplication of ListOfShapes to find common shapes

See merge request jschoeberl/netgen!416
This commit is contained in:
Joachim Schöberl 2021-09-13 17:30:45 +00:00
commit 5bfb5a6eac

View File

@ -101,6 +101,15 @@ public:
} }
return maxshape; return maxshape;
} }
ListOfShapes operator*(const ListOfShapes& other) const
{
ListOfShapes common;
for(const auto& shape : (*this))
for(const auto& shape_o : other)
if(shape.IsSame(shape_o))
common.push_back(shape);
return common;
}
}; };
@ -1458,6 +1467,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
selected.push_back(s); selected.push_back(s);
return selected; return selected;
}) })
.def(py::self * py::self)
.def("Sorted",[](ListOfShapes self, gp_Vec dir) .def("Sorted",[](ListOfShapes self, gp_Vec dir)
{ {