Allow specify wall directions (#4156)

* Add wall direction option

* Force wall direction if specified

* Format

* Rename default to auto
This commit is contained in:
Noisyfox 2024-02-23 20:45:56 +08:00 committed by GitHub
parent d82987ca32
commit e4255b3c01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 67 additions and 5 deletions

View file

@ -279,6 +279,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
config->opt_int("enforce_support_layers") == 0 &&
! config->opt_bool("detect_thin_wall") &&
! config->opt_bool("overhang_reverse") &&
config->opt_enum<WallDirection>("wall_direction") == WallDirection::Auto &&
config->opt_enum<TimelapseType>("timelapse_type") == TimelapseType::tlTraditional))
{
wxString msg_text = _(L("Spiral mode only works when wall loops is 1, support is disabled, top shell layers is 0, sparse infill density is 0 and timelapse type is traditional."));
@ -306,6 +307,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
new_conf.set_key_value("enforce_support_layers", new ConfigOptionInt(0));
new_conf.set_key_value("detect_thin_wall", new ConfigOptionBool(false));
new_conf.set_key_value("overhang_reverse", new ConfigOptionBool(false));
new_conf.set_key_value("wall_direction", new ConfigOptionEnum<WallDirection>(WallDirection::Auto));
new_conf.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
sparse_infill_density = 0;
timelapse_type = TimelapseType::tlTraditional;
@ -554,6 +556,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
toggle_field("top_shell_thickness", ! has_spiral_vase && has_top_solid_infill);
toggle_field("bottom_shell_thickness", ! has_spiral_vase && has_bottom_solid_infill);
toggle_field("wall_direction", !has_spiral_vase);
// Gap fill is newly allowed in between perimeter lines even for empty infill (see GH #1476).
toggle_field("gap_infill_speed", have_perimeters);
@ -732,7 +736,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool has_detect_overhang_wall = config->opt_bool("detect_overhang_wall");
bool has_overhang_reverse = config->opt_bool("overhang_reverse");
bool allow_overhang_reverse = has_detect_overhang_wall && !has_spiral_vase;
bool force_wall_direction = config->opt_enum<WallDirection>("wall_direction") != WallDirection::Auto;
bool allow_overhang_reverse = has_detect_overhang_wall && !has_spiral_vase && !force_wall_direction;
toggle_field("overhang_reverse", allow_overhang_reverse);
toggle_line("overhang_reverse_threshold", allow_overhang_reverse && has_overhang_reverse);
toggle_line("overhang_reverse_internal_only", allow_overhang_reverse && has_overhang_reverse);