Multiplication of ListOfShapes to find common shapes

This commit is contained in:
Christopher Lackner 2021-09-13 18:15:50 +02:00
parent 9f756563c0
commit 8b2a2340e7

View File

@ -101,6 +101,15 @@ public:
}
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;
}
};
@ -1451,6 +1460,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
selected.push_back(s);
return selected;
})
.def(py::self * py::self)
.def("Sorted",[](ListOfShapes self, gp_Vec dir)
{