From a1a39d3a2e4ada6f88377cb90cf8aaa6a83344d6 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Sun, 23 Jun 2013 13:19:35 +0200 Subject: [PATCH 1/4] Let cpanm automatically discover the need for --sudo or --local-lib in order to allow non-root installs. --- Build.PL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build.PL b/Build.PL index d64762a1e..77c10c5ae 100644 --- a/Build.PL +++ b/Build.PL @@ -69,7 +69,7 @@ EOF my %modules = (%prereqs, %recommends); foreach my $module (sort keys %modules) { my $version = $modules{$module}; - system $cpanm, '--sudo', "$module~$version"; + system $cpanm, "$module~$version"; } if (eval "use App::Prove; 1") { From 2d687cd0a0e5110e54b6cbbd9705c779a0b6fd3f Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 23 Jun 2013 18:21:47 +0200 Subject: [PATCH 2/4] Only combine internal infill and leave internal-solid as it is. #1248 --- lib/Slic3r/Print/Object.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index 0df58e872..71128dd2d 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -741,8 +741,8 @@ sub combine_infill { my @layerms = map $self->layers->[$_]->regions->[$region_id], ($layer_id - ($combine[$layer_id]-1) .. $layer_id); - # process internal and internal-solid infill separately - for my $type (S_TYPE_INTERNAL, S_TYPE_INTERNALSOLID) { + # only combine internal infill + for my $type (S_TYPE_INTERNAL) { # we need to perform a multi-layer intersection, so let's split it in pairs # initialize the intersection with the candidates of the lowest layer From 8ea4ed3b5e3cae50d64ea75e66a2516295f2c4a9 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 23 Jun 2013 19:25:02 +0200 Subject: [PATCH 3/4] Allow to supply custom G-code via command line if file is not found --- lib/Slic3r/Config.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 5aed5713a..83088f58d 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -1071,13 +1071,13 @@ sub new_from_cli { for (qw(start end layer toolchange)) { my $opt_key = "${_}_gcode"; if ($args{$opt_key}) { - die "Invalid value for --${_}-gcode: file does not exist\n" - if !-e $args{$opt_key}; - Slic3r::open(\my $fh, "<", $args{$opt_key}) - or die "Failed to open $args{$opt_key}\n"; - binmode $fh, ':utf8'; - $args{$opt_key} = do { local $/; <$fh> }; - close $fh; + if (-e $args{$opt_key}) { + Slic3r::open(\my $fh, "<", $args{$opt_key}) + or die "Failed to open $args{$opt_key}\n"; + binmode $fh, ':utf8'; + $args{$opt_key} = do { local $/; <$fh> }; + close $fh; + } } } From 625a3008221e8c9269c81e97d8419ad1460e4af0 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 23 Jun 2013 19:25:32 +0200 Subject: [PATCH 4/4] New [layer_num] placeholder in layer change G-code --- lib/Slic3r/GCode/Layer.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/GCode/Layer.pm b/lib/Slic3r/GCode/Layer.pm index 5d398f463..26db9fc06 100644 --- a/lib/Slic3r/GCode/Layer.pm +++ b/lib/Slic3r/GCode/Layer.pm @@ -44,7 +44,9 @@ sub process_layer { $self->gcodegen->move_z_callback(sub { $self->gcodegen->move_z_callback(undef); # circular ref or not? return "" if !$Slic3r::Config->layer_gcode; - return $Slic3r::Config->replace_options($Slic3r::Config->layer_gcode) . "\n"; + return $Slic3r::Config->replace_options($Slic3r::Config->layer_gcode, { + layer_num => $self->gcodegen->layer->id, + }) . "\n"; }); # extrude skirt