FIX:minimum sparse infill area not work

1. Filter small sparse infil after doing vertical shell detect.To make
sure the params always work, the logic should also be added after doing
internal bridge detect

jira:STUDIO-9872

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I9d48303e156125dfab17ef95b73294013ab9fabd
This commit is contained in:
xun.zhang 2024-05-11 11:28:19 +08:00 committed by lane.wei
parent e2f25326c1
commit b47b19ed48
1 changed files with 20 additions and 0 deletions

View File

@ -590,6 +590,26 @@ void LayerRegion::process_external_surfaces(const Layer *lower_layer, const Poly
expansion_zones.at(0).parameters = RegionExpansionParameters::build(expansion_top, expansion_step, max_nr_expansion_steps);
Surfaces tops = expand_merge_surfaces(fill_surfaces.surfaces, stTop, expansion_zones, closing_radius);
//expansion_zone[0]: shell , expansion_zone[1]: sparse
//apply minimu sparse infill area logic, this should also be added in bridge_over_infill
if (!this->layer()->object()->print()->config().spiral_mode && this->region().config().sparse_infill_density.value > 0) {
auto &sparse=expansion_zones[1].expolygons;
auto &shells=expansion_zones[0].expolygons;
double min_area = scale_(scale_(this->region().config().minimum_sparse_infill_area.value));
ExPolygons areas_to_be_solid{};
sparse.erase(std::remove_if(sparse.begin(), sparse.end(), [min_area, &areas_to_be_solid](ExPolygon& expoly) {
if (expoly.area() <= min_area) {
areas_to_be_solid.push_back(expoly);
return true;
}
return false;
}), sparse.end());
if (!areas_to_be_solid.empty())
shells = union_ex(shells, areas_to_be_solid);
}
// m_fill_surfaces.remove_types({ stBottomBridge, stBottom, stTop, stInternal, stInternalSolid });
fill_surfaces.clear();
unsigned zones_expolygons_count = 0;