From 7a695a4a2f4ae02f201df5719d1d8e074c5730c0 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 23 Feb 2015 23:44:34 +0100 Subject: [PATCH] Change the behaviour of infill/perimeter overlap to handle some edge cases. #2632 --- lib/Slic3r/Layer/PerimeterGenerator.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Layer/PerimeterGenerator.pm b/lib/Slic3r/Layer/PerimeterGenerator.pm index 987e93588..a5b737466 100644 --- a/lib/Slic3r/Layer/PerimeterGenerator.pm +++ b/lib/Slic3r/Layer/PerimeterGenerator.pm @@ -311,12 +311,22 @@ sub process { # we offset by half the perimeter spacing (to get to the actual infill boundary) # and then we offset back and forth by half the infill spacing to only consider the # non-collapsing regions + my $inset = 0; + if ($loop_number == 0) { + # one loop + $inset += $ext_pspacing/2; + } elsif ($loop_number > 0) { + # two or more loops + $inset += $pspacing/2; + } + $inset -= $self->config->get_abs_value_over('infill_overlap', $pwidth); + my $min_perimeter_infill_spacing = $ispacing * (1 - &Slic3r::INSET_OVERLAP_TOLERANCE); $self->fill_surfaces->append($_) for map Slic3r::Surface->new(expolygon => $_, surface_type => S_TYPE_INTERNAL), # use a bogus surface type @{offset2_ex( [ map @{$_->simplify_p(&Slic3r::SCALED_RESOLUTION)}, @{union_ex(\@last)} ], - -($pspacing/2 - $self->config->get_abs_value_over('infill_overlap', $pwidth) + $min_perimeter_infill_spacing/2), + -$inset -$min_perimeter_infill_spacing/2, +$min_perimeter_infill_spacing/2, )}; }