From 89c58fb4d931fa73c689b3bf76b7290bf5dcb449 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Fri, 1 Aug 2025 19:19:18 +0800 Subject: [PATCH] FIX: add clumping detect area parameter 1. add wrapping detect area parameter 2. fix spiral retract bug 3. modify the enable parameter to print config 4. close clumping detect for manual cali mode jira: STUDIO-13761 & STUDIO-13766 Change-Id: Ib597ca48a0342a8ae3930f5e790085987f252374 (cherry picked from commit 698a5e6bc0b281ba77fc1fd7692daec09cb440b4) --- .../BBL/machine/Bambu Lab H2D 0.4 nozzle.json | 1 - .../BBL/machine/fdm_machine_common.json | 1 - .../BBL/process/fdm_process_common.json | 1 + .../BBL/process/fdm_process_dual_common.json | 1 + src/libslic3r/GCode.cpp | 4 +-- src/libslic3r/ParameterUtils.cpp | 29 ------------------- src/libslic3r/ParameterUtils.hpp | 2 -- src/libslic3r/Preset.cpp | 5 ++-- src/libslic3r/Print.cpp | 4 +-- src/libslic3r/PrintConfig.cpp | 11 +++---- src/libslic3r/PrintConfig.hpp | 2 +- src/slic3r/GUI/ConfigManipulation.cpp | 3 +- src/slic3r/GUI/GLCanvas3D.cpp | 7 ++--- src/slic3r/GUI/GUI.cpp | 2 +- src/slic3r/GUI/OptionsGroup.cpp | 7 +++-- src/slic3r/GUI/PartPlate.cpp | 11 ++++--- src/slic3r/GUI/Plater.cpp | 22 +++++++++----- src/slic3r/GUI/Tab.cpp | 17 +++++------ src/slic3r/GUI/UnsavedChangesDialog.cpp | 2 +- src/slic3r/Utils/CalibUtils.cpp | 2 ++ 20 files changed, 56 insertions(+), 78 deletions(-) diff --git a/resources/profiles/BBL/machine/Bambu Lab H2D 0.4 nozzle.json b/resources/profiles/BBL/machine/Bambu Lab H2D 0.4 nozzle.json index 927c7b1924d..da94061e8b7 100644 --- a/resources/profiles/BBL/machine/Bambu Lab H2D 0.4 nozzle.json +++ b/resources/profiles/BBL/machine/Bambu Lab H2D 0.4 nozzle.json @@ -24,7 +24,6 @@ "0x0,325x0,325x320,0x320", "25x0,350x0,350x320,25x320" ], - "enable_wrapping_detection": "1", "hotend_heating_rate": "3.6", "machine_load_filament_time": "30", "machine_max_speed_e": [ diff --git a/resources/profiles/BBL/machine/fdm_machine_common.json b/resources/profiles/BBL/machine/fdm_machine_common.json index f2543a3950f..35346a87fec 100644 --- a/resources/profiles/BBL/machine/fdm_machine_common.json +++ b/resources/profiles/BBL/machine/fdm_machine_common.json @@ -28,7 +28,6 @@ "extruder_offset": [ "0x0" ], - "enable_wrapping_detection": "0", "gcode_flavor": "marlin", "grab_length": [ "0" diff --git a/resources/profiles/BBL/process/fdm_process_common.json b/resources/profiles/BBL/process/fdm_process_common.json index 7c619f5a36b..0b8527a2a5a 100644 --- a/resources/profiles/BBL/process/fdm_process_common.json +++ b/resources/profiles/BBL/process/fdm_process_common.json @@ -23,6 +23,7 @@ "enable_prime_tower": "1", "enable_support": "0", "enable_circle_compensation": "0", + "enable_wrapping_detection": "0", "filename_format": "{input_filename_base}_{filament_type[0]}_{print_time}.gcode", "gap_infill_speed": "30", "infill_combination": "0", diff --git a/resources/profiles/BBL/process/fdm_process_dual_common.json b/resources/profiles/BBL/process/fdm_process_dual_common.json index 173d694b074..f9d9333d9e6 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_common.json +++ b/resources/profiles/BBL/process/fdm_process_dual_common.json @@ -4,6 +4,7 @@ "inherits": "fdm_process_common", "from": "system", "instantiation": "false", + "enable_wrapping_detection": "1", "bridge_speed": "50", "default_acceleration": "10000", "enable_overhang_speed":"1", diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index e886526895b..9390a61f953 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -4740,7 +4740,7 @@ LayerResult GCode::process_layer( } } - if (!has_insert_wrapping_detection_gcode) { + if (print.config().enable_wrapping_detection && !has_insert_wrapping_detection_gcode) { gcode += this->retract(false, false, auto_lift_type); gcode += insert_wrapping_detection_gcode(); has_insert_wrapping_detection_gcode = true; @@ -4758,7 +4758,7 @@ LayerResult GCode::process_layer( has_insert_timelapse_gcode = true; } - if (!has_insert_wrapping_detection_gcode) { + if (print.config().enable_wrapping_detection && !has_insert_wrapping_detection_gcode) { gcode += this->retract(false, false, auto_lift_type); gcode += insert_wrapping_detection_gcode(); has_insert_wrapping_detection_gcode = true; diff --git a/src/libslic3r/ParameterUtils.cpp b/src/libslic3r/ParameterUtils.cpp index d15f26d7388..2e7b0d1d3cf 100644 --- a/src/libslic3r/ParameterUtils.cpp +++ b/src/libslic3r/ParameterUtils.cpp @@ -75,33 +75,4 @@ int get_index_for_extruder_parameter(const DynamicPrintConfig &config, const std return variant_index; } -std::vector get_wrapping_detection_area(const std::vector &wrapping_detection_path, double avoidance_radius) -{ - if (wrapping_detection_path.empty()) - return std::vector(); - - double min_x = wrapping_detection_path[0](0); - double max_x = wrapping_detection_path[0](0); - double min_y = wrapping_detection_path[0](1); - double max_y = wrapping_detection_path[0](1); - - for (const Vec2d& pt : wrapping_detection_path) { - if (pt(0) < min_x) - min_x = pt(0); - if (pt(0) > max_x) - max_x = pt(0); - if (pt(1) < min_y) - min_y = pt(1); - if (pt(1) > max_y) - max_y = pt(1); - } - - min_x = min_x - avoidance_radius; - min_y = min_y - avoidance_radius; - max_x = max_x + avoidance_radius; - max_y = max_y + avoidance_radius; - - return {{min_x, min_y}, {max_x, min_y}, {max_x, max_y}, {min_x, max_y}}; -} - }; // namespace Slic3r diff --git a/src/libslic3r/ParameterUtils.hpp b/src/libslic3r/ParameterUtils.hpp index 001df5e0d34..795e7ff6198 100644 --- a/src/libslic3r/ParameterUtils.hpp +++ b/src/libslic3r/ParameterUtils.hpp @@ -11,8 +11,6 @@ std::vector get_other_layers_print_sequence(int sequence_num void get_other_layers_print_sequence(const std::vector &customize_sequences, int &sequence_nums, std::vector &sequence); extern int get_index_for_extruder_parameter(const DynamicPrintConfig &config, const std::string &opt_key, int cur_extruder_id, ExtruderType extruder_type, NozzleVolumeType nozzle_volume_type); - -extern std::vector get_wrapping_detection_area(const std::vector &wrapping_detection_path, double avoidance_radius); } // namespace Slic3r #endif // slic3r_Parameter_Utils_hpp_ diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 8bdbddd90bd..1d699310add 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -942,6 +942,7 @@ static std::vector s_Preset_print_options { "wipe_tower_rotation_angle", "tree_support_branch_distance_organic", "tree_support_branch_diameter_organic", "tree_support_branch_angle_organic", "hole_to_polyhole", "hole_to_polyhole_threshold", "hole_to_polyhole_twisted", "mmu_segmented_region_max_width", "mmu_segmented_region_interlocking_depth", "small_area_infill_flow_compensation", "small_area_infill_flow_compensation_model", + "enable_wrapping_detection", "seam_slope_type", "seam_slope_conditional", "scarf_angle_threshold", "scarf_joint_speed", "scarf_joint_flow_ratio", "seam_slope_start_height", "seam_slope_entire_loop", "seam_slope_min_length", "seam_slope_steps", "seam_slope_inner_walls", "scarf_overhang_threshold", "interlocking_beam", "interlocking_orientation", "interlocking_beam_layer_count", "interlocking_depth", "interlocking_boundary_avoidance", "interlocking_beam_width","calib_flowrate_topinfill_special_order", }; @@ -1003,7 +1004,7 @@ static std::vector s_Preset_printer_options { "nozzle_height", "master_extruder_id", "default_print_profile", "inherits", "silent_mode", - "scan_first_layer", "enable_wrapping_detection", "wrapping_detection_layers", "wrapping_detection_path", "machine_load_filament_time", "machine_unload_filament_time", "machine_tool_change_time", "time_cost", "machine_pause_gcode", "template_custom_gcode", + "scan_first_layer", "enable_wrapping_detection", "wrapping_detection_layers", "wrapping_exclude_area", "machine_load_filament_time", "machine_unload_filament_time", "machine_tool_change_time", "time_cost", "machine_pause_gcode", "template_custom_gcode", "nozzle_type", "nozzle_hrc","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types", "travel_slope", "retract_lift_enforce","support_chamber_temp_control","support_air_filtration","printer_structure", "best_object_pos", "head_wrap_detect_zone", "host_type", "print_host", "printhost_apikey", "bbl_use_printhost", @@ -2897,7 +2898,7 @@ inline t_config_option_keys deep_diff(const ConfigBase &config_this, const Confi if (this_opt != nullptr && other_opt != nullptr && *this_opt != *other_opt) { //BBS: add bed_exclude_area - if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "compatible_prints" || opt_key == "compatible_printers" || opt_key == "thumbnails") { + if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "compatible_prints" || opt_key == "compatible_printers" || opt_key == "thumbnails" || opt_key == "wrapping_exclude_area") { // Scalar variable, or a vector variable, which is independent from number of extruders, // thus the vector is presented to the user as a single input. diff.emplace_back(opt_key); diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 7886344e769..ca4ad76e418 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -137,7 +137,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "inner_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", - "enable_wrapping_detection", "bridge_acceleration", "travel_acceleration", "sparse_infill_acceleration", @@ -302,6 +301,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "hot_plate_temp" || opt_key == "textured_plate_temp" || opt_key == "enable_prime_tower" + || opt_key == "enable_wrapping_detection" || opt_key == "prime_tower_enable_framework" || opt_key == "prime_tower_width" || opt_key == "prime_tower_brim_width" @@ -922,7 +922,7 @@ static StringObjectException layered_print_cleareance_valid(const Print &print, std::for_each(exclude_polys.begin(), exclude_polys.end(), [&print_origin](Polygon& p) { p.translate(scale_(print_origin.x()), scale_(print_origin.y())); }); - Pointfs wrapping_detection_area = get_wrapping_detection_area(print_config.wrapping_detection_path.values, print_config.extruder_clearance_radius.value / 2); + Pointfs wrapping_detection_area = print_config.wrapping_exclude_area.values; Polygon wrapping_poly; for (size_t i = 0; i < wrapping_detection_area.size(); ++i) { auto pt = wrapping_detection_area[i]; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index c6a555dec2e..d4f4d6d4e50 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3576,11 +3576,12 @@ void PrintConfigDef::init_fff_params() def->mode = comDevelop; def->set_default_value(new ConfigOptionInt(20)); - def = this->add("wrapping_detection_path", coPoints); - //def->label = L("Clumping detection position"); - //def->tooltip = L("Clumping detection position."); - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionPoints{Vec2d(197.5, 326), Vec2d(207.5, 326)}); + def = this->add("wrapping_exclude_area", coPoints); + def->label = L("Probing exclude area of clumping"); + def->tooltip = L("Probing exclude area of clumping."); + def->mode = comAdvanced; + def->gui_type = ConfigOptionDef::GUIType::one_string; + def->set_default_value(new ConfigOptionPoints{Vec2d(145, 326), Vec2d(145, 310), Vec2d(256, 310), Vec2d(256, 326)}); def = this->add("sparse_infill_filament", coInt); def->gui_type = ConfigOptionDef::GUIType::i_enum_open; diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 99391939243..50e1d53e046 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1250,7 +1250,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, scan_first_layer)) ((ConfigOptionBool, enable_wrapping_detection)) ((ConfigOptionInt, wrapping_detection_layers)) - ((ConfigOptionPoints, wrapping_detection_path)) + ((ConfigOptionPoints, wrapping_exclude_area)) ((ConfigOptionPoints, thumbnail_size)) // ((ConfigOptionBool, spaghetti_detector)) ((ConfigOptionBool, gcode_add_line_number)) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 5d2f7efe693..9be56dae3c8 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -323,6 +323,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con new_conf.set_key_value("overhang_reverse", new ConfigOptionBool(false)); new_conf.set_key_value("wall_direction", new ConfigOptionEnum(WallDirection::Auto)); new_conf.set_key_value("timelapse_type", new ConfigOptionEnum(tlTraditional)); + new_conf.set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); sparse_infill_density = 0; timelapse_type = TimelapseType::tlTraditional; support = false; @@ -976,7 +977,7 @@ void ConfigManipulation::toggle_print_sla_options(DynamicPrintConfig* config) int ConfigManipulation::show_spiral_mode_settings_dialog(bool is_object_config) { - 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.")); + wxString msg_text = _(L("Spiral mode only works when wall loops is 1, support is disabled, clumping detection by probing is disabled, top shell layers is 0, sparse infill density is 0 and timelapse type is traditional.")); auto printer_structure_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option>("printer_structure"); if (printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3) { msg_text += _(L(" But machines with I3 structure will not generate timelapse videos.")); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 7c328d79d30..1611918bdbb 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2910,9 +2910,8 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re auto timelapse_type = dconfig.option>("timelapse_type"); bool need_wipe_tower = timelapse_type ? (timelapse_type->value == TimelapseType::tlSmooth) : false; - const DynamicPrintConfig & printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config; - if (printer_config.has("enable_wrapping_detection")) { - need_wipe_tower |= dynamic_cast(printer_config.option("enable_wrapping_detection"))->value; + if (dconfig.has("enable_wrapping_detection")) { + need_wipe_tower |= dynamic_cast(dconfig.option("enable_wrapping_detection"))->value; } if (wt && (need_wipe_tower || filaments_count > 1) && !wxGetApp().plater()->only_gcode_mode() && !wxGetApp().plater()->is_gcode_3mf()) { @@ -2943,7 +2942,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re const DynamicPrintConfig &print_cfg = wxGetApp().preset_bundle->prints.get_edited_preset().config; double wipe_vol = get_max_element(v); int nozzle_nums = wxGetApp().preset_bundle->get_printer_extruder_count(); - Vec3d wipe_tower_size = ppl.get_plate(plate_id)->estimate_wipe_tower_size(print_cfg, w, wipe_vol, nozzle_nums, 0, false, dynamic_cast(printer_config.option("enable_wrapping_detection"))->value); + Vec3d wipe_tower_size = ppl.get_plate(plate_id)->estimate_wipe_tower_size(print_cfg, w, wipe_vol, nozzle_nums, 0, false, dynamic_cast(dconfig.option("enable_wrapping_detection"))->value); { const float margin = WIPE_TOWER_MARGIN + brim_width; diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index b143d855fb6..ce0c24d08a7 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -214,7 +214,7 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt } break; case coPoints:{ - if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "thumbnails") { + if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "thumbnails" || opt_key == "wrapping_exclude_area" ) { config.option(opt_key)->values = boost::any_cast>(value); break; } diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index df3489c636e..a319cafab52 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -957,9 +957,10 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config double val = opt->type == coFloats ? config.option(opt_key)->get_at(idx) : config.option(opt_key)->get_at(idx); - ret = double_to_string(val); } + ret = double_to_string(val); } break; + } case coFloatsOrPercents: { if (opt_index < 0 ? config.option(opt_key)->is_nil() : dynamic_cast(config.option(opt_key))->is_nil(opt_index)) ret = _(L("N/A")); @@ -1095,7 +1096,7 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config ret = get_thumbnails_string(config.option(opt_key)->values); else if (opt_key == "bed_exclude_area") ret = get_thumbnails_string(config.option(opt_key)->values); - else if (opt_key == "wrapping_detection_path") + else if (opt_key == "wrapping_exclude_area") ret = get_thumbnails_string(config.option(opt_key)->values); else ret = config.option(opt_key)->get_at(idx); @@ -1232,7 +1233,7 @@ boost::any ConfigOptionsGroup::get_config_value2(const DynamicPrintConfig& confi ret = get_thumbnails_string(config.option(opt_key)->values); else if (opt_key == "bed_exclude_area") ret = get_thumbnails_string(config.option(opt_key)->values); - else if (opt_key == "wrapping_detection_path") + else if (opt_key == "wrapping_exclude_area") ret = get_thumbnails_string(config.option(opt_key)->values); else ret = config.option(opt_key)->get_at(idx); diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index b2313d69dfe..79049b23256 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -349,12 +349,11 @@ bool PartPlate::get_spiral_vase_mode() const std::vector PartPlate::get_plate_wrapping_detection_area() const { - DynamicPrintConfig gconfig = wxGetApp().preset_bundle->printers.get_edited_preset().config; - ConfigOptionPoints *wrapping_path_opt = gconfig.option("wrapping_detection_path"); - ConfigOptionFloat *clearance_max_radius_opt = gconfig.option("extruder_clearance_radius"); - if (wrapping_path_opt && clearance_max_radius_opt) { - std::vector wrapping_area = get_wrapping_detection_area(wrapping_path_opt->values, clearance_max_radius_opt->value / 2); - for (Vec2d &pt : wrapping_area) { + DynamicPrintConfig gconfig = wxGetApp().preset_bundle->printers.get_edited_preset().config; + ConfigOptionPoints *wrapping_exclude_area_opt = gconfig.option("wrapping_exclude_area"); + if (wrapping_exclude_area_opt) { + std::vector wrapping_area = wrapping_exclude_area_opt->values; + for (Vec2d& pt : wrapping_area) { pt += Vec2d(m_origin.x(), m_origin.y()); } return wrapping_area; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 4a5d395903f..eae0eaaac8f 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -4946,8 +4946,8 @@ std::map Plater::get_bed_texture_maps() bool Plater::get_enable_wrapping_detection() { - const DynamicPrintConfig & printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config; - const ConfigOptionBool * wrapping_detection = printer_config.option("enable_wrapping_detection"); + const DynamicPrintConfig & print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; + const ConfigOptionBool * wrapping_detection = print_config.option("enable_wrapping_detection"); return (wrapping_detection != nullptr) && wrapping_detection->value; } @@ -11588,10 +11588,10 @@ void Plater::_calib_pa_pattern(const Calib_Params& params) ); } - print_config.set_key_value( - SuggestedConfigCalibPAPattern().brim_pair.first, - new ConfigOptionEnum(SuggestedConfigCalibPAPattern().brim_pair.second) - ); + print_config.set_key_value(SuggestedConfigCalibPAPattern().brim_pair.first, + new ConfigOptionEnum(SuggestedConfigCalibPAPattern().brim_pair.second)); + + print_config.set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); // Orca: Set the outer wall speed to the optimal speed for the test, cap it with max volumetric speed if (speeds.empty()) { @@ -11778,6 +11778,7 @@ void Plater::_calib_pa_tower(const Calib_Params& params) { const double nozzle_diameter = printer_config->option("nozzle_diameter")->get_at(0); + print_config.set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats{ 1.0f }); @@ -11942,7 +11943,7 @@ void adjust_settings_for_flowrate_calib(ModelObjectPtrs& objects, bool linear, i print_config->set_key_value("alternate_extra_wall", new ConfigOptionBool(false)); print_config->set_key_value("initial_layer_print_height", new ConfigOptionFloat(first_layer_height)); print_config->set_key_value("reduce_crossing_wall", new ConfigOptionBool(true)); - + print_config->set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty(); wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty(); @@ -12015,6 +12016,9 @@ void Plater::calib_temp(const Calib_Params& params) { model().objects[0]->config.set_key_value("alternate_extra_wall", new ConfigOptionBool(false)); model().objects[0]->config.set_key_value("seam_slope_type", new ConfigOptionEnum(SeamScarfType::None)); + auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config; + print_config->set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); + changed_objects({ 0 }); wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty(); wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty(); @@ -12095,6 +12099,7 @@ void Plater::calib_max_vol_speed(const Calib_Params& params) print_config->set_key_value("timelapse_type", new ConfigOptionEnum(tlTraditional)); print_config->set_key_value("spiral_mode", new ConfigOptionBool(true)); print_config->set_key_value("max_volumetric_extrusion_rate_slope", new ConfigOptionFloat(0)); + print_config->set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); changed_objects({ 0 }); wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty(); @@ -12135,6 +12140,8 @@ void Plater::calib_retraction(const Calib_Params& params) auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config; auto obj = model().objects[0]; + print_config->set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); + double layer_height = 0.2; auto max_lh = printer_config->option("max_layer_height"); @@ -12187,6 +12194,7 @@ void Plater::calib_VFA(const Calib_Params& params) print_config->set_key_value("overhang_reverse", new ConfigOptionBool(false)); print_config->set_key_value("detect_thin_wall", new ConfigOptionBool(false)); print_config->set_key_value("spiral_mode", new ConfigOptionBool(true)); + print_config->set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum(btOuterOnly)); model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0)); model().objects[0]->config.set_key_value("brim_object_gap", new ConfigOptionFloat(0.0)); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 158bf303a2d..1aa46108b99 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -956,8 +956,7 @@ void Tab::init_options_list() for (const std::string& opt_key : m_config->keys()) { - if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "compatible_prints" || opt_key == "compatible_printers" || opt_key == "thumbnails" - || opt_key == "wrapping_detection_path") { + if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "compatible_prints" || opt_key == "compatible_printers" || opt_key == "thumbnails" || opt_key == "wrapping_exclude_area") { m_options_list.emplace(opt_key, m_opt_status_value); continue; } @@ -1584,7 +1583,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) set_enable_prime_tower = true; } } - bool enable_wrapping = m_preset_bundle->printers.get_edited_preset().config.option("enable_wrapping_detection")->value; + bool enable_wrapping = m_config->option("enable_wrapping_detection")->value; if (enable_wrapping && !set_enable_prime_tower) { MessageDialog dlg(wxGetApp().plater(), _L("A prime tower is required for clumping detection. There may be flaws on the model without prime tower. Are you sure you want to disable prime tower?"), @@ -1613,7 +1612,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) } if (opt_key == "enable_wrapping_detection") { - bool wipe_tower_enabled = m_preset_bundle->prints.get_edited_preset().config.option("enable_prime_tower")->value; + bool wipe_tower_enabled = m_config->option("enable_prime_tower")->value; if (boost::any_cast(value) && !wipe_tower_enabled) { MessageDialog dlg(wxGetApp().plater(), _L("Prime tower is required for clumping detection. There may be flaws on the model without prime tower. Do you still want to enable clumping detection?"), @@ -2656,6 +2655,7 @@ optgroup->append_single_option_line("skirt_loops", "others_settings_skirt#loops" optgroup->append_single_option_line("spiral_finishing_flow_ratio", "others_settings_special_mode#spiral-finishing-flow-ratio"); optgroup->append_single_option_line("timelapse_type", "others_settings_special_mode#timelapse"); + optgroup->append_single_option_line("enable_wrapping_detection"); optgroup = page->new_optgroup(L("Fuzzy Skin"), L"fuzzy_skin"); optgroup->append_single_option_line("fuzzy_skin", "others_settings_fuzzy_skin"); @@ -4199,8 +4199,9 @@ void TabPrinter::build_fff() optgroup->append_single_option_line("bbl_use_printhost"); optgroup->append_single_option_line("scan_first_layer"); optgroup->append_single_option_line("enable_wrapping_detection"); - //optgroup->append_single_option_line("wrapping_detection_layers"); - //optgroup->append_single_option_line("wrapping_detection_path"); + option = optgroup->get_option("wrapping_exclude_area"); + option.opt.full_width = true; + optgroup->append_single_option_line(option); optgroup->append_single_option_line("disable_m73"); option = optgroup->get_option("thumbnails"); option.opt.full_width = true; @@ -5025,10 +5026,6 @@ void TabPrinter::toggle_options() // SoftFever: hide non-BBL settings for (auto el : {"use_firmware_retraction", "use_relative_e_distances", "support_multi_bed_types", "pellet_modded_printer", "bed_mesh_max", "bed_mesh_min", "bed_mesh_probe_distance", "adaptive_bed_mesh_margin", "thumbnails"}) toggle_line(el, !is_BBL_printer); - - PresetBundle *preset_bundle = wxGetApp().preset_bundle; - std::string printer_type = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle); - toggle_line("enable_wrapping_detection", DevPrinterConfigUtil::support_wrapping_detection(printer_type)); } if (m_active_page->title() == L("Machine G-code")) { diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 9858b4c2992..28ae365402a 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1363,7 +1363,7 @@ static wxString get_string_value(std::string opt_key, const DynamicPrintConfig& else if (opt_key == "head_wrap_detect_zone") { return get_thumbnails_string(config.option(opt_key)->values); } - else if (opt_key == "wrapping_detection_path") { + else if (opt_key == "wrapping_exclude_area") { return get_thumbnails_string(config.option(opt_key)->values); } Vec2d val = config.opt(opt_key)->get_at(opt_idx); diff --git a/src/slic3r/Utils/CalibUtils.cpp b/src/slic3r/Utils/CalibUtils.cpp index 86e6fbd1db5..83a7769722d 100644 --- a/src/slic3r/Utils/CalibUtils.cpp +++ b/src/slic3r/Utils/CalibUtils.cpp @@ -720,6 +720,7 @@ bool CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString full_config.apply(printer_config); full_config.set_key_value("filament_ids", new ConfigOptionStrings({calib_info.filament_prest->filament_id})); + full_config.set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); init_multi_extruder_params_for_cali(full_config, calib_info); @@ -833,6 +834,7 @@ bool CalibUtils::calib_generic_PA(const CalibInfo &calib_info, wxString &error_m full_config.apply(printer_config); full_config.set_key_value("filament_ids", new ConfigOptionStrings({calib_info.filament_prest->filament_id})); + full_config.set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); init_multi_extruder_params_for_cali(full_config, calib_info);