Browse Source

Bugfix: support material and brim didn't work correctly. Includes unit test. #1074

Alessandro Ranellucci 12 years ago
parent
commit
f5e48a306d
3 changed files with 27 additions and 4 deletions
  1. 1 0
      MANIFEST
  2. 5 4
      lib/Slic3r/Polyline.pm
  3. 21 0
      t/support.t

+ 1 - 0
MANIFEST

@@ -72,6 +72,7 @@ t/retraction.t
 t/serialize.t
 t/shells.t
 t/slice.t
+t/support.t
 t/vibrationlimit.t
 utils/amf-to-stl.pl
 utils/file_info.pl

+ 5 - 4
lib/Slic3r/Polyline.pm

@@ -86,10 +86,11 @@ sub length {
 
 sub grow {
     my $self = shift;
-    return Slic3r::Geometry::Clipper::offset(
-        [ Slic3r::Polygon->new(@$self, CORE::reverse @$self[1..($#$self-1)]) ],
-        @_,
-    );
+    return map Slic3r::Polygon->new($_),
+        Slic3r::Geometry::Clipper::offset(
+            [ Slic3r::Polygon->new(@$self, CORE::reverse @$self[1..($#$self-1)]) ],
+            @_,
+        );
 }
 
 sub nearest_point_to {

+ 21 - 0
t/support.t

@@ -0,0 +1,21 @@
+use Test::More tests => 1;
+use strict;
+use warnings;
+
+BEGIN {
+    use FindBin;
+    use lib "$FindBin::Bin/../lib";
+}
+
+use Slic3r;
+use Slic3r::Test;
+
+{
+    my $config = Slic3r::Config->new_from_defaults;
+    $config->set('raft_layers', 3);
+    $config->set('brim_width',  6);
+    my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
+    ok Slic3r::Test::gcode($print), 'no conflict between raft/support and brim';
+}
+
+__END__