mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-14 19:21:50 +08:00
avoid crossing perimeters on all layers except first layer #198
This commit is contained in:
parent
97ae2826b9
commit
2e48f4a4bd
@ -22,7 +22,10 @@ group:Quality (slower slicing)
|
|||||||
end_line
|
end_line
|
||||||
setting:only_one_perimeter_top
|
setting:only_one_perimeter_top
|
||||||
setting:ensure_vertical_shell_thickness
|
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
|
setting:thin_perimeters
|
||||||
line:Thin walls
|
line:Thin walls
|
||||||
setting:thin_walls
|
setting:thin_walls
|
||||||
|
@ -3662,7 +3662,8 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
|
|||||||
if (needs_retraction
|
if (needs_retraction
|
||||||
&& m_config.avoid_crossing_perimeters
|
&& m_config.avoid_crossing_perimeters
|
||||||
&& ! m_avoid_crossing_perimeters.disable_once
|
&& ! 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);
|
travel = m_avoid_crossing_perimeters.travel_to(*this, point);
|
||||||
|
|
||||||
// check again whether the new travel path still needs a retraction
|
// check again whether the new travel path still needs a retraction
|
||||||
|
@ -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.
|
// or they are only notes not influencing the generated G-code.
|
||||||
static std::unordered_set<std::string> steps_gcode = {
|
static std::unordered_set<std::string> steps_gcode = {
|
||||||
"avoid_crossing_perimeters",
|
"avoid_crossing_perimeters",
|
||||||
|
"avoid_crossing_not_first_layer",
|
||||||
"bed_shape",
|
"bed_shape",
|
||||||
"bed_temperature",
|
"bed_temperature",
|
||||||
"chamber_temperature",
|
"chamber_temperature",
|
||||||
|
@ -152,6 +152,14 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->mode = comExpert;
|
def->mode = comExpert;
|
||||||
def->set_default_value(new ConfigOptionBool(false));
|
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 = this->add("bed_temperature", coInts);
|
||||||
def->label = L("Other layers");
|
def->label = L("Other layers");
|
||||||
def->category = OptionCategory::filament;
|
def->category = OptionCategory::filament;
|
||||||
|
@ -953,6 +953,7 @@ public:
|
|||||||
static double min_object_distance(const ConfigBase *config);
|
static double min_object_distance(const ConfigBase *config);
|
||||||
|
|
||||||
ConfigOptionBool avoid_crossing_perimeters;
|
ConfigOptionBool avoid_crossing_perimeters;
|
||||||
|
ConfigOptionBool avoid_crossing_not_first_layer;
|
||||||
ConfigOptionPoints bed_shape;
|
ConfigOptionPoints bed_shape;
|
||||||
ConfigOptionInts bed_temperature;
|
ConfigOptionInts bed_temperature;
|
||||||
ConfigOptionFloat bridge_acceleration;
|
ConfigOptionFloat bridge_acceleration;
|
||||||
@ -1033,6 +1034,7 @@ protected:
|
|||||||
this->MachineEnvelopeConfig::initialize(cache, base_ptr);
|
this->MachineEnvelopeConfig::initialize(cache, base_ptr);
|
||||||
this->GCodeConfig::initialize(cache, base_ptr);
|
this->GCodeConfig::initialize(cache, base_ptr);
|
||||||
OPT_PTR(avoid_crossing_perimeters);
|
OPT_PTR(avoid_crossing_perimeters);
|
||||||
|
OPT_PTR(avoid_crossing_not_first_layer);
|
||||||
OPT_PTR(bed_shape);
|
OPT_PTR(bed_shape);
|
||||||
OPT_PTR(bed_temperature);
|
OPT_PTR(bed_temperature);
|
||||||
OPT_PTR(bridge_acceleration);
|
OPT_PTR(bridge_acceleration);
|
||||||
|
@ -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("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;
|
bool have_infill = config->option<ConfigOptionPercent>("fill_density")->value > 0;
|
||||||
// infill_extruder uses the same logic as in Print::extruders()
|
// infill_extruder uses the same logic as in Print::extruders()
|
||||||
for (auto el : { "fill_pattern", "infill_every_layers", "infill_only_where_needed",
|
for (auto el : { "fill_pattern", "infill_every_layers", "infill_only_where_needed",
|
||||||
|
@ -427,6 +427,7 @@ const std::vector<std::string>& Preset::print_options()
|
|||||||
"extra_perimeters",
|
"extra_perimeters",
|
||||||
"extra_perimeters_odd_layers",
|
"extra_perimeters_odd_layers",
|
||||||
"only_one_perimeter_top", "ensure_vertical_shell_thickness", "avoid_crossing_perimeters",
|
"only_one_perimeter_top", "ensure_vertical_shell_thickness", "avoid_crossing_perimeters",
|
||||||
|
"avoid_crossing_not_first_layer",
|
||||||
"thin_perimeters",
|
"thin_perimeters",
|
||||||
"thin_walls", "overhangs",
|
"thin_walls", "overhangs",
|
||||||
"overhangs_width",
|
"overhangs_width",
|
||||||
|
@ -1598,6 +1598,7 @@ void TabPrint::build()
|
|||||||
optgroup->append_single_option_line("only_one_perimeter_top");
|
optgroup->append_single_option_line("only_one_perimeter_top");
|
||||||
optgroup->append_single_option_line("ensure_vertical_shell_thickness");
|
optgroup->append_single_option_line("ensure_vertical_shell_thickness");
|
||||||
optgroup->append_single_option_line("avoid_crossing_perimeters");
|
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");
|
optgroup->append_single_option_line("thin_perimeters");
|
||||||
line = { _(L("Thin walls")), "" };
|
line = { _(L("Thin walls")), "" };
|
||||||
line.append_option(optgroup->get_option("thin_walls"));
|
line.append_option(optgroup->get_option("thin_walls"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user