diff --git a/Build.PL b/Build.PL index d64762a1..c6fd4543 100644 --- a/Build.PL +++ b/Build.PL @@ -69,8 +69,14 @@ EOF my %modules = (%prereqs, %recommends); foreach my $module (sort keys %modules) { my $version = $modules{$module}; - system $cpanm, '--sudo', "$module~$version"; + if ($ENV{SLIC3R_NO_AUTO}) { + print "Missing prerequisite $module $version\n" + if !eval "use $module $version; 1"; + } else { + system $cpanm, "$module~$version"; + } } +exit if $ENV{SLIC3R_NO_AUTO}; if (eval "use App::Prove; 1") { App::Prove->new->run; diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 5aed5713..83088f58 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; + } } } diff --git a/lib/Slic3r/GCode/Layer.pm b/lib/Slic3r/GCode/Layer.pm index 5d398f46..26db9fc0 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 diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index e50814f8..8aa833e1 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -738,8 +738,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