From 7d2e89286fd52145d18eb206780c435f996158f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Thu, 24 Mar 2022 09:47:33 +0100 Subject: [PATCH] Added a possibility into thick_polyline_to_extrusion_paths() to separately set tolerance for merging two following lines based on a difference between lines width. --- src/libslic3r/PerimeterGenerator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index 51c26209e..01d3c592a 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -8,7 +8,7 @@ namespace Slic3r { -static ExtrusionPaths thick_polyline_to_extrusion_paths(const ThickPolyline &thick_polyline, ExtrusionRole role, const Flow &flow, const float tolerance) +static ExtrusionPaths thick_polyline_to_extrusion_paths(const ThickPolyline &thick_polyline, ExtrusionRole role, const Flow &flow, const float tolerance, const float merge_tolerance) { ExtrusionPaths paths; ExtrusionPath path(role); @@ -71,7 +71,7 @@ static ExtrusionPaths thick_polyline_to_extrusion_paths(const ThickPolyline &thi path.height = new_flow.height(); } else { thickness_delta = fabs(scale_(flow.width()) - w); - if (thickness_delta <= tolerance) { + if (thickness_delta <= merge_tolerance) { // the width difference between this line and the current flow width is // within the accepted tolerance path.polyline.append(line.b); @@ -95,7 +95,7 @@ static void variable_width(const ThickPolylines& polylines, ExtrusionRole role, // of segments, and any pruning shall be performed before we apply this tolerance. const float tolerance = float(scale_(0.05)); for (const ThickPolyline &p : polylines) { - ExtrusionPaths paths = thick_polyline_to_extrusion_paths(p, role, flow, tolerance); + ExtrusionPaths paths = thick_polyline_to_extrusion_paths(p, role, flow, tolerance, tolerance); // Append paths to collection. if (! paths.empty()) { if (paths.front().first_point() == paths.back().last_point())