diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index 675bf54275..67c237d430 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -1610,22 +1610,20 @@ public: m_serialized_override.clear(); } - const bool has_z_volume_syntax = str.find("..") != std::string::npos && str.find(';') != std::string::npos; - if (has_z_volume_syntax && ! append) + const bool has_extended_bed_exclusion_syntax = str.find('|') != std::string::npos || (str.find("..") != std::string::npos && str.find(';') != std::string::npos); + if (has_extended_bed_exclusion_syntax && ! append) m_serialized_override = str; std::string points_str = str; - if (has_z_volume_syntax) { + if (has_extended_bed_exclusion_syntax) { std::ostringstream points; std::istringstream regions(str); std::string region; while (std::getline(regions, region, '|')) { const size_t sep = region.find(';'); - if (sep == std::string::npos) - continue; if (points.tellp() > 0) points << ","; - points << region.substr(sep + 1); + points << (sep == std::string::npos ? region : region.substr(sep + 1)); } points_str = points.str(); } diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 27d953791a..0f5b30fb59 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1440,7 +1440,7 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", "printable_area", "extruder_printable_area", "support_parallel_printheads", "parallel_printheads_count", "parallel_printheads_bed_exclude_areas", - "bed_exclude_area", "bed_exclude_area_3d", "bed_custom_texture", "bed_custom_model", "gcode_flavor", + "bed_exclude_area", "bed_custom_texture", "bed_custom_model", "gcode_flavor", "gcode_skip_config_block", "fan_kickstart", "part_cooling_fan_min_pwm", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", "printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type", @@ -3622,7 +3622,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 == "bed_exclude_area_3d" || opt_key == "compatible_prints" || opt_key == "compatible_printers" || opt_key == "thumbnails" || opt_key == "wrapping_exclude_area" || opt_key == "slicing_pipeline_plugin") { + 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" || opt_key == "slicing_pipeline_plugin") { // 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 8f0fb4dbfd..bd953f1929 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -155,7 +155,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "printable_area", //BBS: add bed_exclude_area "bed_exclude_area", - "bed_exclude_area_3d", "thumbnail_size", "before_layer_change_gcode", "enable_pressure_advance", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index ed3822f1a4..8018b0fdf3 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -885,14 +885,6 @@ void PrintConfigDef::init_common_params() def->gui_type = ConfigOptionDef::GUIType::one_string; def->set_default_value(new ConfigOptionPoints{ Vec2d(0, 0) }); - def = this->add("bed_exclude_area_3d", coString); - def->label = L("Bed exclusion volume"); - def->tooltip = L("Z-limited unprintable volumes. Use: \"ZMIN..ZMAX;XxY,XxY,...\". Separate multiple regions with \"|\". " - "Missing Z bounds default to the bed surface or printable height."); - def->mode = comAdvanced; - def->gui_type = ConfigOptionDef::GUIType::one_string; - def->set_default_value(new ConfigOptionString()); - def = this->add("bed_custom_texture", coString); def->label = L("Bed custom texture"); def->mode = comAdvanced; @@ -12742,7 +12734,7 @@ namespace { static bool is_bed_exclusion_volume_syntax(const std::string &value) { - return value.find("..") != std::string::npos && value.find(';') != std::string::npos; + return value.find('|') != std::string::npos || (value.find("..") != std::string::npos && value.find(';') != std::string::npos); } static bool parse_double_token(const std::string &text, double &out) @@ -12907,14 +12899,13 @@ static std::vector get_bed_excluded_regions_impl( std::vector get_bed_excluded_regions(const DynamicPrintConfig& cfg) { const ConfigOptionPoints *legacy = cfg.opt("bed_exclude_area"); - const ConfigOptionString *regions = cfg.opt("bed_exclude_area_3d"); const ConfigOptionFloat *height = cfg.opt("printable_height"); const std::string bed_exclude_area = legacy != nullptr ? legacy->serialize() : std::string{}; const bool volume_syntax = is_bed_exclusion_volume_syntax(bed_exclude_area); return get_bed_excluded_regions_impl( volume_syntax || legacy == nullptr ? Pointfs{} : legacy->values, - volume_syntax ? bed_exclude_area : (regions != nullptr ? regions->value : std::string{}), + volume_syntax ? bed_exclude_area : std::string{}, height != nullptr ? height->value : 0.0); } @@ -12925,7 +12916,7 @@ std::vector get_bed_excluded_regions(const PrintConfig& cfg) return get_bed_excluded_regions_impl( volume_syntax ? Pointfs{} : cfg.bed_exclude_area.values, - volume_syntax ? bed_exclude_area : cfg.bed_exclude_area_3d.value, + volume_syntax ? bed_exclude_area : std::string{}, cfg.printable_height.value); } diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index a258c86206..2a1a8063de 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1758,7 +1758,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionStrings, parallel_printheads_bed_exclude_areas)) //BBS: add bed_exclude_area ((ConfigOptionPoints, bed_exclude_area)) - ((ConfigOptionString, bed_exclude_area_3d)) ((ConfigOptionPoints, head_wrap_detect_zone)) // BBS ((ConfigOptionString, bed_custom_texture)) diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index c13486e554..412df19091 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -2637,7 +2637,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent) p->load_vendors(); //BBS: add bed exclude areas p->custom_config.reset(DynamicPrintConfig::new_from_defaults_keys({ - "gcode_flavor", "printable_area", "bed_exclude_area", "bed_exclude_area_3d", "bed_custom_texture", "bed_custom_model", "nozzle_diameter", "filament_diameter", "thumbnails" + "gcode_flavor", "printable_area", "bed_exclude_area", "bed_custom_texture", "bed_custom_model", "nozzle_diameter", "filament_diameter", "thumbnails" //, "nozzle_temperature", "bed_temperature" })); diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index de991ed116..68a4b87ddd 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -734,7 +734,8 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true case coPoints: { std::vector out_values; str.Replace(" ", wxEmptyString, true); - const bool bed_exclusion_volume_syntax = m_opt_id == "bed_exclude_area" && str.Find("..") != wxNOT_FOUND && str.Find(";") != wxNOT_FOUND; + const bool bed_exclusion_volume_syntax = m_opt_id == "bed_exclude_area" && + (str.Find("|") != wxNOT_FOUND || (str.Find("..") != wxNOT_FOUND && str.Find(";") != wxNOT_FOUND)); const wxString raw_str = str; if (bed_exclusion_volume_syntax) { wxString points; @@ -742,11 +743,9 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true while (regions.HasMoreTokens()) { wxString region = regions.GetNextToken(); const int sep = region.Find(";"); - if (sep == wxNOT_FOUND) - continue; if (! points.empty()) points += ","; - points += region.Mid(sep + 1); + points += sep == wxNOT_FOUND ? region : region.Mid(sep + 1); } str = points; } diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index 0838649d27..cfeb9d80ce 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -240,8 +240,6 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt case coPoints:{ if (opt_key == "bed_exclude_area" && boost::any_cast(&value) != nullptr) { config.option(opt_key)->deserialize(boost::any_cast(value)); - if (config.has("bed_exclude_area_3d")) - config.set_key_value("bed_exclude_area_3d", new ConfigOptionString()); break; } if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "thumbnails" || opt_key == "wrapping_exclude_area" ) { @@ -249,8 +247,6 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt if (opt_key == "bed_exclude_area") { ConfigOptionPoints normalized(boost::any_cast>(value)); config.option(opt_key)->deserialize(normalized.serialize()); - if (config.has("bed_exclude_area_3d")) - config.set_key_value("bed_exclude_area_3d", new ConfigOptionString()); } break; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index e885b3a041..e1fa2b5004 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -7331,7 +7331,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) , main_frame(main_frame) //BBS: add bed_exclude_area , config(Slic3r::DynamicPrintConfig::new_from_defaults_keys({ - "printable_area", "bed_exclude_area", "bed_exclude_area_3d", "wrapping_exclude_area", "extruder_printable_area", "bed_custom_texture", "bed_custom_model", "print_sequence", + "printable_area", "bed_exclude_area", "wrapping_exclude_area", "extruder_printable_area", "bed_custom_texture", "bed_custom_model", "print_sequence", "extruder_clearance_radius", "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", "nozzle_height", "skirt_type", "skirt_loops", "skirt_speed","min_skirt_length", "skirt_distance", "skirt_start_angle", @@ -20090,7 +20090,7 @@ void Plater::on_config_change(const DynamicPrintConfig &config) p->partplate_list.invalid_all_slice_result(); } //BBS: add bed_exclude_area - else if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "bed_exclude_area_3d" + else if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "bed_custom_texture" || opt_key == "bed_custom_model" || opt_key == "extruder_clearance_height_to_lid" || opt_key == "extruder_clearance_height_to_rod") {