From af59ae71c19e70c4de4b95a233ae3acfbb2d89d8 Mon Sep 17 00:00:00 2001 From: supermerill Date: Mon, 20 Dec 2021 15:00:04 +0100 Subject: Reworked speeds: same layout as the new acceleration * also make sparse fill speed/accel depends on solid fill instead of the opposite * remove max_literal check if value is 0 * added default_speed, working as a reference value for the first column if they use a %. --- src/libslic3r/Config.hpp | 4 +- src/libslic3r/GCode.cpp | 218 ++++++++++++++++--------- src/libslic3r/Preset.cpp | 9 +- src/libslic3r/PrintConfig.cpp | 197 +++++++++++++--------- src/libslic3r/PrintConfig.hpp | 16 +- src/slic3r/GUI/CalibrationRetractionDialog.cpp | 14 +- src/slic3r/GUI/ConfigManipulation.cpp | 7 + src/slic3r/GUI/Field.cpp | 2 +- src/slic3r/GUI/PresetHints.cpp | 33 ++-- 9 files changed, 313 insertions(+), 187 deletions(-) (limited to 'src') diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index 9c172a493..5ecd25ff2 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -1844,7 +1844,9 @@ public: // By setting min=0, only nonnegative input is allowed. double min = INT_MIN; double max = INT_MAX; - // To check if it's not a typo and a % is missing + // To check if it's not a typo and a % is missing. Ask for confirmation if the value is higher than that. + // if negative, if it's lower than the opposite. + // if percentage, multiply by the nozzle_diameter. FloatOrPercent max_literal = FloatOrPercent{ 0., false }; // max precision after the dot, only for display int precision = 6; diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index b092bb3b9..d8c6d6285 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -523,6 +523,8 @@ std::string WipeTowerIntegration::post_process_wipe_tower_moves(const WipeTower: #define EXTRUDER_CONFIG_WITH_DEFAULT(OPT,DEF) (m_writer.tool_is_extruder()?m_config.OPT.get_at(m_writer.tool()->id()):DEF) #define BOOL_EXTRUDER_CONFIG(OPT) m_writer.tool_is_extruder() && m_config.OPT.get_at(m_writer.tool()->id()) +constexpr float SMALL_PERIMETER_SPEED_RATIO_OFFSET = (-10); + // Collect pairs of object_layer + support_layer sorted by print_z. // object_layer & support_layer are considered to be on the same print_z, if they are not further than EPSILON. std::vector GCode::collect_layers_to_print(const PrintObject& object) @@ -768,34 +770,31 @@ namespace DoExport { excluded.insert(erMixed); excluded.insert(erNone); excluded.insert(erWipeTower); - if (config->option("perimeter_speed") != nullptr && config->option("perimeter_speed")->getFloat() != 0 - && config->option("small_perimeter_speed") != nullptr && config->option("small_perimeter_speed")->getFloat() != 0) { + if (config->option("perimeter_speed") != nullptr && config->get_computed_value("perimeter_speed") != 0) { excluded.insert(erPerimeter); excluded.insert(erSkirt); } - if (config->option("external_perimeter_speed") != nullptr && config->option("external_perimeter_speed")->getFloat() != 0 - && config->option("small_perimeter_speed") != nullptr && config->option("small_perimeter_speed")->getFloat() != 0) + if (config->option("external_perimeter_speed") != nullptr && config->get_computed_value("external_perimeter_speed") != 0) excluded.insert(erExternalPerimeter); - if (config->option("overhangs_speed") != nullptr && config->option("overhangs_speed")->getFloat() != 0 - && config->option("small_perimeter_speed") != nullptr && config->option("small_perimeter_speed")->getFloat() != 0) + if (config->option("overhangs_speed") != nullptr && config->get_computed_value("overhangs_speed") != 0) excluded.insert(erOverhangPerimeter); - if (config->option("gap_fill_speed") != nullptr && config->option("gap_fill_speed")->getFloat() != 0) + if (config->option("gap_fill_speed") != nullptr && config->get_computed_value("gap_fill_speed") != 0) excluded.insert(erGapFill); - if (config->option("thin_walls_speed") != nullptr && config->option("thin_walls_speed")->getFloat() != 0) + if (config->option("thin_walls_speed") != nullptr && config->get_computed_value("thin_walls_speed") != 0) excluded.insert(erThinWall); - if (config->option("infill_speed") != nullptr && config->option("infill_speed")->getFloat() != 0) + if (config->option("infill_speed") != nullptr && config->get_computed_value("infill_speed") != 0) excluded.insert(erInternalInfill); - if (config->option("solid_infill_speed") != nullptr && config->option("solid_infill_speed")->getFloat() != 0) + if (config->option("solid_infill_speed") != nullptr && config->get_computed_value("solid_infill_speed") != 0) excluded.insert(erSolidInfill); - if (config->option("top_solid_infill_speed") != nullptr && config->option("top_solid_infill_speed")->getFloat() != 0) + if (config->option("top_solid_infill_speed") != nullptr && config->get_computed_value("top_solid_infill_speed") != 0) excluded.insert(erTopSolidInfill); - if (config->option("bridge_speed") != nullptr && config->option("bridge_speed")->getFloat() != 0) + if (config->option("bridge_speed") != nullptr && config->get_computed_value("bridge_speed") != 0) excluded.insert(erBridgeInfill); - if (config->option("bridge_speed_internal") != nullptr && config->option("bridge_speed_internal")->getFloat() != 0) + if (config->option("bridge_speed_internal") != nullptr && config->get_computed_value("bridge_speed_internal") != 0) excluded.insert(erInternalBridgeInfill); - if (config->option("support_material_speed") != nullptr && config->option("support_material_speed")->getFloat() != 0) + if (config->option("support_material_speed") != nullptr && config->get_computed_value("support_material_speed") != 0) excluded.insert(erSupportMaterial); - if (config->option("support_material_interface_speed") != nullptr && config->option("support_material_interface_speed")->getFloat() != 0) + if (config->option("support_material_interface_speed") != nullptr && config->get_computed_value("support_material_interface_speed") != 0) excluded.insert(erSupportMaterialInterface); } virtual void use(const ExtrusionPath& path) override { @@ -2969,16 +2968,16 @@ std::string GCode::extrude_loop_vase(const ExtrusionLoop &original_loop, const s if (paths.empty()) return ""; // apply the small/external? perimeter speed - if (speed == -1 && is_perimeter(paths.front().role())){ + if (speed == -1 && is_perimeter(paths.front().role()) && paths.front().role() != erThinWall){ coordf_t min_length = scale_d(this->m_config.small_perimeter_min_length.get_abs_value(EXTRUDER_CONFIG_WITH_DEFAULT(nozzle_diameter, 0))); coordf_t max_length = scale_d(this->m_config.small_perimeter_max_length.get_abs_value(EXTRUDER_CONFIG_WITH_DEFAULT(nozzle_diameter, 0))); max_length = std::max(min_length, max_length); if (loop.length() < max_length) { if (loop.length() <= min_length) { - speed = m_config.small_perimeter_speed.get_abs_value(m_config.perimeter_speed); + speed = SMALL_PERIMETER_SPEED_RATIO_OFFSET; } else if (max_length > min_length) { //use a negative speed: it will be use as a ratio when computing the real speed - speed = -(loop.length() - min_length) / (max_length - min_length); + speed = SMALL_PERIMETER_SPEED_RATIO_OFFSET - (loop.length() - min_length) / (max_length - min_length); } } } @@ -3303,15 +3302,16 @@ std::string GCode::extrude_loop(const ExtrusionLoop &original_loop, const std::s if (paths.empty()) return ""; // apply the small perimeter speed - if (speed == -1 && is_perimeter(paths.front().role()) && loop.length() <= - scale_(this->m_config.small_perimeter_max_length.get_abs_value(EXTRUDER_CONFIG_WITH_DEFAULT(nozzle_diameter, 0)))) { + if (speed == -1 && is_perimeter(paths.front().role()) && paths.front().role() != erThinWall) { double min_length = scale_d(this->m_config.small_perimeter_min_length.get_abs_value(EXTRUDER_CONFIG_WITH_DEFAULT(nozzle_diameter, 0))); double max_length = scale_d(this->m_config.small_perimeter_max_length.get_abs_value(EXTRUDER_CONFIG_WITH_DEFAULT(nozzle_diameter, 0))); - if (loop.length() <= min_length) { - speed = m_config.small_perimeter_speed.get_abs_value(m_config.perimeter_speed); - } else { - //set speed between -1 and 0 you have to multiply the real peed by the opposite of that, and add the other part as small_perimeter_speed - speed = (min_length - loop.length()) / (max_length - min_length); + if (loop.length() < max_length) { + if (loop.length() <= min_length) { + speed = SMALL_PERIMETER_SPEED_RATIO_OFFSET; + } else if (max_length > min_length) { + //use a negative speed: it will be use as a ratio when computing the real speed + speed = SMALL_PERIMETER_SPEED_RATIO_OFFSET - (loop.length() - min_length) / (max_length - min_length); + } } } @@ -3869,8 +3869,10 @@ double_t GCode::_compute_speed_mm_per_sec(const ExtrusionPath& path, double spee float factor = 1; // set speed if (speed < 0) { - //if speed == -1, then it's means "choose yourself, but if it's -1 < speed <0 , then it's a scaling from small_perimeter. - factor = float(-speed); + //if speed == -1, then it's means "choose yourself, but if it's < SMALL_PERIMETER_SPEED_RATIO_OFFSET, then it's a scaling from small_perimeter. + if (speed <= SMALL_PERIMETER_SPEED_RATIO_OFFSET) { + factor = float(-speed + SMALL_PERIMETER_SPEED_RATIO_OFFSET); + } //it's a bit hacky, so if you want to rework it, help yourself. if (path.role() == erPerimeter) { speed = m_config.get_computed_value("perimeter_speed"); @@ -3905,30 +3907,43 @@ double_t GCode::_compute_speed_mm_per_sec(const ExtrusionPath& path, double spee if (m_volumetric_speed != 0. && speed == 0) { //if m_volumetric_speed, use the max size for thinwall & gapfill, to avoid variations double vol_speed = m_volumetric_speed / path.mm3_per_mm; - if (vol_speed > m_config.max_print_speed.value) - vol_speed = m_config.max_print_speed.value; + double max_print_speed = m_config.get_computed_value("max_print_speed"); + if (vol_speed > max_print_speed) + vol_speed = max_print_speed; // if using a % of an auto speed, use the % over the volumetric speed. - if (path.role() == erExternalPerimeter) { + if (path.role() == erPerimeter) { + speed = m_config.perimeter_speed.get_abs_value(vol_speed); + } else if (path.role() == erExternalPerimeter) { speed = m_config.external_perimeter_speed.get_abs_value(vol_speed); + } else if (path.role() == erBridgeInfill) { + speed = m_config.bridge_speed.get_abs_value(vol_speed); } else if (path.role() == erInternalBridgeInfill) { speed = m_config.bridge_speed_internal.get_abs_value(vol_speed); } else if (path.role() == erOverhangPerimeter) { speed = m_config.overhangs_speed.get_abs_value(vol_speed); + } else if (path.role() == erInternalInfill) { + speed = m_config.infill_speed.get_abs_value(vol_speed); } else if (path.role() == erSolidInfill) { speed = m_config.solid_infill_speed.get_abs_value(vol_speed); } else if (path.role() == erTopSolidInfill) { speed = m_config.top_solid_infill_speed.get_abs_value(vol_speed); + } else if (path.role() == erThinWall) { + speed = m_config.thin_walls_speed.get_abs_value(vol_speed); + } else if (path.role() == erGapFill) { + speed = m_config.gap_fill_speed.get_abs_value(vol_speed); + } else if (path.role() == erIroning) { + speed = m_config.ironing_speed.get_abs_value(vol_speed); } if (speed == 0) { speed = vol_speed; } } - if (speed == 0) // this code shouldn't trigger as if it's 0, you have to get a m_volumetric_speed + if (speed == 0) // if you don't have a m_volumetric_speed speed = m_config.max_print_speed.value; // Apply small perimeter 'modifier // don't modify bridge speed if (factor < 1 && !(is_bridge(path.role()))) { - float small_speed = (float)m_config.small_perimeter_speed.get_abs_value(m_config.perimeter_speed); + float small_speed = (float)m_config.small_perimeter_speed.get_abs_value(m_config.get_computed_value("perimeter_speed")); //apply factor between feature speed and small speed speed = (speed * factor) + double((1.f - factor) * small_speed); } @@ -3979,74 +3994,123 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string switch (path.role()){ case erPerimeter: perimeter: - if (m_config.perimeter_acceleration.value > 0) - acceleration = m_config.get_computed_value("perimeter_acceleration"); + if (m_config.perimeter_acceleration.value > 0) { + double perimeter_acceleration = m_config.get_computed_value("perimeter_acceleration"); + if (perimeter_acceleration > 0) + acceleration = perimeter_acceleration; + } break; case erExternalPerimeter: externalPerimeter: - if (m_config.external_perimeter_acceleration.value > 0) - acceleration = m_config.get_computed_value("external_perimeter_acceleration"); - else goto perimeter; - break; - case erInternalInfill: - internalInfill: - if (m_config.infill_acceleration.value > 0) - acceleration = m_config.get_computed_value("infill_acceleration"); - break; + if (m_config.external_perimeter_acceleration.value > 0) { + double external_perimeter_acceleration = m_config.get_computed_value("external_perimeter_acceleration"); + if (external_perimeter_acceleration > 0) { + acceleration = external_perimeter_acceleration; + break; + } + } + goto perimeter; case erSolidInfill: solidInfill: - if (m_config.solid_infill_acceleration.value > 0) - acceleration = m_config.get_computed_value("solid_infill_acceleration"); - else goto internalInfill; + if (m_config.solid_infill_acceleration.value > 0) { + double solid_infill_acceleration = m_config.get_computed_value("solid_infill_acceleration"); + if (solid_infill_acceleration > 0) + acceleration = solid_infill_acceleration; + } break; + case erInternalInfill: + internalInfill: + if (m_config.infill_acceleration.value > 0) { + double infill_acceleration = m_config.get_computed_value("infill_acceleration"); + if (infill_acceleration > 0) { + acceleration = infill_acceleration; + break; + } + } + goto solidInfill; case erTopSolidInfill: topSolidInfill: - if (m_config.top_solid_infill_acceleration.value > 0) - acceleration = m_config.get_computed_value("top_solid_infill_acceleration"); - else goto solidInfill; - break; + if (m_config.top_solid_infill_acceleration.value > 0) { + double top_solid_infill_acceleration = m_config.get_computed_value("top_solid_infill_acceleration"); + if (top_solid_infill_acceleration > 0) { + acceleration = top_solid_infill_acceleration; + break; + } + } + goto solidInfill; case erIroning: - if (m_config.ironing_acceleration.value > 0) - acceleration = m_config.get_computed_value("ironing_acceleration"); - else goto topSolidInfill; - break; + if (m_config.ironing_acceleration.value > 0) { + double ironing_acceleration = m_config.get_computed_value("ironing_acceleration"); + if (ironing_acceleration > 0) { + acceleration = ironing_acceleration; + break; + } + } + goto topSolidInfill; case erSupportMaterial: case erSkirt: case erWipeTower: supportMaterial: - if (m_config.support_material_acceleration.value > 0) - acceleration = m_config.get_computed_value("support_material_acceleration"); + if (m_config.support_material_acceleration.value > 0) { + double support_material_acceleration = m_config.get_computed_value("support_material_acceleration"); + if (support_material_acceleration > 0) + acceleration = support_material_acceleration; + } break; case erSupportMaterialInterface: - if (m_config.support_material_interface_acceleration.value > 0) - acceleration = m_config.get_computed_value("support_material_interface_acceleration"); - else goto supportMaterial; - break; + if (m_config.support_material_interface_acceleration.value > 0) { + double support_material_interface_acceleration = m_config.get_computed_value("support_material_interface_acceleration"); + if (support_material_interface_acceleration > 0) { + acceleration = support_material_interface_acceleration; + break; + } + } + goto supportMaterial; case erBridgeInfill: bridgeInfill: - if (m_config.bridge_acceleration.value > 0) - acceleration = m_config.get_computed_value("bridge_acceleration"); + if (m_config.bridge_acceleration.value > 0) { + double bridge_acceleration = m_config.get_computed_value("bridge_acceleration"); + if (bridge_acceleration > 0) + acceleration = bridge_acceleration; + } break; case erInternalBridgeInfill: - if (m_config.bridge_internal_acceleration.value > 0) - acceleration = m_config.get_computed_value("bridge_internal_acceleration"); - else goto bridgeInfill; - break; + if (m_config.bridge_internal_acceleration.value > 0) { + double bridge_internal_acceleration = m_config.get_computed_value("bridge_internal_acceleration"); + if (bridge_internal_acceleration > 0) { + acceleration = bridge_internal_acceleration; + break; + } + } + goto bridgeInfill; case erOverhangPerimeter: - if (m_config.overhangs_acceleration.value > 0) - acceleration = m_config.get_computed_value("overhangs_acceleration"); - else goto bridgeInfill; - break; + if (m_config.overhangs_acceleration.value > 0) { + double overhangs_acceleration = m_config.get_computed_value("overhangs_acceleration"); + if (overhangs_acceleration > 0) { + acceleration = overhangs_acceleration; + break; + } + } + goto bridgeInfill; case erGapFill: - if (m_config.gap_fill_acceleration.value > 0) - acceleration = m_config.get_computed_value("gap_fill_acceleration"); - else goto internalInfill; + if (m_config.gap_fill_acceleration.value > 0) { + double gap_fill_acceleration = m_config.get_computed_value("gap_fill_acceleration"); + if (gap_fill_acceleration > 0) { + acceleration = gap_fill_acceleration; + break; + } + } + goto perimeter; break; case erThinWall: - if (m_config.thin_walls_acceleration.value > 0) - acceleration = m_config.get_computed_value("thin_walls_acceleration"); - else goto externalPerimeter; - break; + if (m_config.thin_walls_acceleration.value > 0) { + double thin_walls_acceleration = m_config.get_computed_value("thin_walls_acceleration"); + if (thin_walls_acceleration > 0) { + acceleration = thin_walls_acceleration; + break; + } + } + goto externalPerimeter; case erMilling: case erCustom: case erMixed: diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index eac3cdffd..f230f9fe5 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -491,17 +491,16 @@ const std::vector& Preset::print_options() "fill_angle_increment", "bridge_angle", "solid_infill_below_area", "only_retract_when_crossing_perimeters", "infill_first", - "max_print_speed", - "max_volumetric_speed", "avoid_crossing_perimeters_max_detour", #ifdef HAS_PRESSURE_EQUALIZER "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative", #endif /* HAS_PRESSURE_EQUALIZER */ "min_width_top_surface", + // speeds + "default_speed", "bridge_speed", "bridge_speed_internal", - // speeds - "external_perimeter_speed", + "external_perimeter_speed", "first_layer_speed", "first_layer_min_speed", "infill_speed", @@ -515,6 +514,8 @@ const std::vector& Preset::print_options() "support_material_xy_spacing", "top_solid_infill_speed", "travel_speed", "travel_speed_z", + "max_print_speed", + "max_volumetric_speed", // gapfill "gap_fill", "gap_fill_last", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index ebfa8f8ce..7a0903bf0 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -442,16 +442,19 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionPercent(90)); - def = this->add("bridge_speed", coFloat); + def = this->add("bridge_speed", coFloatOrPercent); def->label = L("Bridges"); def->full_label = L("Bridge speed"); def->category = OptionCategory::speed; - def->tooltip = L("Speed for printing bridges."); - def->sidetext = L("mm/s"); + def->tooltip = L("Speed for printing bridges." + "\nThis can be expressed as a percentage (for example: 60%) over the Default speed." + "\nSet zero to use the autospeed for this feature"); + def->sidetext = L("mm/s or %"); def->aliases = { "bridge_feed_rate" }; + def->ratio_over = "default_speed"; def->min = 0; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(60)); + def->set_default_value(new ConfigOptionFloatOrPercent(60, true)); def = this->add("bridge_speed_internal", coFloatOrPercent); def->label = L("Internal bridges"); @@ -461,7 +464,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm/s or %"); def->ratio_over = "bridge_speed"; def->min = 0; - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionFloatOrPercent(150,true)); def = this->add("brim_inside_holes", coBool); @@ -685,15 +688,15 @@ void PrintConfigDef::init_fff_params() def->category = OptionCategory::speed; def->full_label = L("Default acceleration"); def->tooltip = L("This is the acceleration your printer will be reset to after " - "the role-specific acceleration values are used (perimeter/infill). " - "\nYou can set it as a % of the max of the X machine acceleration limit." - "\nSet zero to prevent resetting acceleration at all."); + "the role-specific acceleration values are used (perimeter/infill). " + "\nThis can be expressed as a percentage (for example: 80%) over the machine Max Acceleration for X axis." + "\nSet zero to prevent resetting acceleration at all."); def->sidetext = L("mm/s² or %"); def->ratio_over = "machine_max_acceleration_x"; def->min = 0; def->max_literal = { -200, false }; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloatOrPercent(0,false)); + def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); def = this->add("default_filament_profile", coStrings); def->label = L("Default filament profile"); @@ -709,6 +712,19 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionString()); def->cli = ConfigOptionDef::nocli; + def = this->add("default_speed", coFloatOrPercent); + def->label = L("Default"); + def->category = OptionCategory::speed; + def->full_label = L("Default speed"); + def->tooltip = L("This is the reference speed that other 'main' speed can reference to by a %. This setting doesn't do anythign by itself" + "\nThis can be expressed as a percentage (for example: 80%) over the machine Max Feedrate for X axis." + "\nSet zero to use autospeed for speed fields using a % of this setting."); + def->sidetext = L("mm/s or %"); + def->ratio_over = "machine_max_feedrate_x"; + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloatOrPercent(100, false)); + def = this->add("disable_fan_first_layers", coInts); def->label = L("Disable fan for the first"); def->category = OptionCategory::cooling; @@ -1023,12 +1039,12 @@ void PrintConfigDef::init_fff_params() def->full_label = L("External perimeters speed"); def->category = OptionCategory::speed; def->tooltip = L("This separate setting will affect the speed of external perimeters (the visible ones). " - "If expressed as percentage (for example: 80%) it will be calculated " - "on the perimeters speed setting above. Set to zero for auto."); + "\nIf expressed as percentage (for example: 80%) it will be calculated over the Internal Perimeters speed setting." + "\nSet zero to use autospeed for this feature."); def->sidetext = L("mm/s or %"); def->ratio_over = "perimeter_speed"; def->min = 0; - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionFloatOrPercent(50, true)); def = this->add("external_perimeters_first", coBool); @@ -2080,10 +2096,10 @@ void PrintConfigDef::init_fff_params() def->full_label = L("Gap fill acceleration"); def->category = OptionCategory::speed; def->tooltip = L("This is the acceleration your printer will use for gap fills. " - "\nCan be a % of the infill acceleration" - "\nSet zero to use infill acceleration for gap fills."); + "\nThis can be expressed as a percentage over the perimeter acceleration." + "\nSet zero to use perimeter acceleration for gap fills."); def->sidetext = L("mm/s² or %"); - def->ratio_over = "infill_acceleration"; + def->ratio_over = "perimeter_acceleration"; def->min = 0; def->max_literal = { -200, false }; def->mode = comExpert; @@ -2120,17 +2136,19 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionPercent(100)); - def = this->add("gap_fill_speed", coFloat); + def = this->add("gap_fill_speed", coFloatOrPercent); def->label = L("Gap fill"); def->full_label = L("Gap fill speed"); def->category = OptionCategory::speed; def->tooltip = L("Speed for filling small gaps using short zigzag moves. Keep this reasonably low " "to avoid too much shaking and resonance issues." - "\nGap fill extrusions are ignored from the automatic volumetric speed computation, unless you set it to 0."); - def->sidetext = L("mm/s"); + "\nGap fill extrusions are ignored from the automatic volumetric speed computation, unless you set it to 0." + "\nThis can be expressed as a percentage (for example: 80%) over the Internal Perimeter speed."); + def->sidetext = L("mm/s or %"); + def->ratio_over = "perimeter_speed"; def->min = 0; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(20)); + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloatOrPercent(50,true)); def = this->add("gcode_comments", coBool); def->label = L("Verbose G-code"); @@ -2232,11 +2250,11 @@ void PrintConfigDef::init_fff_params() def->label = L("Sparse"); def->full_label = L("Infill acceleration"); def->category = OptionCategory::speed; - def->tooltip = L("This is the acceleration your printer will use for infill." - "\nCan be a % of the default acceleration" - "\nSet zero to use default acceleration for infill."); + def->tooltip = L("This is the acceleration your printer will use for Sparse infill." + "\nCan be a % of the solid infill acceleration" + "\nSet zero to use solid infill acceleration for infill."); def->sidetext = L("mm/s² or %"); - def->ratio_over = "default_acceleration"; + def->ratio_over = "solid_infill_acceleration"; def->min = 0; def->max_literal = { -200, false }; def->mode = comAdvanced; @@ -2476,16 +2494,19 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloatOrPercent(25, true)); - def = this->add("infill_speed", coFloat); + def = this->add("infill_speed", coFloatOrPercent); def->label = L("Sparse"); def->full_label = L("Sparse infill speed"); def->category = OptionCategory::speed; - def->tooltip = L("Speed for printing the internal fill. Set to zero for auto."); - def->sidetext = L("mm/s"); + def->tooltip = L("Speed for printing the internal fill." + "\nThis can be expressed as a percentage (for example: 80%) over the Solid Infill speed." + "\nSet zero to use autospeed for this feature."); + def->sidetext = L("mm/s or %"); + def->ratio_over = "solid_infill_speed"; def->aliases = { "print_feed_rate", "infill_feed_rate" }; def->min = 0; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(80)); + def->set_default_value(new ConfigOptionFloatOrPercent(300, true)); def = this->add("inherits", coString); def->label = L("Inherits profile"); @@ -2522,7 +2543,7 @@ void PrintConfigDef::init_fff_params() def->full_label = L("Ironing acceleration"); def->category = OptionCategory::speed; def->tooltip = L("This is the acceleration your printer will use for ironing. " - "\nCan be a % of the top layer infill acceleration" + "\nCan be a % of the top solid infill acceleration" "\nSet zero to use top solid infill acceleration for ironing."); def->sidetext = L("mm/s² or %"); def->ratio_over = "top_solid_infill_acceleration"; @@ -2576,15 +2597,16 @@ void PrintConfigDef::init_fff_params() def = this->add("ironing_speed", coFloatOrPercent); def->label = L("Ironing"); + def->full_label = L("Ironing speed"); def->category = OptionCategory::ironing; def->tooltip = L("Ironing speed. Used for the ironing pass of the ironing infill pattern, and the post-process infill." - " Can be defined as mm.s, or a % of the top solid infill speed." + "\nThis can be expressed as a percentage (for example: 80%) over the Top Solid Infill speed." "\nIroning extrusions are ignored from the automatic volumetric speed computation."); def->sidetext = L("mm/s"); def->ratio_over = "top_solid_infill_speed"; def->min = 0.1; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloatOrPercent(15, false)); + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloatOrPercent(50, true)); def = this->add("layer_gcode", coString); def->label = L("After layer change G-code"); @@ -2877,16 +2899,19 @@ void PrintConfigDef::init_fff_params() def->is_vector_extruder = true; def->set_default_value(new ConfigOptionFloatsOrPercents{ FloatOrPercent{ 75, true} }); - def = this->add("max_print_speed", coFloat); + def = this->add("max_print_speed", coFloatOrPercent); def->label = L("Max print speed"); + def->full_label = L("Max print speed for Autospeed"); def->category = OptionCategory::speed; def->tooltip = L("When setting other speed settings to 0, Slic3r will autocalculate the optimal speed " "in order to keep constant extruder pressure. This experimental setting is used " - "to set the highest print speed you want to allow."); - def->sidetext = L("mm/s"); + "to set the highest print speed you want to allow." + "\nThis can be expressed as a percentage (for example: 100%) over the machine Max Feedrate for X axis."); + def->sidetext = L("mm/s or %"); + def->ratio_over = "machine_max_acceleration_x"; def->min = 1; def->mode = comExpert; - def->set_default_value(new ConfigOptionFloat(80)); + def->set_default_value(new ConfigOptionFloatOrPercent(80, false)); def = this->add("max_speed_reduction", coPercents); def->label = L("Max speed reduction"); @@ -2900,10 +2925,12 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionPercents{ 90 }); def = this->add("max_volumetric_speed", coFloat); - def->label = L("Max volumetric speed"); + def->label = L("Volumetric speed"); + def->full_label = L("Volumetric speed for Autospeed"); def->category = OptionCategory::extruders; - def->tooltip = L("This experimental setting is used to set the maximum volumetric speed your " - "extruder supports."); + def->tooltip = L("This setting allow you to set the desired flow rate for the autospeed algorithm. It tries to keep a constant feedrate for the entire object." + "\nThe autospeed is only enable on speed field that have a value of 0. If a speed field is a % of a 0 field, then it will be a % of the value it should have got from the autospeed." + "\nIf this field is set to 0, then there is no autospeed. If a speed value i still set to 0, it will get the max speed"); def->sidetext = L("mm³/s"); def->min = 0; def->mode = comExpert; @@ -3147,11 +3174,13 @@ void PrintConfigDef::init_fff_params() def->label = L("Overhangs"); def->full_label = L("Overhangs speed"); def->category = OptionCategory::speed; - def->tooltip = L("Speed for printing overhangs.\nCan be a % of the bridge speed."); + def->tooltip = L("Speed for printing overhangs." + "\nCan be a % of the bridge speed." + "\nSet zero to use autospeed for this feature."); def->sidetext = L("mm/s"); def->ratio_over = "bridge_speed"; def->min = 0; - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); def = this->add("overhangs_width_speed", coFloatOrPercent); @@ -3309,16 +3338,19 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(100, true, false)); - def = this->add("perimeter_speed", coFloat); + def = this->add("perimeter_speed", coFloatOrPercent); def->label = L("Internal"); def->full_label = L("Internal perimeters speed"); def->category = OptionCategory::speed; - def->tooltip = L("Speed for perimeters (contours, aka vertical shells). Set to zero for auto."); - def->sidetext = L("mm/s"); + def->tooltip = L("Speed for perimeters (contours, aka vertical shells)." + "\nThis can be expressed as a percentage (for example: 80%) over the Default speed." + "\nSet zero to use autospeed for this feature."); + def->sidetext = L("mm/s or %"); def->aliases = { "perimeter_feed_rate" }; + def->ratio_over = "default_speed"; def->min = 0; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(60)); + def->set_default_value(new ConfigOptionFloatOrPercent(60, true)); def = this->add("perimeters", coInt); def->label = L("Perimeters"); @@ -3760,14 +3792,13 @@ void PrintConfigDef::init_fff_params() def->label = L("Speed"); def->full_label = L("Small perimeters speed"); def->category = OptionCategory::speed; - def->tooltip = L("This separate setting will affect the speed of perimeters having radius <= 6.5mm " - "(usually holes). If expressed as percentage (for example: 80%) it will be calculated " - "on the perimeters speed setting above. Set to zero for auto."); + def->tooltip = L("This separate setting will affect the speed of perimeters having radius <= 6.5mm (usually holes)." + "\nIf expressed as percentage (for example: 80%) it will be calculated on the Internal Perimeters speed setting above. Set zero for auto."); def->sidetext = L("mm/s or %"); def->ratio_over = "perimeter_speed"; def->min = 0; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloatOrPercent(15, false)); + def->set_default_value(new ConfigOptionFloatOrPercent(50, true)); def = this->add("small_perimeter_min_length", coFloatOrPercent); def->label = L("Min length"); @@ -3921,14 +3952,14 @@ void PrintConfigDef::init_fff_params() def->full_label = L("Solid infill speed"); def->category = OptionCategory::speed; def->tooltip = L("Speed for printing solid regions (top/bottom/internal horizontal shells). " - "This can be expressed as a percentage (for example: 80%) over the default infill speed." - " Set to zero for auto."); + "\nThis can be expressed as a percentage (for example: 80%) over the Default speed." + "\nSet zero to use autospeed for this feature."); def->sidetext = L("mm/s or %"); - def->ratio_over = "infill_speed"; + def->ratio_over = "default_speed"; def->aliases = { "solid_infill_feed_rate" }; def->min = 0; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloatOrPercent(20, false)); + def->set_default_value(new ConfigOptionFloatOrPercent(30, true)); def = this->add("solid_layers", coInt); def->label = L("Solid layers"); @@ -4078,13 +4109,13 @@ void PrintConfigDef::init_fff_params() def->full_label = L("Solid acceleration"); def->category = OptionCategory::speed; def->tooltip = L("This is the acceleration your printer will use for solid infills. " - "\nCan be a % of the infill acceleration" - "\nSet zero to use infill acceleration for solid infills."); + "\nCan be a % of the default acceleration" + "\nSet zero to use default acceleration for solid infills."); def->sidetext = L("mm/s² or %"); - def->ratio_over = "infill_acceleration"; + def->ratio_over = "default_acceleration"; def->min = 0; def->max_literal = { -200, false }; - def->mode = comExpert; + def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(0,false)); def = this->add("solid_over_perimeters", coInt); @@ -4301,13 +4332,14 @@ void PrintConfigDef::init_fff_params() def->label = L("Interface"); def->full_label = L("Support interface speed"); def->category = OptionCategory::support; - def->tooltip = L("Speed for printing support material interface layers. If expressed as percentage " - "(for example 50%) it will be calculated over support material speed."); + def->tooltip = L("Speed for printing support material interface layers." + "\nIf expressed as percentage (for example 50%) it will be calculated over support material speed." + "\nSet zero to use autospeed for this feature."); def->sidetext = L("mm/s or %"); def->ratio_over = "support_material_speed"; def->min = 0; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloatOrPercent(50, true)); def = this->add("support_material_pattern", coEnum); def->label = L("Pattern"); @@ -4356,15 +4388,18 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(2.5)); - def = this->add("support_material_speed", coFloat); + def = this->add("support_material_speed", coFloatOrPercent); def->label = L("Default"); def->full_label = L("Support speed"); def->category = OptionCategory::support; - def->tooltip = L("Speed for printing support material."); - def->sidetext = L("mm/s"); + def->tooltip = L("Speed for printing support material." + "\nThis can be expressed as a percentage (for example: 80%) over the Default speed." + "\nSet zero to use autospeed for this feature."); + def->sidetext = L("mm/s or %"); + def->ratio_over = "default_speed"; def->min = 0; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(60)); + def->set_default_value(new ConfigOptionFloatOrPercent(60, true)); def = this->add("support_material_synchronize_layers", coBool); def->label = L("Synchronize with object layers"); @@ -4497,15 +4532,18 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloatOrPercent(0,false)); - def = this->add("thin_walls_speed", coFloat); + def = this->add("thin_walls_speed", coFloatOrPercent); def->label = L("Thin walls"); def->full_label = L("Thin walls speed"); def->category = OptionCategory::speed; - def->tooltip = L("Speed for thin walls (external extrusions that are alone because the obect is too thin at these places)."); - def->sidetext = L("mm/s"); + def->tooltip = L("Speed for thin walls (external extrusions that are alone because the obect is too thin at these places)." + "\nThis can be expressed as a percentage (for example: 80%) over the External Perimeter speed." + "\nSet zero to use autospeed for this feature."); + def->sidetext = L("mm/s or %"); + def->ratio_over = "external_perimeter_speed"; def->min = 0; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(30)); + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); def = this->add("threads", coInt); def->label = L("Threads"); @@ -4594,7 +4632,7 @@ void PrintConfigDef::init_fff_params() def->ratio_over = "solid_infill_acceleration"; def->min = 0; def->max_literal = { -200, false }; - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionFloatOrPercent(0,false)); def = this->add("top_solid_infill_speed", coFloatOrPercent); @@ -4603,14 +4641,14 @@ void PrintConfigDef::init_fff_params() def->category = OptionCategory::speed; def->tooltip = L("Speed for printing top solid layers (it only applies to the uppermost " "external layers and not to their internal solid layers). You may want " - "to slow down this to get a nicer surface finish. This can be expressed " - "as a percentage (for example: 80%) over the solid infill speed above. " - "Set to zero for auto."); + "to slow down this to get a nicer surface finish." + "\nThis can be expressed as a percentage (for example: 80%) over the Solid Infill speed." + "\nSet zero to use autospeed for this feature."); def->sidetext = L("mm/s or %"); def->ratio_over = "solid_infill_speed"; def->min = 0; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloatOrPercent(15, false)); + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloatOrPercent(50, true)); def = this->add("top_solid_layers", coInt); //TRN To be shown in Print Settings "Top solid layers" @@ -6120,6 +6158,7 @@ std::unordered_set prusa_export_to_remove_keys = { "curve_smoothing_angle_convex", "curve_smoothing_cutoff_dist", "curve_smoothing_precision", +"default_speed", "enforce_full_fill_volume", "exact_last_layer_height", "external_infill_margin", @@ -6301,8 +6340,10 @@ void PrintConfigDef::to_prusa(t_config_option_key& opt_key, std::string& value, } } else if ("elephant_foot_min_width" == opt_key) { opt_key = "elefant_foot_min_width"; - } else if("first_layer_acceleration" == opt_key || "infill_acceleration" == opt_key || "bridge_acceleration" == opt_key || "default_acceleration" == opt_key || "perimeter_acceleration" == opt_key - || "overhangs_speed" == opt_key || "ironing_speed" == opt_key){ + } else if ("first_layer_acceleration" == opt_key || "infill_acceleration" == opt_key || "bridge_acceleration" == opt_key || "default_acceleration" == opt_key || "perimeter_acceleration" == opt_key + || "overhangs_speed" == opt_key || "ironing_speed" == opt_key || "perimeter_speed" == opt_key || "infill_speed" == opt_key || "bridge_speed" == opt_key || "support_material_speed" == opt_key + || "max_print_speed" == opt_key + ) { // remove '%' if (value.find("%") != std::string::npos) { value = std::to_string(all_conf.get_computed_value(opt_key)); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 692251610..c2416d66c 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -702,7 +702,7 @@ public: ConfigOptionEnum support_material_pattern; // Spacing between support material lines (the hatching distance). ConfigOptionFloat support_material_spacing; - ConfigOptionFloat support_material_speed; + ConfigOptionFloatOrPercent support_material_speed; ConfigOptionBool support_material_solid_first_layer; ConfigOptionBool support_material_synchronize_layers; // Overhang angle threshold. @@ -793,12 +793,13 @@ public: ConfigOptionPercent bridge_overlap_min; ConfigOptionEnum bottom_fill_pattern; ConfigOptionFloatOrPercent bridged_infill_margin; - ConfigOptionFloat bridge_speed; + ConfigOptionFloatOrPercent bridge_speed; ConfigOptionFloatOrPercent bridge_speed_internal; ConfigOptionFloat curve_smoothing_precision; ConfigOptionFloat curve_smoothing_cutoff_dist; ConfigOptionFloat curve_smoothing_angle_convex; ConfigOptionFloat curve_smoothing_angle_concave; + ConfigOptionFloatOrPercent default_speed; ConfigOptionBool ensure_vertical_shell_thickness; ConfigOptionBool enforce_full_fill_volume; ConfigOptionFloatOrPercent external_infill_margin; @@ -826,7 +827,7 @@ public: ConfigOptionBool gap_fill_last; ConfigOptionFloatOrPercent gap_fill_min_area; ConfigOptionPercent gap_fill_overlap; - ConfigOptionFloat gap_fill_speed; + ConfigOptionFloatOrPercent gap_fill_speed; ConfigOptionFloatOrPercent infill_anchor; ConfigOptionFloatOrPercent infill_anchor_max; ConfigOptionBool hole_to_polyhole; @@ -836,7 +837,7 @@ public: ConfigOptionFloatOrPercent infill_extrusion_width; ConfigOptionInt infill_every_layers; ConfigOptionFloatOrPercent infill_overlap; - ConfigOptionFloat infill_speed; + ConfigOptionFloatOrPercent infill_speed; ConfigOptionEnum infill_connection; ConfigOptionEnum infill_connection_solid; ConfigOptionEnum infill_connection_top; @@ -870,7 +871,7 @@ public: ConfigOptionBool perimeter_loop; ConfigOptionEnum perimeter_loop_seam; ConfigOptionPercent perimeter_overlap; - ConfigOptionFloat perimeter_speed; + ConfigOptionFloatOrPercent perimeter_speed; // Total number of perimeters. ConfigOptionInt perimeters; ConfigOptionPercent print_extrusion_multiplier; @@ -892,7 +893,7 @@ public: ConfigOptionBool thin_walls; ConfigOptionFloatOrPercent thin_walls_min_width; ConfigOptionFloatOrPercent thin_walls_overlap; - ConfigOptionFloat thin_walls_speed; + ConfigOptionFloatOrPercent thin_walls_speed; ConfigOptionEnum top_fill_pattern; ConfigOptionFloatOrPercent top_infill_extrusion_width; ConfigOptionInt top_solid_layers; @@ -918,6 +919,7 @@ protected: OPT_PTR(curve_smoothing_cutoff_dist); OPT_PTR(curve_smoothing_angle_convex); OPT_PTR(curve_smoothing_angle_concave); + OPT_PTR(default_speed); OPT_PTR(ensure_vertical_shell_thickness); OPT_PTR(enforce_full_fill_volume); OPT_PTR(external_infill_margin); @@ -1133,7 +1135,7 @@ public: ConfigOptionString layer_gcode; ConfigOptionString feature_gcode; ConfigOptionFloat max_gcode_per_second; - ConfigOptionFloat max_print_speed; + ConfigOptionFloatOrPercent max_print_speed; ConfigOptionFloat max_volumetric_speed; #ifdef HAS_PRESSURE_EQUALIZER ConfigOptionFloat max_volumetric_extrusion_rate_slope_positive; diff --git a/src/slic3r/GUI/CalibrationRetractionDialog.cpp b/src/slic3r/GUI/CalibrationRetractionDialog.cpp index 1de3f179c..53d63cf5a 100644 --- a/src/slic3r/GUI/CalibrationRetractionDialog.cpp +++ b/src/slic3r/GUI/CalibrationRetractionDialog.cpp @@ -139,6 +139,10 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) { const DynamicPrintConfig* print_config = this->gui_app->get_tab(Preset::TYPE_FFF_PRINT)->get_config(); const DynamicPrintConfig* printer_config = this->gui_app->get_tab(Preset::TYPE_PRINTER)->get_config(); const DynamicPrintConfig* filament_config = this->gui_app->get_tab(Preset::TYPE_FFF_FILAMENT)->get_config(); + DynamicPrintConfig full_print_config; + full_print_config.apply(*print_config); + full_print_config.apply(*printer_config); + full_print_config.apply(*filament_config); double retraction_start = 0; std::string str = temp_start->GetValue().ToStdString(); @@ -208,8 +212,8 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) { /// --- custom config --- for (size_t i = 0; i < nb_items; i++) { //speed - double perimeter_speed = print_config->option("perimeter_speed")->value; - double external_perimeter_speed = print_config->option("external_perimeter_speed")->get_abs_value(perimeter_speed); + double perimeter_speed = full_print_config.get_computed_value("perimeter_speed"); + double external_perimeter_speed = full_print_config.get_computed_value("external_perimeter_speed"); //brim to have some time to build up pressure in the nozzle model.objects[objs_idx[i]]->config.set_key_value("brim_width", new ConfigOptionFloat(0)); model.objects[objs_idx[i]]->config.set_key_value("perimeters", new ConfigOptionInt(2)); @@ -236,10 +240,10 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) { for (ModelObject* part : part_tower[i]) { model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("print_retract_length", new ConfigOptionFloat(retraction_start + num_part * retraction_steps)); model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("small_perimeter_speed", new ConfigOptionFloatOrPercent(external_perimeter_speed, false)); - model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("perimeter_speed", new ConfigOptionFloat(std::min(external_perimeter_speed, perimeter_speed))); + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("perimeter_speed", new ConfigOptionFloatOrPercent(std::min(external_perimeter_speed, perimeter_speed), false)); model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("external_perimeter_speed", new ConfigOptionFloatOrPercent(external_perimeter_speed, false)); - model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("small_perimeter_speed", new ConfigOptionFloatOrPercent(external_perimeter_speed, false)); - //model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("infill_speed", new ConfigOptionFloat(std::min(print_config->option("infill_speed")->value, 10.*scale))); + //model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("small_perimeter_speed", new ConfigOptionFloatOrPercent(external_perimeter_speed, false)); + //model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("infill_speed", new ConfigOptionFloatOrPercent(std::min(print_config->option("infill_speed")->value, 10.*scale)), false); num_part++; } } diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 3a72ca246..dd90cea9f 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -495,6 +495,13 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) toggle_field("support_material_interface_acceleration", have_default_acceleration && have_support_material && have_support_interface); for (auto el : { "bridge_acceleration", "bridge_internal_acceleration", "overhangs_acceleration", "gap_fill_acceleration", "travel_acceleration", "travel_deceleration_use_target", "first_layer_acceleration" }) toggle_field(el, have_default_acceleration); + + // for default speed, it needs at least a dependent field with a % + toggle_field("default_speed", config->option("perimeter_speed")->percent || + config->option("solid_infill_speed")->percent || + config->option("bridge_speed")->percent || + config->option("support_material_speed")->percent); + toggle_field("max_print_speed", config->opt_float("max_volumetric_speed") != 0); } void ConfigManipulation::update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config/* = false*/) diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 0bc236e43..6854ce05c 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -482,7 +482,7 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true set_value(double_to_string(val, m_opt.precision), true); } else if (m_value.empty() || std::string(str.ToUTF8().data()) != boost::any_cast(m_value)) { bool not_ok = (m_opt.sidetext.rfind("mm/s") != std::string::npos && val > m_opt.max); - if (!not_ok && m_opt.max_literal.value != 0) { + if (!not_ok && m_opt.max_literal.value != 0 && val != 0) { if (m_opt.max_literal.percent) { const DynamicPrintConfig& printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config; const std::vector& nozzle_diameters = printer_config.option("nozzle_diameter")->values; diff --git a/src/slic3r/GUI/PresetHints.cpp b/src/slic3r/GUI/PresetHints.cpp index 11931d155..e46589b97 100644 --- a/src/slic3r/GUI/PresetHints.cpp +++ b/src/slic3r/GUI/PresetHints.cpp @@ -184,22 +184,27 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle float nozzle_diameter = (float)printer_config.opt_float("nozzle_diameter", idx_extruder); // Print config values + DynamicPrintConfig full_print_config; + full_print_config.apply(print_config); + full_print_config.apply(filament_config); + full_print_config.apply(printer_config); + if(full_print_config.option("extruder") == nullptr) full_print_config.set("extruder", 0, true); // hint for first extruder if not present double layer_height = print_config.opt_float("layer_height"); - double first_layer_height = print_config.get_abs_value("first_layer_height", layer_height); - double support_material_speed = print_config.opt_float("support_material_speed"); - double support_material_interface_speed = print_config.get_abs_value("support_material_interface_speed", support_material_speed); - double bridge_speed = print_config.opt_float("bridge_speed"); - double bridge_flow_ratio = print_config.opt_float("bridge_flow_ratio"); - double over_bridge_flow_ratio = print_config.opt_float("over_bridge_flow_ratio"); - double perimeter_speed = print_config.opt_float("perimeter_speed"); - double external_perimeter_speed = print_config.get_abs_value("external_perimeter_speed", perimeter_speed); - // double gap_fill_speed = print_config.opt_float("gap_fill_speed"); - double infill_speed = print_config.opt_float("infill_speed"); - double small_perimeter_speed = print_config.get_abs_value("small_perimeter_speed", perimeter_speed); - double solid_infill_speed = print_config.get_abs_value("solid_infill_speed", infill_speed); - double top_solid_infill_speed = print_config.get_abs_value("top_solid_infill_speed", solid_infill_speed); + double first_layer_height = full_print_config.get_computed_value("first_layer_height"); + double support_material_speed = full_print_config.get_computed_value("support_material_speed"); + double support_material_interface_speed = full_print_config.get_computed_value("support_material_interface_speed"); + double bridge_speed = full_print_config.get_computed_value("bridge_speed"); + double bridge_flow_ratio = full_print_config.get_computed_value("bridge_flow_ratio"); + double over_bridge_flow_ratio = full_print_config.get_computed_value("over_bridge_flow_ratio"); + double perimeter_speed = full_print_config.get_computed_value("perimeter_speed"); + double external_perimeter_speed = full_print_config.get_computed_value("external_perimeter_speed"); + // double gap_fill_speed = full_print_config.get_computed_value("gap_fill_speed"); + double infill_speed = full_print_config.get_computed_value("infill_speed"); + double small_perimeter_speed = full_print_config.get_computed_value("small_perimeter_speed"); + double solid_infill_speed = full_print_config.get_computed_value("solid_infill_speed"); + double top_solid_infill_speed = full_print_config.get_computed_value("top_solid_infill_speed"); // Maximum print speed when auto-speed is enabled by setting any of the above speed values to zero. - double max_print_speed = print_config.opt_float("max_print_speed"); + double max_print_speed = full_print_config.get_computed_value("max_print_speed"); // Maximum volumetric speed allowed for the print profile. double max_volumetric_speed = print_config.opt_float("max_volumetric_speed"); -- cgit v1.2.3