From 951778439ac86c4b8f1c27c3e04efc0f65705ab9 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 26 Nov 2011 15:21:15 +0100 Subject: [PATCH] Bugfix: recent changes broke the "infill every layers" option which didn't alternate infill direction correctly. #70 --- lib/Slic3r/Fill.pm | 1 + lib/Slic3r/Surface.pm | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Fill.pm b/lib/Slic3r/Fill.pm index fb3094e198..f59acc80cd 100644 --- a/lib/Slic3r/Fill.pm +++ b/lib/Slic3r/Fill.pm @@ -66,6 +66,7 @@ sub make_fill { push @surfaces, map Slic3r::Surface->cast_from_expolygon($_, surface_type => $group->[0]->surface_type, bridge_angle => $group->[0]->bridge_angle, + depth_layers => $group->[0]->depth_layers, ), @$union; } } diff --git a/lib/Slic3r/Surface.pm b/lib/Slic3r/Surface.pm index 8119453710..ef5d5c3338 100644 --- a/lib/Slic3r/Surface.pm +++ b/lib/Slic3r/Surface.pm @@ -49,7 +49,7 @@ sub cast_from_expolygon { ); } -# static method to group surfaces having same surface_type and bridge_angle +# static method to group surfaces having same surface_type, bridge_angle and depth_layers sub group { my $class = shift; my $params = ref $_[0] eq 'HASH' ? shift(@_) : {}; @@ -57,7 +57,8 @@ sub group { my $unique_type = sub { ($params->{merge_solid} && $_[0]->surface_type =~ /top|bottom|solid/ - ? 'solid' : $_[0]->surface_type) . "_" . ($_[0]->bridge_angle || ''); + ? 'solid' : $_[0]->surface_type) . "_" . ($_[0]->bridge_angle || '') + . "_" . $_[0]->depth_layers; }; my @unique_types = (); foreach my $surface (@surfaces) {