diff options
author | supermerill <merill@free.fr> | 2022-09-07 00:27:16 +0300 |
---|---|---|
committer | supermerill <merill@free.fr> | 2022-09-13 01:30:39 +0300 |
commit | 862b12fdbea312e128b31b94cca29a8e5c841c96 (patch) | |
tree | fbcf530d7fa0974ba5e7ddf21469b444b37feb77 | |
parent | 7f7900999eb48974b5c14ae0338eba48ec1f0ea3 (diff) |
Fix possible too low width for thin walls / gapfill when the spacing ratio is low
supermerill/SuperSlicer#3184
-rw-r--r-- | src/libslic3r/Geometry/MedialAxis.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libslic3r/Geometry/MedialAxis.cpp b/src/libslic3r/Geometry/MedialAxis.cpp index d209cba53..16a710a48 100644 --- a/src/libslic3r/Geometry/MedialAxis.cpp +++ b/src/libslic3r/Geometry/MedialAxis.cpp @@ -3150,15 +3150,7 @@ variable_width(const ThickPolyline& polyline, const ExtrusionRole role, const Fl // default: extrude a thin wall that doesn't go outside of the specified width. double wanted_width = unscaled(line.a_width); //if gapfill or arachne, the width is in fact the spacing. - if (role == erThinWall) { - // thinwall : check if th width isn't too small (negative spacing) - if (unscale<coordf_t>(line.a_width) < 2 * Flow::rounded_rectangle_extrusion_width_from_spacing(0.f, flow.height(), flow.spacing_ratio())) { - //width (too) small, be sure to not extrude with negative spacing. - //we began to fall back to spacing gradually even before the spacing go into the negative - // to make extrusion1 < extrusion2 if width1 < width2 even if width2 is too small. - wanted_width = unscaled(line.a_width) * 0.35 + 1.3 * Flow::rounded_rectangle_extrusion_width_from_spacing(0.f, flow.height(), flow.spacing_ratio()); - } - } else { + if (role != erThinWall) { if (role == erOverhangPerimeter && flow.bridge()) { // for Arachne overhangs: keep the bridge width. wanted_width = flow.width(); @@ -3168,6 +3160,14 @@ variable_width(const ThickPolyline& polyline, const ExtrusionRole role, const Fl wanted_width = Flow::rounded_rectangle_extrusion_width_from_spacing(unscaled(line.a_width), flow.height(), flow.spacing_ratio()); } } + // check if the width isn't too small (negative spacing) + // 1.f spacing ratio, because it's to get the really minimum. 0 spacing ratio will makes that irrelevant. + if (unscale<coordf_t>(line.a_width) < 2 * Flow::rounded_rectangle_extrusion_width_from_spacing(0.f, flow.height(), 1.f)) { + //width (too) small, be sure to not extrude with negative spacing. + //we began to fall back to spacing gradually even before the spacing go into the negative + // to make extrusion1 < extrusion2 if width1 < width2 even if width2 is too small. + wanted_width = unscaled(line.a_width) * 0.35 + 1.3 * Flow::rounded_rectangle_extrusion_width_from_spacing(0.f, flow.height(), 1.f); + } if (path.polyline.points.empty()) { if (wanted_width != current_flow.width()) { |