diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 90cee472a..8721b095a 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2877,7 +2877,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm or %"); def->min = 0; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloatOrPercent(0.1, false)); + def->set_default_value(new ConfigOptionFloatOrPercent(50, true)); def = this->add("seam_slope_entire_loop", coBool); def->label = L("Scarf around entire wall"); diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index fbc444a4d..b0b88f700 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -224,6 +224,38 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con apply(config, &new_conf); is_msg_dlg_already_exist = false; } + + //BBS: limit scarf seam start height range + bool apply_scarf_seam = config->opt_enum("seam_slope_type") != SeamScarfType::None; + if (apply_scarf_seam) { + // scarf seam start height shouldn't small than zero + double layer_height = config->opt_float("layer_height"); + double scarf_seam_slope_height = config->option("seam_slope_start_height")->get_abs_value(layer_height); + + if (scarf_seam_slope_height < EPSILON) { + const wxString msg_text = _(L("Too small scarf start height.\nReset to 50%")); + MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK); + DynamicPrintConfig new_conf = *config; + is_msg_dlg_already_exist = true; + dialog.ShowModal(); + new_conf.set_key_value("seam_slope_start_height", new ConfigOptionFloatOrPercent(50, true)); + apply(config, &new_conf); + is_msg_dlg_already_exist = false; + } + + // scarf seam start height shouldn't bigger than layer height + if (scarf_seam_slope_height > config->opt_float("layer_height") + EPSILON) { + const wxString msg_text = _(L("Too big scarf start height.\nReset to 50%")); + MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK); + DynamicPrintConfig new_conf = *config; + is_msg_dlg_already_exist = true; + dialog.ShowModal(); + new_conf.set_key_value("seam_slope_start_height", new ConfigOptionFloatOrPercent(50, true)); + apply(config, &new_conf); + is_msg_dlg_already_exist = false; + } + } + //BBS: top_area_threshold showed if the top one wall function be applyed bool top_one_wall_apply = config->opt_enum("top_one_wall_type") == TopOneWallType::None; toggle_line("top_area_threshold", !top_one_wall_apply);