From 9a86edc70cae5635829578c81434e86560582c9f Mon Sep 17 00:00:00 2001 From: Mike Sheldrake Date: Sat, 16 Feb 2013 07:53:47 -0800 Subject: [PATCH] account for extrusion width when clearing layers for combined infill Otherwise you get extraneous fill up against sloped walls in regions of layers that should not have fill, like in #834. --- lib/Slic3r/Print/Object.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index 800290a6d..e31278340 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -565,6 +565,12 @@ sub combine_infill { # $intersection now contains the regions that can be combined across the full amount of layers # so let's remove those areas from all layers + + my @intersection_with_clearance = map $_->offset( + $layerms[-1]->infill_flow->scaled_width / 2 + + $layerms[-1]->perimeter_flow->scaled_width / 2 + ), @$intersection; + foreach my $layerm (@layerms) { my @this_type = grep $_->surface_type == $type, @{$layerm->fill_surfaces}; my @other_types = grep $_->surface_type != $type, @{$layerm->fill_surfaces}; @@ -572,7 +578,7 @@ sub combine_infill { @this_type = map Slic3r::Surface->new(expolygon => $_, surface_type => $type), @{diff_ex( [ map @{$_->expolygon}, @this_type ], - [ map @$_, @$intersection ], + [ @intersection_with_clearance ], )}; # apply surfaces back with adjusted depth to the uppermost layer