diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 3819b2adc9..f1c129df60 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -4679,6 +4679,8 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou double h = paths.front().height; start_slope_ratio = m_config.seam_slope_start_height.value / h; } + if (start_slope_ratio >= 1) + start_slope_ratio = 0.99; double loop_length = 0.; for (const auto & path : paths) { diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 77dd3dd0a0..0c7a3a5bff 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3601,6 +3601,7 @@ def = this->add("filament_loading_speed", coFloats); def->tooltip = L("Start height of the scarf.\n" "This amount can be specified in millimeters or as a percentage of the current layer height. The default value for this parameter is 0."); def->sidetext = L("mm or %"); + def->ratio_over = "layer_height"; def->min = 0; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index b2ed19fcd1..49f1dfe682 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -172,8 +172,9 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con return; // layer_height shouldn't be equal to zero + auto layer_height = config->opt_float("layer_height"); auto gpreset = GUI::wxGetApp().preset_bundle->printers.get_edited_preset(); - if (config->opt_float("layer_height") < EPSILON) + if (layer_height < EPSILON) { const wxString msg_text = _(L("Too small layer height.\nReset to 0.2")); MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK); @@ -187,7 +188,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con //BBS: limite the max layer_herght auto max_lh = gpreset.config.opt_float("max_layer_height",0); - if (max_lh > 0.2 && config->opt_float("layer_height") > max_lh+ EPSILON) + if (max_lh > 0.2 && layer_height > max_lh+ EPSILON) { const wxString msg_text = wxString::Format(L"Too large layer height.\nReset to %0.3f", max_lh); MessageDialog dialog(nullptr, msg_text, "", wxICON_WARNING | wxOK); @@ -398,7 +399,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con // BBS if (has_wipe_tower && config->opt_bool("enable_support") && !config->opt_bool("independent_support_layer_height")) { - double layer_height = config->opt_float("layer_height"); double top_gap_raw = config->opt_float("support_top_z_distance"); //double bottom_gap_raw = config->opt_float("support_bottom_z_distance"); double top_gap = std::round(top_gap_raw / layer_height) * layer_height; @@ -468,7 +468,18 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con apply(config, &new_conf); is_msg_dlg_already_exist = false; } - + + if (config->opt_enum("seam_slope_type") != SeamScarfType::None && + config->get_abs_value("seam_slope_start_height") >= layer_height) { + const wxString msg_text = _(L("seam_slope_start_height need to be smaller than layer_height.\nReset to 0.")); + 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(0, false)); + apply(config, &new_conf); + is_msg_dlg_already_exist = false; + } } void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std::vector const &keys, std::map const &configs)