mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-01 08:28:42 +03:00
PRUSA 2.7.0
This commit is contained in:
@@ -457,6 +457,23 @@ bool has_duplicate_points(const ExPolygons &expolys)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool remove_same_neighbor(ExPolygons &expolygons)
|
||||
{
|
||||
if (expolygons.empty())
|
||||
return false;
|
||||
bool remove_from_holes = false;
|
||||
bool remove_from_contour = false;
|
||||
for (ExPolygon &expoly : expolygons) {
|
||||
remove_from_contour |= remove_same_neighbor(expoly.contour);
|
||||
remove_from_holes |= remove_same_neighbor(expoly.holes);
|
||||
}
|
||||
// Removing of expolygons without contour
|
||||
if (remove_from_contour)
|
||||
expolygons.erase(std::remove_if(expolygons.begin(), expolygons.end(),
|
||||
[](const ExPolygon &p) { return p.contour.points.size() <= 2; }),
|
||||
expolygons.end());
|
||||
return remove_from_holes || remove_from_contour;
|
||||
}
|
||||
bool remove_sticks(ExPolygon &poly)
|
||||
{
|
||||
return remove_sticks(poly.contour) || remove_sticks(poly.holes);
|
||||
|
||||
Reference in New Issue
Block a user