From faeb95d59d758d8690ddfd056b6f97c72d83149f Mon Sep 17 00:00:00 2001 From: Arthur Date: Sat, 22 Jul 2023 10:35:59 +0800 Subject: [PATCH] ENH: smooth 6 times by 1 click of "smooth" button In adaptive layer height, smoothing 1 time is not usable. There'll be layer lines at the layer height change boundaries. Change-Id: I84a8b69744db4936062d631864836f0a8cd99cf6 (cherry picked from commit ca77408f38c9a57bee4ab8ee4989024f7f105317) --- src/libslic3r/Slicing.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/libslic3r/Slicing.cpp b/src/libslic3r/Slicing.cpp index f0e6db208..2c0185d26 100644 --- a/src/libslic3r/Slicing.cpp +++ b/src/libslic3r/Slicing.cpp @@ -428,16 +428,16 @@ std::vector smooth_height_profile(const std::vector& profile, co // return false; //}; - //int count = 0; - //std::vector ret = profile; - //bool has_steep_change = has_steep_height_change(ret, LAYER_HEIGHT_CHANGE_STEP); - //while (has_steep_change && count < 6) { - // ret = gauss_blur(ret, smoothing_params); - // has_steep_change = has_steep_height_change(ret, LAYER_HEIGHT_CHANGE_STEP); - // count++; - //} - //return ret; - return gauss_blur(profile, smoothing_params); + int count = 0; + std::vector ret = profile; + // bool has_steep_change = has_steep_height_change(ret, LAYER_HEIGHT_CHANGE_STEP); + while (/*has_steep_change &&*/ count < 6) { + ret = gauss_blur(ret, smoothing_params); + //has_steep_change = has_steep_height_change(ret, LAYER_HEIGHT_CHANGE_STEP); + count++; + } + return ret; + // return gauss_blur(profile, smoothing_params); } void adjust_layer_height_profile(