diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index cc61e7599..a3069bd00 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -1018,7 +1018,7 @@ void PerimeterGenerator::process_classic() else offset_top_surface = 0; //don't takes into account too thin areas - double min_width_top_surface = std::max(double(ext_perimeter_spacing / 2 + 10), 1.0 * (double(perimeter_width))); + double min_width_top_surface = (this->object_config->top_area_threshold / 100) * std::max(double(ext_perimeter_spacing / 2 + 10), 1.0 * (double(perimeter_width))); //BBS: get boungding box of last BoundingBox last_box = get_extents(last); @@ -1408,7 +1408,7 @@ void PerimeterGenerator::process_arachne() infill_contour = diff_ex(infill_contour, bridge_area); } //BBS: filter small area and extend top surface a bit to hide the wall line - double min_width_top_surface = std::max(double(ext_perimeter_spacing / 4 + 10), double(perimeter_width / 4)); + double min_width_top_surface = (this->object_config->top_area_threshold / 100) * std::max(double(ext_perimeter_spacing / 4 + 10), double(perimeter_width / 4)); infill_contour = offset2_ex(infill_contour, -min_width_top_surface, min_width_top_surface + perimeter_width); //BBS: get the inner surface that not export to top diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index ce913de8e..d88177995 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -796,7 +796,7 @@ static std::vector s_Preset_print_options { "detect_narrow_internal_solid_infill", "gcode_add_line_number", "enable_arc_fitting", "infill_combination", /*"adaptive_layer_height",*/ "support_bottom_interface_spacing", "enable_overhang_speed", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed", - "initial_layer_infill_speed", "top_one_wall_type", "only_one_wall_first_layer", + "initial_layer_infill_speed", "top_one_wall_type", "top_area_threshold", "only_one_wall_first_layer", "timelapse_type", "internal_bridge_support_thickness", "wall_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle", "wall_distribution_count", "min_feature_size", "min_bead_width", "post_process", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 103708b30..d44f505ce 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -749,6 +749,15 @@ void PrintConfigDef::init_fff_params() def->enum_labels.push_back(L("Topmost surface")); def->set_default_value(new ConfigOptionEnum(TopOneWallType::Alltop)); + def = this->add("top_area_threshold", coPercent); + def->label = L("Top area threshold"); + def->tooltip = L("This factor affects the acreage of top area. The small the number the big the top area."); + def->sidetext = L("%"); + def->min = 0; + def->max = 500; + def->mode = comDevelop; + def->set_default_value(new ConfigOptionPercent(100)); + def = this->add("only_one_wall_first_layer", coBool); def->label = L("Only one wall on first layer"); def->category = L("Quality"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index e4a64cac5..cb8dc0699 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -712,6 +712,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionPercent, min_feature_size)) ((ConfigOptionPercent, min_bead_width)) ((ConfigOptionEnum, top_one_wall_type)) + ((ConfigOptionPercent, top_area_threshold)) ((ConfigOptionBool, only_one_wall_first_layer)) // OrcaSlicer ((ConfigOptionPercent, seam_gap)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index f76c0e0c6..871df3cac 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -710,6 +710,7 @@ bool PrintObject::invalidate_state_by_config_options( } else if ( opt_key == "wall_loops" || opt_key == "top_one_wall_type" + || opt_key == "top_area_threshold" || opt_key == "only_one_wall_first_layer" || opt_key == "initial_layer_line_width" || opt_key == "inner_wall_line_width" diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 9ff5fb5b9..2caa3e979 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -197,6 +197,9 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con apply(config, &new_conf); is_msg_dlg_already_exist = false; } + //BBS: top_area_threshold showed if the top one wall function be applyed + bool top_one_wall_apply = config->opt_enum("top_one_wall_type") == TopOneWallType::None; + toggle_line("top_area_threshold", !top_one_wall_apply); //BBS: ironing_spacing shouldn't be too small or equal to zero if (config->opt_float("ironing_spacing") < 0.05) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6e49d3283..3facf7fac 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -8533,6 +8533,7 @@ void Plater::calib_flowrate(int pass) _obj->config.set_key_value("wall_loops", new ConfigOptionInt(3)); _obj->config.set_key_value("top_one_wall_type", new ConfigOptionEnum(TopOneWallType::Topmost)); _obj->config.set_key_value("sparse_infill_density", new ConfigOptionPercent(35)); + _obj->config.set_key_value("top_area_threshold", new ConfigOptionPercent(100)); _obj->config.set_key_value("bottom_shell_layers", new ConfigOptionInt(1)); _obj->config.set_key_value("top_shell_layers", new ConfigOptionInt(5)); _obj->config.set_key_value("detect_thin_wall", new ConfigOptionBool(true)); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 71a6576cf..f7a5b85e7 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1884,6 +1884,7 @@ void TabPrint::build() optgroup->append_single_option_line("top_solid_infill_flow_ratio"); optgroup->append_single_option_line("initial_layer_flow_ratio"); optgroup->append_single_option_line("top_one_wall_type"); + optgroup->append_single_option_line("top_area_threshold"); optgroup->append_single_option_line("only_one_wall_first_layer"); optgroup->append_single_option_line("detect_overhang_wall"); optgroup->append_single_option_line("reduce_crossing_wall"); diff --git a/src/slic3r/Utils/CalibUtils.cpp b/src/slic3r/Utils/CalibUtils.cpp index 9c0d8d380..1b4954de3 100644 --- a/src/slic3r/Utils/CalibUtils.cpp +++ b/src/slic3r/Utils/CalibUtils.cpp @@ -399,6 +399,7 @@ void CalibUtils::calib_flowrate(int pass, const CalibInfo& calib_info, std::stri _obj->ensure_on_bed(); _obj->config.set_key_value("wall_loops", new ConfigOptionInt(3)); _obj->config.set_key_value("top_one_wall_type", new ConfigOptionEnum(TopOneWallType::Topmost)); + _obj->config.set_key_value("top_area_threshold", new ConfigOptionPercent(100)); _obj->config.set_key_value("sparse_infill_density", new ConfigOptionPercent(35)); _obj->config.set_key_value("bottom_shell_layers", new ConfigOptionInt(1)); _obj->config.set_key_value("top_shell_layers", new ConfigOptionInt(5));