mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-07 04:11:50 +03:00
update libslic3r
This commit is contained in:
@@ -185,6 +185,15 @@ bool overlaps(const ExPolygons& expolys1, const ExPolygons& expolys2)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool overlaps(const ExPolygons& expolys, const ExPolygon& expoly)
|
||||
{
|
||||
for (const ExPolygon& el : expolys) {
|
||||
if (el.overlaps(expoly))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Point projection_onto(const ExPolygons& polygons, const Point& from)
|
||||
{
|
||||
Point projected_pt;
|
||||
@@ -475,6 +484,21 @@ 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