From b47b19ed48a0b628ee227b5dd945266b9265207b Mon Sep 17 00:00:00 2001 From: "xun.zhang" Date: Sat, 11 May 2024 11:28:19 +0800 Subject: [PATCH] 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 Change-Id: I9d48303e156125dfab17ef95b73294013ab9fabd --- src/libslic3r/LayerRegion.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/libslic3r/LayerRegion.cpp b/src/libslic3r/LayerRegion.cpp index 030d1d76b..f9e26cbda 100644 --- a/src/libslic3r/LayerRegion.cpp +++ b/src/libslic3r/LayerRegion.cpp @@ -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;