From d27889eb0f4bf99a5afd959cc0e14a048ac6d058 Mon Sep 17 00:00:00 2001 From: Rodrigo Faselli <162915171+RF47@users.noreply.github.com> Date: Mon, 6 Apr 2026 15:29:23 -0300 Subject: [PATCH] Fix fuzzy skin regresion classic wall generator (#12920) Co-authored-by: Ian Bassi <12130714+ianalexis@users.noreply.github.com> --- src/libslic3r/Feature/FuzzySkin/FuzzySkin.cpp | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/libslic3r/Feature/FuzzySkin/FuzzySkin.cpp b/src/libslic3r/Feature/FuzzySkin/FuzzySkin.cpp index fb9ea23822..812f9f9d14 100644 --- a/src/libslic3r/Feature/FuzzySkin/FuzzySkin.cpp +++ b/src/libslic3r/Feature/FuzzySkin/FuzzySkin.cpp @@ -285,7 +285,7 @@ Polygon apply_fuzzy_skin(const Polygon& polygon, const PerimeterGenerator& perim // Split the loops into lines with different config, and fuzzy them separately fuzzified = polygon; for (const auto& r : fuzzified_regions) { - const auto splitted = Algorithm::split_line(fuzzified, r.second, true); + auto splitted = Algorithm::split_line(fuzzified, r.second, true); if (splitted.empty()) { // No intersection, skip continue; @@ -296,26 +296,24 @@ Polygon apply_fuzzy_skin(const Polygon& polygon, const PerimeterGenerator& perim // The entire polygon is fuzzified fuzzy_polyline(fuzzified.points, true, slice_z, r.first); } else { + // Start from a non-clipped junction so wrapped clipped segments do + // not need an artificial reconnection across the seam. + const auto first_non_clipped = std::find_if(splitted.begin(), splitted.end(), [](const Algorithm::SplitLineJunction& j) { + return !j.clipped; + }); + if (first_non_clipped != splitted.begin()) { + std::rotate(splitted.begin(), first_non_clipped, splitted.end()); + } Points segment; segment.reserve(splitted.size()); fuzzified.points.clear(); const auto fuzzy_current_segment = [&segment, &fuzzified, &r, slice_z]() { - // Orca: non fuzzy points to isolate fuzzy region - const auto front = segment.front(); - const auto back = segment.back(); - + fuzzified.points.push_back(segment.front()); + const auto back = segment.back(); fuzzy_polyline(segment, false, slice_z, r.first); - //Orca: only add non fuzzy point if it's not in the polygon closing point. - if (!fuzzified.points.empty() - && fuzzified.points.back() != front) { - fuzzified.points.push_back(front); - } fuzzified.points.insert(fuzzified.points.end(), segment.begin(), segment.end()); - //Orca: only add non fuzzy point if it's not in the polygon closing point. - if (!fuzzified.points.empty() && fuzzified.points.back() != front) { - fuzzified.points.push_back(back); - } + fuzzified.points.push_back(back); segment.clear(); }; @@ -338,12 +336,7 @@ Polygon apply_fuzzy_skin(const Polygon& polygon, const PerimeterGenerator& perim } } } - - // Orca: ensure the loop is closed after fuzzification - if (!fuzzified.points.empty() && fuzzified.points.front() != fuzzified.points.back()) { - fuzzified.points.back() = fuzzified.points.front(); - } - + return fuzzified; }