mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 06:55:53 +08:00
Fixing bugs in the new polygon filtering routine by polygon diameter.
This commit is contained in:
parent
e2169484a3
commit
ff084a196c
@ -471,10 +471,8 @@ void remove_with_small_diameter(Polygons &polygons, double min_diameter)
|
|||||||
size_t end = 0;
|
size_t end = 0;
|
||||||
for (size_t i = 0; i < polygons.size(); ++ i) {
|
for (size_t i = 0; i < polygons.size(); ++ i) {
|
||||||
Polygon &poly = polygons[i];
|
Polygon &poly = polygons[i];
|
||||||
bool keep = true;
|
bool keep = false;
|
||||||
if (poly.size() < 2) {
|
if (poly.size() >= 2) {
|
||||||
keep = false;
|
|
||||||
} else {
|
|
||||||
Point pmin = poly.front();
|
Point pmin = poly.front();
|
||||||
Point pmax = poly.points[1];
|
Point pmax = poly.points[1];
|
||||||
for (size_t k = 2; k < poly.size(); ++k) {
|
for (size_t k = 2; k < poly.size(); ++k) {
|
||||||
@ -519,8 +517,8 @@ void remove_with_small_diameter(Polygons &polygons, double min_diameter)
|
|||||||
++ end;
|
++ end;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
polygons.erase(polygons.begin() + end, polygons.end());
|
|
||||||
}
|
}
|
||||||
|
polygons.erase(polygons.begin() + end, polygons.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void remove_collinear(Polygon &poly)
|
void remove_collinear(Polygon &poly)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user