Skip to content

Commit

Permalink
option for no z-lift on top solid infill.
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Jan 3, 2019
1 parent a48e190 commit b053a23
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
"retract_lift",
"retract_lift_above",
"retract_lift_below",
"retract_lift_not_last_layer",
"retract_restart_extra",
"retract_restart_extra_toolchange",
"retract_speed",
Expand Down
7 changes: 7 additions & 0 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,13 @@ void PrintConfigDef::init_fff_params()
def->mode = 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 "
Expand Down
2 changes: 2 additions & 0 deletions src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/slic3r/GUI/Preset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ const std::vector<std::string>& Preset::nozzle_options()
// ConfigOptionFloats, ConfigOptionPercents, ConfigOptionBools, ConfigOptionStrings
static std::vector<std::string> 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"
Expand Down
6 changes: 3 additions & 3 deletions src/slic3r/GUI/PresetHints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
}
Expand Down
7 changes: 4 additions & 3 deletions src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit b053a23

Please sign in to comment.