option for no z-lift on top solid infill.

This commit is contained in:
supermerill 2019-01-03 19:56:30 +01:00
parent a48e190137
commit b053a23e1e
7 changed files with 25 additions and 12 deletions

View File

@ -2482,15 +2482,15 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
{ {
if (path.role() != m_last_extrusion_role) if (path.role() != m_last_extrusion_role)
{ {
m_last_extrusion_role = path.role();
if (m_enable_extrusion_role_markers) if (m_enable_extrusion_role_markers)
{ {
char buf[32]; 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; gcode += buf;
} }
} }
} }
m_last_extrusion_role = path.role();
// adds analyzer tags and updates analyzer's tracking data // adds analyzer tags and updates analyzer's tracking data
if (m_enable_analyzer) if (m_enable_analyzer)
@ -2665,7 +2665,7 @@ std::string GCode::retract(bool toolchange)
methods even if we performed wipe, since this will ensure the entire retraction methods even if we performed wipe, since this will ensure the entire retraction
length is honored in case wipe path was too short. */ length is honored in case wipe path was too short. */
gcode += toolchange ? m_writer.retract_for_toolchange() : m_writer.retract(); gcode += toolchange ? m_writer.retract_for_toolchange() : m_writer.retract();
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) if (m_writer.extruder()->retract_length() > 0 || m_config.use_firmware_retraction)
gcode += m_writer.lift(); gcode += m_writer.lift();

View File

@ -153,6 +153,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
"retract_lift", "retract_lift",
"retract_lift_above", "retract_lift_above",
"retract_lift_below", "retract_lift_below",
"retract_lift_not_last_layer",
"retract_restart_extra", "retract_restart_extra",
"retract_restart_extra_toolchange", "retract_restart_extra_toolchange",
"retract_speed", "retract_speed",

View File

@ -1825,6 +1825,13 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->default_value = new ConfigOptionFloats { 0. }; 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 = this->add("retract_restart_extra", coFloats);
def->label = L("Extra length on restart"); def->label = L("Extra length on restart");
def->tooltip = L("When the retraction is compensated after the travel move, the extruder will push " def->tooltip = L("When the retraction is compensated after the travel move, the extruder will push "

View File

@ -677,6 +677,7 @@ public:
ConfigOptionFloats retract_lift; ConfigOptionFloats retract_lift;
ConfigOptionFloats retract_lift_above; ConfigOptionFloats retract_lift_above;
ConfigOptionFloats retract_lift_below; ConfigOptionFloats retract_lift_below;
ConfigOptionBool retract_lift_not_last_layer;
ConfigOptionFloats retract_restart_extra; ConfigOptionFloats retract_restart_extra;
ConfigOptionFloats retract_restart_extra_toolchange; ConfigOptionFloats retract_restart_extra_toolchange;
ConfigOptionFloats retract_speed; ConfigOptionFloats retract_speed;
@ -747,6 +748,7 @@ protected:
OPT_PTR(retract_lift); OPT_PTR(retract_lift);
OPT_PTR(retract_lift_above); OPT_PTR(retract_lift_above);
OPT_PTR(retract_lift_below); OPT_PTR(retract_lift_below);
OPT_PTR(retract_lift_not_last_layer);
OPT_PTR(retract_restart_extra); OPT_PTR(retract_restart_extra);
OPT_PTR(retract_restart_extra_toolchange); OPT_PTR(retract_restart_extra_toolchange);
OPT_PTR(retract_speed); OPT_PTR(retract_speed);

View File

@ -405,7 +405,9 @@ const std::vector<std::string>& Preset::nozzle_options()
// ConfigOptionFloats, ConfigOptionPercents, ConfigOptionBools, ConfigOptionStrings // ConfigOptionFloats, ConfigOptionPercents, ConfigOptionBools, ConfigOptionStrings
static std::vector<std::string> s_opts { static std::vector<std::string> s_opts {
"nozzle_diameter", "min_layer_height", "max_layer_height", "extruder_offset", "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_before_wipe", "retract_restart_extra", "retract_before_travel", "wipe",
"retract_layer_change", "retract_length_toolchange", "retract_restart_extra_toolchange", "extruder_colour", "retract_layer_change", "retract_length_toolchange", "retract_restart_extra_toolchange", "extruder_colour",
"default_filament_profile" "default_filament_profile"

View File

@ -252,7 +252,7 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre
std::string out; std::string out;
if (layer_height <= 0.f){ 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; return out;
} }
@ -269,14 +269,14 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre
if (num_perimeters > 0) { if (num_perimeters > 0) {
int num_lines = std::min(num_perimeters * 2, 10); int num_lines = std::min(num_perimeters * 2, 10);
char buf[MIN_BUF_LENGTH/*256*/]; 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; out += buf;
// Start with the width of two closely spaced // Start with the width of two closely spaced
double width = external_perimeter_flow.width + external_perimeter_flow.spacing(); double width = external_perimeter_flow.width + external_perimeter_flow.spacing();
for (int i = 2; i <= num_lines; thin_walls ? ++ i : i += 2) { for (int i = 2; i <= num_lines; thin_walls ? ++ i : i += 2) {
if (i > 2) if (i > 2)
out += ", "; out += ", ";
sprintf(buf, _CHB(L("%d lines: %.2lf mm")), i, width); sprintf(buf, _CHB(L("%d perimeter: %.2lf mm")), i/2, width);
out += buf; out += buf;
width += perimeter_flow.spacing() * (thin_walls ? 1.f : 2.f); width += perimeter_flow.spacing() * (thin_walls ? 1.f : 2.f);
} }

View File

@ -2189,6 +2189,7 @@ void TabPrinter::build_extruder_pages()
Line line = { _(L("Only lift Z")), "" }; 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_above", extruder_idx));
line.append_option(optgroup->get_option("retract_lift_below", 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_line(line);
optgroup->append_single_option_line("retract_speed", extruder_idx); 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 // retract lift above / below only applies if using retract lift
vec.resize(0); 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) for (auto el : vec)
get_field(el, i)->toggle(retraction && m_config->opt_float("retract_lift", i) > 0); get_field(el, i)->toggle(retraction && m_config->opt_float("retract_lift", i) > 0);