From d5a9320587ebc77f813aee0be4901c611d2adb70 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 8 Jun 2013 17:48:34 +0200 Subject: [PATCH 1/2] Bugfix: narrow top surfaces didn't generate solid layers. #1161 --- lib/Slic3r/Print/Object.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index bfc46ce62..9f9f43539 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -383,7 +383,6 @@ sub detect_surfaces_type { 1, ); return map Slic3r::Surface->new(expolygon => $_, surface_type => $result_type), - grep $_->is_printable($layerm->perimeter_flow->scaled_width), @$expolygons; }; From 8b2c13cc6f225915bf6df837859b0685979f9e62 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 8 Jun 2013 20:01:26 +0200 Subject: [PATCH 2/2] Regression test for top solid surfaces in V-shaped object. #1161 --- lib/Slic3r/Test.pm | 7 +++++++ t/shells.t | 25 ++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Test.pm b/lib/Slic3r/Test.pm index 46443cc6a..1a0f0e2d4 100644 --- a/lib/Slic3r/Test.pm +++ b/lib/Slic3r/Test.pm @@ -27,6 +27,13 @@ sub model { $facets = [ [0,1,2], [0,2,3], [4,5,6], [4,6,7], [0,4,7], [0,7,1], [1,7,6], [1,6,2], [2,6,5], [2,5,3], [4,0,3], [4,3,5], ], + } elsif ($model_name eq 'V') { + $vertices = [ + [-14,0,20],[-14,15,20],[0,0,0],[0,15,0],[-4,0,20],[-4,15,20],[5,0,7.14286],[10,0,0],[24,0,20],[14,0,20],[10,15,0],[5,15,7.14286],[14,15,20],[24,15,20] + ]; + $facets = [ + [0,1,2],[2,1,3],[1,0,4],[5,1,4],[4,0,2],[6,4,2],[7,6,2],[8,9,7],[9,6,7],[2,3,7],[7,3,10],[1,5,3],[3,5,11],[11,12,13],[11,13,3],[3,13,10],[5,4,6],[11,5,6],[6,9,11],[11,9,12],[12,9,8],[13,12,8],[8,7,10],[13,8,10] + ], } my $model = Slic3r::Model->new; diff --git a/t/shells.t b/t/shells.t index 7977f491e..56a3ca595 100644 --- a/t/shells.t +++ b/t/shells.t @@ -1,4 +1,4 @@ -use Test::More tests => 2; +use Test::More tests => 3; use strict; use warnings; @@ -45,4 +45,27 @@ use Slic3r::Test; ok $test->(), "proper number of shells is applied even when fill density is none"; } +# issue #1161 +{ + my $config = Slic3r::Config->new_from_defaults; + $config->set('layer_height', 0.3); + $config->set('first_layer_height', '100%'); + $config->set('bottom_solid_layers', 0); + $config->set('top_solid_layers', 3); + $config->set('cooling', 0); + $config->set('solid_infill_speed', 99); + $config->set('top_solid_infill_speed', 99); + + my $print = Slic3r::Test::init_print('V', config => $config); + my %layers_with_solid_infill = (); # Z => 1 + Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub { + my ($self, $cmd, $args, $info) = @_; + + $layers_with_solid_infill{$self->Z} = 1 + if $info->{extruding} && ($args->{F} // $self->F) == $config->solid_infill_speed*60; + }); + is scalar(map $layers_with_solid_infill{$_}, grep $_ <= 7.2, keys %layers_with_solid_infill), 3, + "correct number of top solid shells is generated in V-shaped object"; +} + __END__