Skip to content

Commit

Permalink
One wall draft shield options refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
igiannakas committed Mar 5, 2025
1 parent 32f4c05 commit 1c22799
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3541,9 +3541,10 @@ std::string GCode::generate_skirt(const Print &print,
// Decide where to start looping:
// - If it’s the first layer or if we do NOT want a single-wall draft shield,
// start from loops.first (all loops).
// - Otherwise, if one_wall_draft_shield == true (and not the first layer),
// - Otherwise, if one_wall_draft_shield == true and draft_shield == true (and not the first layer),
// start from loops.second - 1 (just one loop).
bool one_wall_draft_shield = print.m_config.one_wall_draft_shield;
bool one_wall_draft_shield = print.m_config.one_wall_draft_shield &&
(print.m_config.draft_shield == dsEnabled);
const size_t start_idx = (first_layer || !one_wall_draft_shield)
? loops.first
: (loops.second - 1);
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4290,8 +4290,8 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionInt(1));

def = this->add("one_wall_draft_shield", coBool);
def->label = L("One wall skirt after first layer");
def->tooltip = L("Limits the skirt loops to one wall after the first skirt layer. This is useful, on occasion, to conserve filament when using a draft shield.");
def->label = L("One wall draft shield");
def->tooltip = L("Limits the draft shield loops to one wall after the first layer. This is useful, on occasion, to conserve filament but may cause the draft shield to warp / crack.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));

Expand Down
5 changes: 3 additions & 2 deletions src/slic3r/GUI/ConfigManipulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,9 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co

bool have_skirt = config->opt_int("skirt_loops") > 0;
toggle_field("skirt_height", have_skirt && config->opt_enum<DraftShield>("draft_shield") != dsEnabled);
for (auto el : {"skirt_type", "skirt_distance", "skirt_start_angle", "draft_shield"})
toggle_field(el, have_skirt);
toggle_line("one_wall_draft_shield", have_skirt && config->opt_enum<DraftShield>("draft_shield") == dsEnabled); // ORCA: Display one wall draft shield if draft shield is enabled and skirt enabled
for (auto el : {"skirt_type","min_skirt_length", "skirt_distance", "skirt_start_angle","skirt_height","skirt_speed", "draft_shield", "one_wall_draft_shield"})
toggle_field(el, have_skirt);

bool have_brim = (config->opt_enum<BrimType>("brim_type") != btNoBrim);
toggle_field("brim_object_gap", have_brim);
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2308,9 +2308,9 @@ page = add_options_page(L("Others"), "custom-gcode_other"); // ORCA: icon only v
optgroup->append_single_option_line("skirt_distance");
optgroup->append_single_option_line("skirt_start_angle");
optgroup->append_single_option_line("skirt_height");
optgroup->append_single_option_line("one_wall_draft_shield");
optgroup->append_single_option_line("skirt_speed");
optgroup->append_single_option_line("draft_shield");
optgroup->append_single_option_line("one_wall_draft_shield");

optgroup = page->new_optgroup(L("Brim"), L"param_adhension");
optgroup->append_single_option_line("brim_type", "auto-brim");
Expand Down

0 comments on commit 1c22799

Please sign in to comment.