diff --git a/bbl/i18n/zh_cn/BambuStudio_zh_CN.po b/bbl/i18n/zh_cn/BambuStudio_zh_CN.po index 546fbd4721..dd06811855 100644 --- a/bbl/i18n/zh_cn/BambuStudio_zh_CN.po +++ b/bbl/i18n/zh_cn/BambuStudio_zh_CN.po @@ -4810,6 +4810,12 @@ msgstr "桥接" msgid "Gap infill" msgstr "填缝" +msgid "Filter out tiny gaps" +msgstr "忽略微小间隙" + +msgid "Filter out gaps smaller than the threshold specified. This setting won't affact top/bottom layers" +msgstr "小于指定阈值的微小间隙不填充。本设置不会对顶/底层起作用" + msgid "Support interface" msgstr "支撑面" diff --git a/resources/i18n/zh_cn/BambuStudio.mo b/resources/i18n/zh_cn/BambuStudio.mo index e4c39a9372..0b8385bf70 100644 Binary files a/resources/i18n/zh_cn/BambuStudio.mo and b/resources/i18n/zh_cn/BambuStudio.mo differ diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index 38f48b67d5..ace84c064b 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -467,6 +467,7 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: params.no_extrusion_overlap = surface_fill.params.overlap; LayerRegion* layerm = this->m_regions[surface_fill.region_id]; + params.config = &layerm->region().config(); for (ExPolygon& expoly : surface_fill.expolygons) { f->no_overlap_expolygons = intersection_ex(layerm->fill_no_overlap_expolygons, ExPolygons() = { expoly }); // Spacing is modified by the filler to indicate adjustments. Reset it for each expolygon. diff --git a/src/libslic3r/Fill/FillBase.hpp b/src/libslic3r/Fill/FillBase.hpp index 9487e463b8..cffeab04dd 100644 --- a/src/libslic3r/Fill/FillBase.hpp +++ b/src/libslic3r/Fill/FillBase.hpp @@ -74,6 +74,8 @@ struct FillParams bool using_internal_flow{ false }; //BBS: only used for new top surface pattern float no_extrusion_overlap{ 0.0 }; + const PrintRegionConfig* config{ nullptr }; + }; static_assert(IsTriviallyCopyable::value, "FillParams class is not POD (and it should be - see constructor)."); diff --git a/src/libslic3r/Fill/FillRectilinear.cpp b/src/libslic3r/Fill/FillRectilinear.cpp index 0d7f5940fc..5723807395 100644 --- a/src/libslic3r/Fill/FillRectilinear.cpp +++ b/src/libslic3r/Fill/FillRectilinear.cpp @@ -3169,9 +3169,17 @@ void FillMonotonicLineWGapFill::fill_surface_extrusion(const Surface* surface, c } if (!polylines.empty() && !is_bridge(params.extrusion_role)) { + if (!surface->is_top() && !surface->is_bottom()) { + polylines.erase(std::remove_if(polylines.begin(), polylines.end(), + [&](const ThickPolyline& p) { + return p.length() < scale_(params.config->filter_out_gap_fill.value); + }), polylines.end()); + } + ExtrusionEntityCollection gap_fill; variable_width(polylines, erGapFill, params.flow, gap_fill.entities); coll_nosort->append(std::move(gap_fill.entities)); + } } diff --git a/src/libslic3r/Layer.cpp b/src/libslic3r/Layer.cpp index 3bde8102d3..9172ea2406 100644 --- a/src/libslic3r/Layer.cpp +++ b/src/libslic3r/Layer.cpp @@ -171,7 +171,8 @@ void Layer::make_perimeters() && config.inner_wall_speed == other_config.inner_wall_speed && config.outer_wall_speed == other_config.outer_wall_speed && config.small_perimeter_speed == other_config.small_perimeter_speed - && config.gap_infill_speed.value == other_config.gap_infill_speed.value + && config.gap_infill_speed.value == other_config.gap_infill_speed.value + && config.filter_out_gap_fill.value == other_config.filter_out_gap_fill.value && config.detect_overhang_wall == other_config.detect_overhang_wall && config.opt_serialize("inner_wall_line_width") == other_config.opt_serialize("inner_wall_line_width") && config.detect_thin_wall == other_config.detect_thin_wall diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index 3b1a3145f3..47d6eeda32 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -715,6 +715,15 @@ void PerimeterGenerator::process() ++ irun; } #endif + // SoftFever: don't filter out tiny gap fills for first and top layer. So that the print looks better :) + if (this->layer_id != 0 && this->upper_slices != nullptr) + { + polylines.erase(std::remove_if(polylines.begin(), polylines.end(), + [&](const ThickPolyline& p) { + return p.length() < scale_(config->filter_out_gap_fill.value); + }), polylines.end()); + } + if (! polylines.empty()) { ExtrusionEntityCollection gap_fill; @@ -728,7 +737,8 @@ void PerimeterGenerator::process() //FIXME Vojtech: This grows by a rounded extrusion width, not by line spacing, // therefore it may cover the area, but no the volume. last = diff_ex(last, gap_fill.polygons_covered_by_width(10.f)); - this->gap_fill->append(std::move(gap_fill.entities)); + this->gap_fill->append(std::move(gap_fill.entities)); + } } diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 5ce16eab3c..555c52020a 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -346,6 +346,7 @@ void Preset::normalize(DynamicPrintConfig &config) } } + handle_legacy_sla(config); } @@ -697,7 +698,7 @@ static std::vector s_Preset_print_options { #endif /* HAS_PRESSURE_EQUALIZER */ "inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "small_perimeter_threshold", "sparse_infill_speed", "internal_solid_infill_speed", "top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed", - "bridge_speed", "bridge_angle", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed", + "bridge_speed", "bridge_angle", "filter_out_gap_fill", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed", "outer_wall_acceleration", "inner_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "travel_acceleration", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield", "default_jerk", "outer_wall_jerk", "inner_wall_jerk", "top_surface_jerk", "initial_layer_jerk","travel_jerk", "brim_width", "brim_object_gap", "brim_type", "enable_support", "support_type", "support_threshold_angle", "enforce_support_layers", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 436503e8bd..fd861cd114 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1488,6 +1488,13 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0.8)); + def = this->add("filter_out_gap_fill", coFloat); + def->label = L("Filter out tiny gaps"); + def->category = L("Layers and Perimeters"); + def->tooltip = L("Filter out gaps smaller than the threshold specified. This setting won't affact top/bottom layers"); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("gap_infill_speed", coFloat); def->label = L("Gap infill"); def->category = L("Speed"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 8a1ae18af9..590cda6e56 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -679,6 +679,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionEnum, fuzzy_skin)) ((ConfigOptionFloat, fuzzy_skin_thickness)) ((ConfigOptionFloat, fuzzy_skin_point_distance)) + ((ConfigOptionFloat, filter_out_gap_fill)) ((ConfigOptionFloat, gap_infill_speed)) ((ConfigOptionInt, sparse_infill_filament)) ((ConfigOptionFloat, sparse_infill_line_width)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index bad5b3fc20..957d42f3d3 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -673,7 +673,8 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "inner_wall_line_width" || opt_key == "infill_wall_overlap") { steps.emplace_back(posPerimeters); - } else if (opt_key == "gap_infill_speed") { + } else if (opt_key == "gap_infill_speed" + || opt_key == "filter_out_gap_fill" ) { // Return true if gap-fill speed has changed from zero value to non-zero or from non-zero value to zero. auto is_gap_fill_changed_state_due_to_speed = [&opt_key, &old_config, &new_config]() -> bool { if (opt_key == "gap_infill_speed") { @@ -687,9 +688,9 @@ bool PrintObject::invalidate_state_by_config_options( }; // Filtering of unprintable regions in multi-material segmentation depends on if gap-fill is enabled or not. - // So step posSlice is invalidated when gap-fill was enabled/disabled by option "gap_fill_enabled" or by + // So step posSlice is invalidated when gap-fill was enabled/disabled by option "filter_out_gap_fill" or by // changing "gap_infill_speed" to force recomputation of the multi-material segmentation. - if (this->is_mm_painted() && (opt_key == "gap_infill_speed" && is_gap_fill_changed_state_due_to_speed())) + if (this->is_mm_painted() && (opt_key == "filter_out_gap_fill" && (opt_key == "gap_infill_speed" && is_gap_fill_changed_state_due_to_speed()))) steps.emplace_back(posSlice); steps.emplace_back(posPerimeters); } else if ( diff --git a/src/slic3r/GUI/PresetHints.cpp b/src/slic3r/GUI/PresetHints.cpp index 5c7861ec87..c338049abc 100644 --- a/src/slic3r/GUI/PresetHints.cpp +++ b/src/slic3r/GUI/PresetHints.cpp @@ -103,7 +103,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle double bridge_flow = print_config.opt_float("bridge_flow"); double inner_wall_speed = print_config.opt_float("inner_wall_speed"); double outer_wall_speed = print_config.get_abs_value("outer_wall_speed", inner_wall_speed); - // double gap_infill_speed = print_config.opt_bool("gap_fill_enabled") ? print_config.opt_float("gap_infill_speed") : 0.; + // double gap_infill_speed = print_config.opt_bool("filter_out_gap_fill") ? print_config.opt_float("gap_infill_speed") : 0.; double sparse_infill_speed = print_config.opt_float("sparse_infill_speed"); double small_perimeter_speed = print_config.get_abs_value("small_perimeter_speed", inner_wall_speed); double internal_solid_infill_speed = print_config.opt_float("internal_solid_infill_speed"); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 11e5fd5858..ffa4e411ab 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1806,6 +1806,7 @@ void TabPrint::build() optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse"); optgroup->append_single_option_line("top_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface"); optgroup->append_single_option_line("bottom_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface"); + optgroup->append_single_option_line("filter_out_gap_fill"); optgroup = page->new_optgroup(L("Advanced"), L"param_advanced"); optgroup->append_single_option_line("infill_wall_overlap");