From bce3e9621048f735bf96b2d6a16eea5d9518ab9f Mon Sep 17 00:00:00 2001 From: Mike Sheldrake Date: Mon, 14 Jan 2013 21:18:31 -0800 Subject: [PATCH] extraneous fill against sloped walls with fill every N layers #834 Polygons used for N x depth fill surfaces need to be offset by flow spacing before they are reused to clip lower fill surfaces. Otherwise thin fill sections remain on clipped layers against sloping walls, and the N x depth fill collides with them. --- lib/Slic3r/Print/Object.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index bf4f77aa0..f85824961 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -445,8 +445,8 @@ sub combine_infill { my $area_threshold = $Slic3r::flow->scaled_spacing ** 2; for my $region_id (0 .. ($self->print->regions_count-1)) { - # start from bottom, skip first layer - for (my $i = 1; $i < $self->layer_count; $i++) { + # start from top, skip lowest layer + for (my $i = $self->layer_count - 1; $i > 0; $i--) { my $layerm = $self->layers->[$i]->regions->[$region_id]; # skip layer if no internal fill surfaces @@ -506,6 +506,13 @@ sub combine_infill { { my @new_surfaces = (); push @new_surfaces, grep $_->surface_type != S_TYPE_INTERNAL, @{$lower_layerm->fill_surfaces}; + + # offset for the two different flow spacings + $intersection = [ map $_->offset_ex( + $lower_layerm->perimeter_flow->scaled_spacing / 2 + + $layerm->perimeter_flow->scaled_spacing / 2 + ), @$intersection]; + foreach my $depth (1..$Slic3r::Config->infill_every_layers) { push @new_surfaces, map Slic3r::Surface->new (expolygon => $_, surface_type => S_TYPE_INTERNAL, depth_layers => $depth),