FIX: reverse the logic of narrow area detect

1. Add reorder function for floating concentric

jira: STUDIO-11675,STUDIO-11691

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ia2f5e8d6ca631794fb4bc8f4abcb541f92e52c78
This commit is contained in:
xun.zhang 2025-05-14 16:32:44 +08:00 committed by lane.wei
parent dd796026b3
commit d42b492439
2 changed files with 13 additions and 1 deletions

View File

@ -135,6 +135,16 @@ struct SurfaceFill {
ExPolygons no_overlap_expolygons; ExPolygons no_overlap_expolygons;
}; };
// BBS: used to judge whether the internal solid infill area is narrow
static bool is_narrow_infill_area(const ExPolygon& expolygon)
{
ExPolygons offsets = offset_ex(expolygon, -scale_(NARROW_INFILL_AREA_THRESHOLD));
if (offsets.empty())
return true;
return false;
}
std::vector<SurfaceFill> group_fills(const Layer &layer) std::vector<SurfaceFill> group_fills(const Layer &layer)
{ {
std::vector<SurfaceFill> surface_fills; std::vector<SurfaceFill> surface_fills;
@ -384,7 +394,7 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
auto bbox = get_extents(surface_fills[i].expolygons[j]); auto bbox = get_extents(surface_fills[i].expolygons[j]);
auto clipped_internals = ClipperUtils::clip_clipper_polygons_with_subject_bbox(lower_internal_areas, bbox.inflated(scale_(2))); // expand a little auto clipped_internals = ClipperUtils::clip_clipper_polygons_with_subject_bbox(lower_internal_areas, bbox.inflated(scale_(2))); // expand a little
auto clipped_internal_bbox = get_extents(clipped_internals); auto clipped_internal_bbox = get_extents(clipped_internals);
if (is_narrow_expolygon(surface_fills[i].expolygons[j], narrow_threshold)) { if (is_narrow_infill_area(surface_fills[i].expolygons[j])) {
if (!clipped_internals.empty() && bbox.overlap(clipped_internal_bbox) && !intersection_ex(offset_ex(surface_fills[i].expolygons[j],SCALED_EPSILON), clipped_internals).empty()) { if (!clipped_internals.empty() && bbox.overlap(clipped_internal_bbox) && !intersection_ex(offset_ex(surface_fills[i].expolygons[j],SCALED_EPSILON), clipped_internals).empty()) {
narrow_floating_expoly_idx.emplace_back(j); narrow_floating_expoly_idx.emplace_back(j);
} }

View File

@ -7,6 +7,7 @@
#include "../format.hpp" #include "../format.hpp"
#include "FillFloatingConcentric.hpp" #include "FillFloatingConcentric.hpp"
#include <boost/log/trivial.hpp> #include <boost/log/trivial.hpp>
#include <libslic3r/ShortestPath.hpp>
namespace Slic3r { namespace Slic3r {
@ -855,6 +856,7 @@ FloatingThickPolylines FillFloatingConcentric::fill_surface_arachne_floating(con
void FillFloatingConcentric::fill_surface_extrusion(const Surface* surface, const FillParams& params, ExtrusionEntitiesPtr& out) void FillFloatingConcentric::fill_surface_extrusion(const Surface* surface, const FillParams& params, ExtrusionEntitiesPtr& out)
{ {
FloatingThickPolylines floating_lines = this->fill_surface_arachne_floating(surface, params); FloatingThickPolylines floating_lines = this->fill_surface_arachne_floating(surface, params);
//reorder_by_shortest_traverse(floating_lines);
if (floating_lines.empty()) if (floating_lines.empty())
return; return;
Flow new_flow = params.flow.with_spacing(this->spacing); Flow new_flow = params.flow.with_spacing(this->spacing);