diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 9d1cb0130d..fa3f5d464b 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3699,7 +3699,8 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } // calculate extrusion length per distance unit - double e_per_mm = m_writer.extruder()->e_per_mm3() * path.mm3_per_mm * this->config().print_flow_ratio.get_abs_value(1); + const auto _mm3_per_mm = path.mm3_per_mm * this->config().print_flow_ratio; + double e_per_mm = m_writer.extruder()->e_per_mm3() * _mm3_per_mm; double min_speed = double(m_config.slow_down_min_speed.get_at(m_writer.extruder()->id())); // set speed @@ -3743,7 +3744,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } //BBS: if not set the speed, then use the filament_max_volumetric_speed directly if (speed == 0) - speed = EXTRUDER_CONFIG(filament_max_volumetric_speed) / path.mm3_per_mm; + speed = EXTRUDER_CONFIG(filament_max_volumetric_speed) / _mm3_per_mm; if (this->on_first_layer()) { //BBS: for solid infill of initial layer, speed can be higher as long as //wall lines have be attached @@ -3757,14 +3758,14 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // // cap speed with max_volumetric_speed anyway (even if user is not using autospeed) // speed = std::min( // speed, - // m_config.max_volumetric_speed.value / path.mm3_per_mm + // m_config.max_volumetric_speed.value / _mm3_per_mm // ); //} if (EXTRUDER_CONFIG(filament_max_volumetric_speed) > 0) { // cap speed with max_volumetric_speed anyway (even if user is not using autospeed) speed = std::min( speed, - EXTRUDER_CONFIG(filament_max_volumetric_speed) / path.mm3_per_mm + EXTRUDER_CONFIG(filament_max_volumetric_speed) / _mm3_per_mm ); } double F = speed * 60; // convert mm/sec to mm/min diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index cd996e3ebf..041f521d48 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1152,16 +1152,16 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloats { 1. }); - def = this->add("print_flow_ratio", coPercent); + def = this->add("print_flow_ratio", coFloat); def->label = L("Flow ratio"); def->tooltip = L("The material may have volumetric change after switching between molten state and crystalline state. " "This setting changes all extrusion flow of this filament in gcode proportionally. " "Recommended value range is between 0.95 and 1.05. " "Maybe you can tune this value to get nice flat surface when there has slight overflow or underflow"); - def->sidetext = L("%"); def->mode = comAdvanced; - def->min = 2; - def->set_default_value(new ConfigOptionPercent(100)); + def->max = 2; + def->min = 0.01; + def->set_default_value(new ConfigOptionFloat(1)); def = this->add("enable_pressure_advance", coBools); def->label = L("Enable pressure advance"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index e8341c2e26..86e18a1c2f 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -755,7 +755,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, only_one_wall_top)) ((ConfigOptionBool, only_one_wall_first_layer)) //SoftFever - ((ConfigOptionPercent, print_flow_ratio)) + ((ConfigOptionFloat, print_flow_ratio)) ) PRINT_CONFIG_CLASS_DEFINE( diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b3f2bdca12..40505849c0 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -8014,7 +8014,7 @@ void Plater::calib_flowrate(int pass) { if (obj_name[0] == 'm') obj_name[0] = '-'; auto modifier = stof(obj_name); - _obj->config.set_key_value("print_flow_ratio", new ConfigOptionPercent(100 + modifier)); + _obj->config.set_key_value("print_flow_ratio", new ConfigOptionFloat(1.0f + modifier/100.f)); } print_config->set_key_value("layer_height", new ConfigOptionFloat(layer_height));