avoid crossing perimeters on all layers except first layer #198

This commit is contained in:
supermerill 2020-04-17 20:31:17 +02:00
parent 97ae2826b9
commit 2e48f4a4bd
8 changed files with 23 additions and 4 deletions

View File

@ -22,7 +22,10 @@ group:Quality (slower slicing)
end_line
setting:only_one_perimeter_top
setting:ensure_vertical_shell_thickness
setting:avoid_crossing_perimeters
line:Avoid crossing perimeters
setting:label$:avoid_crossing_perimeters
setting:label$not on first layer:avoid_crossing_not_first_layer
end_line
setting:thin_perimeters
line:Thin walls
setting:thin_walls

View File

@ -3662,7 +3662,8 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
if (needs_retraction
&& m_config.avoid_crossing_perimeters
&& ! m_avoid_crossing_perimeters.disable_once
&& m_avoid_crossing_perimeters.is_init()) {
&& m_avoid_crossing_perimeters.is_init()
&& !(m_config.avoid_crossing_not_first_layer && this->on_first_layer())) {
travel = m_avoid_crossing_perimeters.travel_to(*this, point);
// check again whether the new travel path still needs a retraction

View File

@ -69,6 +69,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
// or they are only notes not influencing the generated G-code.
static std::unordered_set<std::string> steps_gcode = {
"avoid_crossing_perimeters",
"avoid_crossing_not_first_layer",
"bed_shape",
"bed_temperature",
"chamber_temperature",

View File

@ -147,11 +147,19 @@ void PrintConfigDef::init_fff_params()
def->label = L("Avoid crossing perimeters");
def->category = OptionCategory::perimeter;
def->tooltip = L("Optimize travel moves in order to minimize the crossing of perimeters. "
"This is mostly useful with Bowden extruders which suffer from oozing. "
"This feature slows down both the print and the G-code generation.");
"This is mostly useful with Bowden extruders which suffer from oozing. "
"This feature slows down both the print and the G-code generation.");
def->mode = comExpert;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("avoid_crossing_not_first_layer", coBool);
def->label = L("Don't avoid crossing on 1st layer");
def->full_label = L("Don't avoid crossing on 1st layer");
def->category = OptionCategory::perimeter;
def->tooltip = L("Do not use the 'Avoid crossing perimeters' on the first layer.");
def->mode = comExpert;
def->set_default_value(new ConfigOptionBool(true));
def = this->add("bed_temperature", coInts);
def->label = L("Other layers");
def->category = OptionCategory::filament;

View File

@ -953,6 +953,7 @@ public:
static double min_object_distance(const ConfigBase *config);
ConfigOptionBool avoid_crossing_perimeters;
ConfigOptionBool avoid_crossing_not_first_layer;
ConfigOptionPoints bed_shape;
ConfigOptionInts bed_temperature;
ConfigOptionFloat bridge_acceleration;
@ -1033,6 +1034,7 @@ protected:
this->MachineEnvelopeConfig::initialize(cache, base_ptr);
this->GCodeConfig::initialize(cache, base_ptr);
OPT_PTR(avoid_crossing_perimeters);
OPT_PTR(avoid_crossing_not_first_layer);
OPT_PTR(bed_shape);
OPT_PTR(bed_temperature);
OPT_PTR(bridge_acceleration);

View File

@ -309,6 +309,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
toggle_field("gap_fill_min_area", config->opt_bool("gap_fill"));
toggle_field("avoid_crossing_not_first_layer", config->opt_bool("avoid_crossing_perimeters"));
bool have_infill = config->option<ConfigOptionPercent>("fill_density")->value > 0;
// infill_extruder uses the same logic as in Print::extruders()
for (auto el : { "fill_pattern", "infill_every_layers", "infill_only_where_needed",

View File

@ -427,6 +427,7 @@ const std::vector<std::string>& Preset::print_options()
"extra_perimeters",
"extra_perimeters_odd_layers",
"only_one_perimeter_top", "ensure_vertical_shell_thickness", "avoid_crossing_perimeters",
"avoid_crossing_not_first_layer",
"thin_perimeters",
"thin_walls", "overhangs",
"overhangs_width",

View File

@ -1598,6 +1598,7 @@ void TabPrint::build()
optgroup->append_single_option_line("only_one_perimeter_top");
optgroup->append_single_option_line("ensure_vertical_shell_thickness");
optgroup->append_single_option_line("avoid_crossing_perimeters");
optgroup->append_single_option_line("avoid_crossing_not_first_layer");
optgroup->append_single_option_line("thin_perimeters");
line = { _(L("Thin walls")), "" };
line.append_option(optgroup->get_option("thin_walls"));