diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 13d4397408e..4704c65f3fc 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2482,15 +2482,15 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, { if (path.role() != m_last_extrusion_role) { - m_last_extrusion_role = path.role(); if (m_enable_extrusion_role_markers) { char buf[32]; - sprintf(buf, ";_EXTRUSION_ROLE:%d\n", int(m_last_extrusion_role)); + sprintf(buf, ";_EXTRUSION_ROLE:%d\n", int(path.role())); gcode += buf; } } } + m_last_extrusion_role = path.role(); // adds analyzer tags and updates analyzer's tracking data if (m_enable_analyzer) @@ -2665,9 +2665,9 @@ std::string GCode::retract(bool toolchange) methods even if we performed wipe, since this will ensure the entire retraction length is honored in case wipe path was too short. */ gcode += toolchange ? m_writer.retract_for_toolchange() : m_writer.retract(); - - if (m_writer.extruder()->retract_length() > 0 || m_config.use_firmware_retraction) - gcode += m_writer.lift(); + if (toolchange || !this->m_config.retract_lift_not_last_layer.value || !(this->m_last_extrusion_role == ExtrusionRole::erTopSolidInfill)) + if (m_writer.extruder()->retract_length() > 0 || m_config.use_firmware_retraction) + gcode += m_writer.lift(); return gcode; } diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index cab1578d8d3..407ad562547 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -153,6 +153,7 @@ bool Print::invalidate_state_by_config_options(const std::vectormode = comAdvanced; def->default_value = new ConfigOptionFloats { 0. }; + def = this->add("retract_lift_not_last_layer", coBool); + def->label = L("Not on top"); + def->category = L("Support material"); + def->tooltip = L("Select this option to not use the z-lift on a top surface."); + def->mode = comAdvanced; + def->default_value = new ConfigOptionBool(false); + def = this->add("retract_restart_extra", coFloats); def->label = L("Extra length on restart"); def->tooltip = L("When the retraction is compensated after the travel move, the extruder will push " diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 0cab334233b..4c88f3a18ef 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -677,6 +677,7 @@ class GCodeConfig : public StaticPrintConfig ConfigOptionFloats retract_lift; ConfigOptionFloats retract_lift_above; ConfigOptionFloats retract_lift_below; + ConfigOptionBool retract_lift_not_last_layer; ConfigOptionFloats retract_restart_extra; ConfigOptionFloats retract_restart_extra_toolchange; ConfigOptionFloats retract_speed; @@ -747,6 +748,7 @@ class GCodeConfig : public StaticPrintConfig OPT_PTR(retract_lift); OPT_PTR(retract_lift_above); OPT_PTR(retract_lift_below); + OPT_PTR(retract_lift_not_last_layer); OPT_PTR(retract_restart_extra); OPT_PTR(retract_restart_extra_toolchange); OPT_PTR(retract_speed); diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index 23d632b0c1f..876bb3b4593 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -405,7 +405,9 @@ const std::vector& Preset::nozzle_options() // ConfigOptionFloats, ConfigOptionPercents, ConfigOptionBools, ConfigOptionStrings static std::vector s_opts { "nozzle_diameter", "min_layer_height", "max_layer_height", "extruder_offset", - "retract_length", "retract_lift", "retract_lift_above", "retract_lift_below", "retract_speed", "deretract_speed", + "retract_length", "retract_lift", "retract_lift_above", "retract_lift_below", + "retract_lift_not_last_layer", + "retract_speed", "deretract_speed", "retract_before_wipe", "retract_restart_extra", "retract_before_travel", "wipe", "retract_layer_change", "retract_length_toolchange", "retract_restart_extra_toolchange", "extruder_colour", "default_filament_profile" diff --git a/src/slic3r/GUI/PresetHints.cpp b/src/slic3r/GUI/PresetHints.cpp index a7becfa1657..01f24097553 100644 --- a/src/slic3r/GUI/PresetHints.cpp +++ b/src/slic3r/GUI/PresetHints.cpp @@ -252,7 +252,7 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre std::string out; if (layer_height <= 0.f){ - out += _CHB(L("Recommended object thin wall thickness: Not available due to invalid layer height.")); + out += _CHB(L("Recommended object min wall thickness: Not available due to invalid layer height.")); return out; } @@ -269,14 +269,14 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre if (num_perimeters > 0) { int num_lines = std::min(num_perimeters * 2, 10); char buf[MIN_BUF_LENGTH/*256*/]; - sprintf(buf, _CHB(L("Recommended object thin wall thickness for layer height %.2f and ")), layer_height); + sprintf(buf, _CHB(L("Recommended object min wall thickness for layer height %.2f and ")), layer_height); out += buf; // Start with the width of two closely spaced double width = external_perimeter_flow.width + external_perimeter_flow.spacing(); for (int i = 2; i <= num_lines; thin_walls ? ++ i : i += 2) { if (i > 2) out += ", "; - sprintf(buf, _CHB(L("%d lines: %.2lf mm")), i, width); + sprintf(buf, _CHB(L("%d perimeter: %.2lf mm")), i/2, width); out += buf; width += perimeter_flow.spacing() * (thin_walls ? 1.f : 2.f); } diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 7c66b8cf103..70751fd5d29 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2187,8 +2187,9 @@ void TabPrinter::build_extruder_pages() optgroup->append_single_option_line("retract_length", extruder_idx); optgroup->append_single_option_line("retract_lift", extruder_idx); Line line = { _(L("Only lift Z")), "" }; - line.append_option(optgroup->get_option("retract_lift_above", extruder_idx)); - line.append_option(optgroup->get_option("retract_lift_below", extruder_idx)); + line.append_option(optgroup->get_option("retract_lift_above", extruder_idx)); + line.append_option(optgroup->get_option("retract_lift_below", extruder_idx)); + line.append_option(optgroup->get_option("retract_lift_not_last_layer", extruder_idx)); optgroup->append_line(line); optgroup->append_single_option_line("retract_speed", extruder_idx); @@ -2319,7 +2320,7 @@ void TabPrinter::update_fff() // retract lift above / below only applies if using retract lift vec.resize(0); - vec = { "retract_lift_above", "retract_lift_below" }; + vec = { "retract_lift_above", "retract_lift_below", "retract_lift_not_last_layer" }; for (auto el : vec) get_field(el, i)->toggle(retraction && m_config->opt_float("retract_lift", i) > 0);