fix hole_size_threshold when 0

supermerill/SuperSlicer#1540
This commit is contained in:
supermerill 2021-09-26 16:28:15 +02:00
parent c08429cb78
commit 22b2d4692b

View File

@ -2778,9 +2778,9 @@ namespace Slic3r {
//apply hole threshold cutoff
double convex_delta_adapted = convex_delta;
double area = -hole.area();
if (area > max_hole_area * 4) {
if (area > max_hole_area * 4 && max_hole_area > 0) {
convex_delta_adapted = not_convex_delta;
} else if (area > max_hole_area) {
} else if (area > max_hole_area && max_hole_area > 0) {
// not a hard threshold, to avoid artefacts on slopped holes.
double percent = (max_hole_area * 4 - area) / (max_hole_area * 3);
convex_delta_adapted = convex_delta * percent + (1 - percent) * not_convex_delta;