From 5c0afd5e84a1f85329fe1c566963d578852a6c37 Mon Sep 17 00:00:00 2001 From: Kiss Lorand <50251547+kisslorand@users.noreply.github.com> Date: Sun, 13 Apr 2025 13:32:18 +0800 Subject: [PATCH] Skirt settings GUI fixes (#9325) --- src/slic3r/GUI/ConfigManipulation.cpp | 112 +++++++++++++------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 35584dabfc..359ad92766 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -328,7 +328,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con msg_text += "\n\n" + _(L("Change these settings automatically? \n" "Yes - Change ensure vertical shell thickness to Moderate and enable alternate extra wall\n" "No - Don't use alternate extra wall")); - + MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | (is_global_config ? wxYES | wxNO : wxOK)); DynamicPrintConfig new_conf = *config; @@ -490,9 +490,9 @@ void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std:: void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, const bool is_global_config) { PresetBundle *preset_bundle = wxGetApp().preset_bundle; - + auto gcflavor = preset_bundle->printers.get_edited_preset().config.option>("gcode_flavor")->value; - + bool have_volumetric_extrusion_rate_slope = config->option("max_volumetric_extrusion_rate_slope")->value > 0; float have_volumetric_extrusion_rate_slope_segment_length = config->option("max_volumetric_extrusion_rate_slope_segment_length")->value; toggle_field("enable_arc_fitting", !have_volumetric_extrusion_rate_slope); @@ -504,26 +504,26 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co new_conf.set_key_value("max_volumetric_extrusion_rate_slope_segment_length", new ConfigOptionFloat(1)); apply(config, &new_conf); } - + bool have_perimeters = config->opt_int("wall_loops") > 0; for (auto el : { "extra_perimeters_on_overhangs", "ensure_vertical_shell_thickness", "detect_thin_wall", "detect_overhang_wall", "seam_position", "staggered_inner_seams", "wall_sequence", "outer_wall_line_width", "inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "small_perimeter_threshold" }) toggle_field(el, have_perimeters); - + bool have_infill = config->option("sparse_infill_density")->value > 0; // sparse_infill_filament uses the same logic as in Print::extruders() for (auto el : { "sparse_infill_pattern", "infill_combination", "minimum_sparse_infill_area", "sparse_infill_filament", "infill_anchor_max"}) toggle_line(el, have_infill); - + bool have_combined_infill = config->opt_bool("infill_combination") && have_infill; toggle_line("infill_combination_max_layer_height", have_combined_infill); - + // Only allow configuration of open anchors if the anchoring is enabled. bool has_infill_anchors = have_infill && config->option("infill_anchor_max")->value > 0; toggle_field("infill_anchor", has_infill_anchors); - + bool has_spiral_vase = config->opt_bool("spiral_mode"); toggle_line("spiral_mode_smooth", has_spiral_vase); toggle_line("spiral_mode_max_xy_smoothing", has_spiral_vase && config->opt_bool("spiral_mode_smooth")); @@ -534,41 +534,41 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co bool has_solid_infill = has_top_shell || has_bottom_shell; toggle_field("top_surface_pattern", has_top_shell); toggle_field("bottom_surface_pattern", has_bottom_shell); - + for (auto el : { "infill_direction", "sparse_infill_line_width", - "sparse_infill_speed", "bridge_speed", "internal_bridge_speed", "bridge_angle","internal_bridge_angle", + "sparse_infill_speed", "bridge_speed", "internal_bridge_speed", "bridge_angle", "internal_bridge_angle", "solid_infill_direction", "rotate_solid_infill_direction", "internal_solid_infill_pattern", "solid_infill_filament", }) toggle_field(el, have_infill || has_solid_infill); - + toggle_field("top_shell_thickness", ! has_spiral_vase && has_top_shell); toggle_field("bottom_shell_thickness", ! has_spiral_vase && has_bottom_shell); 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); - + for (auto el : { "top_surface_line_width", "top_surface_speed" }) toggle_field(el, has_top_shell || (has_spiral_vase && has_bottom_shell)); - + bool have_default_acceleration = config->opt_float("default_acceleration") > 0; - + for (auto el : {"outer_wall_acceleration", "inner_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "travel_acceleration", "bridge_acceleration", "sparse_infill_acceleration", "internal_solid_infill_acceleration"}) toggle_field(el, have_default_acceleration); - + bool have_default_jerk = config->opt_float("default_jerk") > 0; - - for (auto el : { "outer_wall_jerk", "inner_wall_jerk", "initial_layer_jerk", "top_surface_jerk","travel_jerk", "infill_jerk"}) + + for (auto el : { "outer_wall_jerk", "inner_wall_jerk", "initial_layer_jerk", "top_surface_jerk", "travel_jerk", "infill_jerk"}) toggle_field(el, have_default_jerk); - + bool have_skirt = config->opt_int("skirt_loops") > 0; toggle_field("skirt_height", have_skirt && config->opt_enum("draft_shield") != dsEnabled); - toggle_line("single_loop_draft_shield", have_skirt && config->opt_enum("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", "single_loop_draft_shield"}) - toggle_field(el, have_skirt); - + toggle_line("single_loop_draft_shield", have_skirt); // ORCA: Display one wall if skirt enabled + for (auto el : {"skirt_type", "min_skirt_length", "skirt_distance", "skirt_start_angle", "skirt_speed", "draft_shield"}) + toggle_field(el, have_skirt); + bool have_brim = (config->opt_enum("brim_type") != btNoBrim); toggle_field("brim_object_gap", have_brim); bool have_brim_width = (config->opt_enum("brim_type") != btNoBrim) && config->opt_enum("brim_type") != btAutoBrim && @@ -576,7 +576,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co toggle_field("brim_width", have_brim_width); // wall_filament uses the same logic as in Print::extruders() toggle_field("wall_filament", have_perimeters || have_brim); - + bool have_brim_ear = (config->opt_enum("brim_type") == btEar); const auto brim_width = config->opt_float("brim_width"); // disable brim_ears_max_angle and brim_ears_detection_length if brim_width is 0 @@ -585,13 +585,13 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co // hide brim_ears_max_angle and brim_ears_detection_length if brim_ear is not selected toggle_line("brim_ears_max_angle", have_brim_ear); toggle_line("brim_ears_detection_length", have_brim_ear); - + // Hide Elephant foot compensation layers if elefant_foot_compensation is not enabled toggle_line("elefant_foot_compensation_layers", config->opt_float("elefant_foot_compensation") > 0); - + bool have_raft = config->opt_int("raft_layers") > 0; bool have_support_material = config->opt_bool("enable_support") || have_raft; - + SupportType support_type = config->opt_enum("support_type"); bool have_support_interface = config->opt_int("support_interface_top_layers") > 0 || config->opt_int("support_interface_bottom_layers") > 0; bool have_support_soluble = have_support_material && config->opt_float("support_top_z_distance") == 0; @@ -600,13 +600,13 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co "support_base_pattern_spacing", "support_expansion", "support_angle", "support_interface_pattern", "support_interface_top_layers", "support_interface_bottom_layers", "bridge_no_support", "max_bridge_length", "support_top_z_distance", "support_bottom_z_distance", - "support_type", "support_on_build_plate_only", "support_critical_regions_only","support_interface_not_for_body", - "support_object_xy_distance","support_object_first_layer_gap"/*, "independent_support_layer_height"*/}) + "support_type", "support_on_build_plate_only", "support_critical_regions_only", "support_interface_not_for_body", + "support_object_xy_distance", "support_object_first_layer_gap"/*, "independent_support_layer_height"*/}) toggle_field(el, have_support_material); toggle_field("support_threshold_angle", have_support_material && is_auto(support_type)); toggle_field("support_threshold_overlap", config->opt_int("support_threshold_angle") == 0 && have_support_material && is_auto(support_type)); //toggle_field("support_closing_radius", have_support_material && support_style == smsSnug); - + bool support_is_tree = config->opt_bool("enable_support") && is_tree(support_type); bool support_is_normal_tree = support_is_tree && support_style != smsTreeOrganic && // Orca: use organic as default @@ -619,49 +619,49 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co for (auto el : {"tree_support_auto_brim", "tree_support_brim_width", "tree_support_adaptive_layer_height"}) toggle_line(el, support_is_normal_tree); // settings specific to organic trees - for (auto el : {"tree_support_branch_angle_organic", "tree_support_branch_distance_organic", "tree_support_branch_diameter_organic","tree_support_angle_slow","tree_support_tip_diameter", "tree_support_top_rate", "tree_support_branch_diameter_angle"}) + for (auto el : {"tree_support_branch_angle_organic", "tree_support_branch_distance_organic", "tree_support_branch_diameter_organic", "tree_support_angle_slow", "tree_support_tip_diameter", "tree_support_top_rate", "tree_support_branch_diameter_angle"}) toggle_line(el, support_is_organic); - + toggle_field("tree_support_brim_width", support_is_tree && !config->opt_bool("tree_support_auto_brim")); // non-organic tree support use max_bridge_length instead of bridge_no_support toggle_line("max_bridge_length", support_is_normal_tree); toggle_line("bridge_no_support", !support_is_normal_tree); - + // This is only supported for auto normal tree toggle_line("support_critical_regions_only", is_auto(support_type) && support_is_normal_tree); - + for (auto el : { "support_interface_spacing", "support_interface_filament", "support_interface_loop_pattern", "support_bottom_interface_spacing" }) toggle_field(el, have_support_material && have_support_interface); - + bool have_skirt_height = have_skirt && (config->opt_int("skirt_height") > 1 || config->opt_enum("draft_shield") != dsEnabled); toggle_line("support_speed", have_support_material || have_skirt_height); toggle_line("support_interface_speed", have_support_material && have_support_interface); - + // BBS //toggle_field("support_material_synchronize_layers", have_support_soluble); - + toggle_field("inner_wall_line_width", have_perimeters || have_skirt || have_brim); toggle_field("support_filament", have_support_material || have_skirt); - + toggle_line("raft_contact_distance", have_raft && !have_support_soluble); - + // Orca: Raft, grid, snug and organic supports use these two parameters to control the size & density of the "brim"/flange for (auto el : { "raft_first_layer_expansion", "raft_first_layer_density"}) toggle_field(el, have_support_material && !(support_is_normal_tree && !have_raft)); - + bool has_ironing = (config->opt_enum("ironing_type") != IroningType::NoIroning); for (auto el : { "ironing_pattern", "ironing_flow", "ironing_spacing", "ironing_speed", "ironing_angle", "ironing_inset"}) toggle_line(el, has_ironing); - + bool have_sequential_printing = (config->opt_enum("print_sequence") == PrintSequence::ByObject); // for (auto el : { "extruder_clearance_radius", "extruder_clearance_height_to_rod", "extruder_clearance_height_to_lid" }) // toggle_field(el, have_sequential_printing); toggle_field("print_order", !have_sequential_printing); toggle_field("single_extruder_multi_material", !is_BBL_Printer); - + auto bSEMM = preset_bundle->printers.get_edited_preset().config.opt_bool("single_extruder_multi_material"); toggle_field("ooze_prevention", !bSEMM); @@ -689,25 +689,25 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co toggle_line("single_extruder_multi_material_priming", !bSEMM && have_prime_tower && !is_BBL_Printer); toggle_line("prime_volume",have_prime_tower && (!purge_in_primetower || !bSEMM)); - + for (auto el : {"flush_into_infill", "flush_into_support", "flush_into_objects"}) toggle_field(el, have_prime_tower); - + // BBS: MusangKing - Hide "Independent support layer height" option toggle_line("independent_support_layer_height", have_support_material && !have_prime_tower); - + bool have_avoid_crossing_perimeters = config->opt_bool("reduce_crossing_wall"); toggle_line("max_travel_detour_distance", have_avoid_crossing_perimeters); - + bool has_overhang_speed = config->opt_bool("enable_overhang_speed"); for (auto el : {"overhang_speed_classic", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed"}) toggle_line(el, has_overhang_speed); - + bool has_overhang_speed_classic = config->opt_bool("overhang_speed_classic"); toggle_line("slowdown_for_curled_perimeters",!has_overhang_speed_classic && has_overhang_speed); - + toggle_line("flush_into_objects", !is_global_config); toggle_line("support_interface_not_for_body",config->opt_int("support_interface_filament")&&!config->opt_int("support_filament")); @@ -715,36 +715,36 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co bool has_fuzzy_skin = (config->opt_enum("fuzzy_skin") != FuzzySkinType::None); for (auto el : { "fuzzy_skin_thickness", "fuzzy_skin_point_distance", "fuzzy_skin_first_layer", "fuzzy_skin_noise_type"}) toggle_line(el, has_fuzzy_skin); - + NoiseType fuzzy_skin_noise_type = config->opt_enum("fuzzy_skin_noise_type"); toggle_line("fuzzy_skin_scale", has_fuzzy_skin && fuzzy_skin_noise_type != NoiseType::Classic); toggle_line("fuzzy_skin_octaves", has_fuzzy_skin && fuzzy_skin_noise_type != NoiseType::Classic && fuzzy_skin_noise_type != NoiseType::Voronoi); toggle_line("fuzzy_skin_persistence", has_fuzzy_skin && (fuzzy_skin_noise_type == NoiseType::Perlin || fuzzy_skin_noise_type == NoiseType::Billow)); - + bool have_arachne = config->opt_enum("wall_generator") == PerimeterGeneratorType::Arachne; for (auto el : { "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle", "min_feature_size", "min_length_factor", "min_bead_width", "wall_distribution_count", "initial_layer_min_bead_width"}) toggle_line(el, have_arachne); toggle_field("detect_thin_wall", !have_arachne); - + // Orca auto is_role_based_wipe_speed = config->opt_bool("role_based_wipe_speed"); toggle_field("wipe_speed",!is_role_based_wipe_speed); - + for (auto el : {"accel_to_decel_enable", "accel_to_decel_factor"}) toggle_line(el, gcflavor == gcfKlipper); if(gcflavor == gcfKlipper) toggle_field("accel_to_decel_factor", config->opt_bool("accel_to_decel_enable")); - + bool have_make_overhang_printable = config->opt_bool("make_overhang_printable"); toggle_line("make_overhang_printable_angle", have_make_overhang_printable); toggle_line("make_overhang_printable_hole_size", have_make_overhang_printable); - + toggle_line("min_width_top_surface", config->opt_bool("only_one_wall_top") || ((config->opt_float("min_length_factor") > 0.5f) && have_arachne)); // 0.5 is default value for (auto el : { "hole_to_polyhole_threshold", "hole_to_polyhole_twisted" }) toggle_line(el, config->opt_bool("hole_to_polyhole")); - + bool has_detect_overhang_wall = config->opt_bool("detect_overhang_wall"); bool has_overhang_reverse = config->opt_bool("overhang_reverse"); bool force_wall_direction = config->opt_enum("wall_direction") != WallDirection::Auto; @@ -765,7 +765,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co bool have_small_area_infill_flow_compensation = config->opt_bool("small_area_infill_flow_compensation"); toggle_line("small_area_infill_flow_compensation_model", have_small_area_infill_flow_compensation); - + toggle_field("seam_slope_type", !has_spiral_vase); bool has_seam_slope = !has_spiral_vase && config->opt_enum("seam_slope_type") != SeamScarfType::None; toggle_line("seam_slope_conditional", has_seam_slope);