Skip to content

Commit 1c45045

Browse files
author
supermerill
committed
Add sanity check for gapfill's min width.
1 parent 1687c5c commit 1c45045

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

xs/src/libslic3r/PerimeterGenerator.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ PerimeterGenerator::process()
2727
// solid infill
2828
coord_t ispacing = this->solid_infill_flow.scaled_spacing();
2929

30+
//nozzle diameter
31+
const double nozzle_diameter = this->print_config->nozzle_diameter.get_at(this->config->perimeter_extruder-1);
32+
3033
// Calculate the minimum required spacing between two adjacent traces.
3134
// This should be equal to the nominal flow spacing but we experiment
3235
// with some tolerance in order to avoid triggering medial axis when
@@ -48,8 +51,6 @@ PerimeterGenerator::process()
4851
// We consider overhang any part where the entire nozzle diameter is not supported by the
4952
// lower layer, so we take lower slices and offset them by half the nozzle diameter used
5053
// in the current layer
51-
double nozzle_diameter = this->print_config->nozzle_diameter.get_at(this->config->perimeter_extruder-1);
52-
5354
this->_lower_slices_p = offset(*this->lower_slices, scale_(+nozzle_diameter/2));
5455
}
5556

@@ -319,6 +320,8 @@ PerimeterGenerator::process()
319320

320321
// collapse
321322
double min = 0.2*pwidth * (1 - INSET_OVERLAP_TOLERANCE);
323+
//be sure we don't gapfill where the perimeters are already touching each other (negative spacing).
324+
min = std::max(min, double(Flow::new_from_spacing(EPSILON, nozzle_diameter, this->layer_height, false).scaled_width()));
322325
double max = 2*pspacing;
323326
ExPolygons gaps_ex = diff_ex(
324327
offset2(gaps, -min/2, +min/2),

0 commit comments

Comments
 (0)