From 519ceaad5abf0e5022cf11ee63d07c53a8e169e9 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 15 Jan 2025 10:32:02 +0800 Subject: [PATCH] ENH: increase top_area_threshold to 200% 100% is too small and causes too many problems. jira: STUDIO-9641 Change-Id: I7699a31beea24d079c7ef05467a5d0fde4d6911b --- bbl/i18n/zh_cn/BambuStudio_zh_CN.po | 6 ++---- src/libslic3r/PerimeterGenerator.cpp | 13 +++++-------- src/libslic3r/PrintConfig.cpp | 4 ++-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/bbl/i18n/zh_cn/BambuStudio_zh_CN.po b/bbl/i18n/zh_cn/BambuStudio_zh_CN.po index 7287f0ac4..f55d75671 100644 --- a/bbl/i18n/zh_cn/BambuStudio_zh_CN.po +++ b/bbl/i18n/zh_cn/BambuStudio_zh_CN.po @@ -9565,10 +9565,8 @@ msgstr "最顶面" msgid "Top area threshold" msgstr "顶部区域阈值" -msgid "" -"This factor affects the acreage of top area. The small the number the big " -"the top area." -msgstr "这个参数影响顶部区域的面积,值越大顶部区域越小" +msgid "The min width of top areas in percentage of perimeter line width." +msgstr "顶部区域的最小宽度,单位是墙线宽的百分比。" msgid "Only one wall on first layer" msgstr "首层仅单层墙" diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index 83f03c233..732f3547a 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -1432,7 +1432,7 @@ void PerimeterGenerator::process_classic() else offset_top_surface = 0; //don't takes into account too thin areas - 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))); + double min_width_top_surface = (this->object_config->top_area_threshold / 100) * std::max(ext_perimeter_spacing / 2.0, perimeter_width / 2.0); //BBS: get boungding box of last BoundingBox last_box = get_extents(last); @@ -1885,8 +1885,6 @@ void PerimeterGenerator::process_arachne() top_expolys_by_one_wall = diff_ex(top_expolys_by_one_wall, bottom_expolys); seperate_wall_generation = should_enable_top_one_wall(last, top_expolys_by_one_wall); - if (seperate_wall_generation) - top_expolys_by_one_wall = offset_ex(top_expolys_by_one_wall, perimeter_width); } @@ -2141,17 +2139,16 @@ void PerimeterGenerator::process_arachne() } } -// determine whether to enable top one wall feature +// expand the top expoly and determine whether to enable top one wall feature bool PerimeterGenerator::should_enable_top_one_wall(const ExPolygons& original_expolys, ExPolygons& top) { - coord_t perimeter_width = this->perimeter_flow.width(); + coord_t perimeter_width = this->perimeter_flow.scaled_width(); coord_t ext_perimeter_spacing = this->ext_perimeter_flow.scaled_spacing(); //BBS: filter small area and extend top surface a bit to hide the wall line - double min_width_top_surface = (this->object_config->top_area_threshold / 100) * 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(ext_perimeter_spacing / 2.0, perimeter_width / 2.0); top = offset2_ex(top, -min_width_top_surface, min_width_top_surface + perimeter_width); - // compare the width with the width of perimeter - return !offset_ex(top, -perimeter_width).empty(); + return !top.empty(); } bool PerimeterGeneratorLoop::is_internal_contour() const diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 84bf32060..36c4d2993 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1004,12 +1004,12 @@ void PrintConfigDef::init_fff_params() 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->tooltip = L("The min width of top areas in percentage of perimeter line width."); def->sidetext = "%"; def->min = 0; def->max = 500; def->mode = comDevelop; - def->set_default_value(new ConfigOptionPercent(100)); + def->set_default_value(new ConfigOptionPercent(200)); def = this->add("only_one_wall_first_layer", coBool); def->label = L("Only one wall on first layer");