Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsupermerill <merill@free.fr>2022-08-09 13:43:32 +0300
committersupermerill <merill@free.fr>2022-08-10 02:34:53 +0300
commit038a2731101469ff8bad1fb1eb84d924ce43d1ba (patch)
tree44f92d83aa484cee646b77d17d69ffad1b601f54
parentcd8ee420d347c9697ab186653b36caf9078f6b7b (diff)
Fix thinwalls/fill with gapfill
Also make fills with gapfill follow the min/max width & length values for gapfill.
-rw-r--r--src/libslic3r/Fill/FillConcentric.cpp29
-rw-r--r--src/libslic3r/Geometry/MedialAxis.cpp1
2 files changed, 27 insertions, 3 deletions
diff --git a/src/libslic3r/Fill/FillConcentric.cpp b/src/libslic3r/Fill/FillConcentric.cpp
index b2addb62b..9d5726ade 100644
--- a/src/libslic3r/Fill/FillConcentric.cpp
+++ b/src/libslic3r/Fill/FillConcentric.cpp
@@ -141,9 +141,24 @@ FillConcentricWGapFill::fill_surface_extrusion(
//add gapfills
if (!gaps.empty() && params.density >= 1) {
- // collapse
+ // get parameters
coordf_t min = 0.2 * distance * (1 - INSET_OVERLAP_TOLERANCE);
- coordf_t max = 2. * distance;
+ //be sure we don't gapfill where the perimeters are already touching each other (negative spacing).
+ min = std::max(min, double(Flow::new_from_spacing((float)EPSILON, (float)params.flow.nozzle_diameter(), (float)params.flow.height(), (float)params.flow.spacing_ratio(), false).scaled_width()));
+ coordf_t real_max = 2.5 * distance;
+ const coordf_t minwidth = scale_d(params.config->get_abs_value("gap_fill_min_width", params.flow.width()));
+ const coordf_t maxwidth = scale_d(params.config->get_abs_value("gap_fill_max_width", params.flow.width()));
+ const coord_t minlength = scale_t(params.config->get_abs_value("gap_fill_min_length", params.flow.width()));
+ if (minwidth > 0) {
+ min = std::max(min, minwidth);
+ }
+ coordf_t max = real_max;
+ if (maxwidth > 0) {
+ max = std::min(max, maxwidth);
+ }
+ const coord_t gapfill_extension = scale_t(params.config->get_abs_value("gap_fill_extension", params.flow.width()));
+
+ // collapse
ExPolygons gaps_ex = diff_ex(
offset2_ex(gaps, -min / 2, +min / 2),
offset2_ex(gaps, -max / 2, +max / 2),
@@ -153,7 +168,15 @@ FillConcentricWGapFill::fill_surface_extrusion(
//remove too small gaps that are too hard to fill.
//ie one that are smaller than an extrusion with width of min and a length of max.
if (ex.area() > min_gapfill_area) {
- Geometry::MedialAxis{ ex, coord_t(max), coord_t(min), scale_t(params.flow.height()) }.build(polylines);
+ Geometry::MedialAxis md{ ex, coord_t(real_max), coord_t(min), scale_t(params.flow.height()) };
+ if (minlength > 0) {
+ md.set_min_length(minlength);
+ }
+ if (gapfill_extension > 0) {
+ md.set_extension_length(gapfill_extension);
+ }
+ md.set_biggest_width(max);
+ md.build(polylines);
}
}
if (!polylines.empty() && !is_bridge(good_role)) {
diff --git a/src/libslic3r/Geometry/MedialAxis.cpp b/src/libslic3r/Geometry/MedialAxis.cpp
index d94bd9685..e472e510b 100644
--- a/src/libslic3r/Geometry/MedialAxis.cpp
+++ b/src/libslic3r/Geometry/MedialAxis.cpp
@@ -2008,6 +2008,7 @@ MedialAxis::remove_too_thin_extrusion(ThickPolylines& pp)
void
MedialAxis::remove_too_thick_extrusion(ThickPolylines& pp)
{
+ if (this->m_biggest_width <= 0) return;
// remove too thin extrusion at start & end of polylines
bool changes = false;
for (size_t i = 0; i < pp.size(); ++i) {