Add safety check for seam_slope_start_height

This commit is contained in:
SoftFever
2024-03-16 17:39:14 +08:00
parent 1943259ac3
commit 550c4d6ca1
3 changed files with 18 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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));