From 88c8134f156a42aacbdab5397b160cd95f346b40 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 13 Aug 2021 11:00:30 +0200 Subject: [PATCH] AutoColorChange detection: Small improvements - at least 25% (instead of 30%) of object's height have to be a solid --- src/slic3r/GUI/GUI_Preview.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index d87c23d81..5f9ad5ba5 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -709,9 +709,9 @@ void Preview::update_layers_slider(const std::vector& layers_z, bool kee const ExPolygons& bottom = object->get_layer(0)->lslices; double bottom_area = area(bottom); - // at least 30% of object's height have to be a solid - int i; - for (i = 1; i < int(0.3 * num_layers); ++ i) { + // at least 25% of object's height have to be a solid + int i, min_solid_height = int(0.25 * num_layers); + for (i = 1; i <= min_solid_height; ++ i) { double cur_area = area(object->get_layer(i)->lslices); if (cur_area != bottom_area && fabs(cur_area - bottom_area) > scale_(scale_(1))) { // but due to the elephant foot compensation, the first layer may be slightly smaller than the others @@ -723,7 +723,7 @@ void Preview::update_layers_slider(const std::vector& layers_z, bool kee break; } } - if (i < int(0.3 * num_layers)) + if (i < min_solid_height) continue; // bottom layer have to be a biggest, so control relation between bottom layer and object size