Perl unit tests for perimeters and multi-material were rewritten to C++.
Perl binding was slimmed down, namely Clipper is no more linked by Perl.
This commit is contained in:
parent
7380787b3a
commit
a627614b58
48 changed files with 1194 additions and 2310 deletions
|
@ -23,47 +23,6 @@ our $Options = print_config_def();
|
|||
}
|
||||
}
|
||||
|
||||
# From command line parameters, used by slic3r.pl
|
||||
sub new_from_cli {
|
||||
my $class = shift;
|
||||
my %args = @_;
|
||||
|
||||
# Delete hash keys with undefined value.
|
||||
delete $args{$_} for grep !defined $args{$_}, keys %args;
|
||||
|
||||
# Replace the start_gcode, end_gcode ... hash values
|
||||
# with the content of the files they reference.
|
||||
for (qw(start end layer toolchange)) {
|
||||
my $opt_key = "${_}_gcode";
|
||||
if ($args{$opt_key}) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $self = $class->new;
|
||||
foreach my $opt_key (keys %args) {
|
||||
my $opt_def = $Options->{$opt_key};
|
||||
|
||||
# we use set_deserialize() for bool options since GetOpt::Long doesn't handle
|
||||
# arrays of boolean values
|
||||
if ($opt_key =~ /^(?:bed_shape|duplicate_grid|extruder_offset)$/ || $opt_def->{type} eq 'bool') {
|
||||
$self->set_deserialize($opt_key, $args{$opt_key});
|
||||
} elsif (my $shortcut = $opt_def->{shortcut}) {
|
||||
$self->set($_, $args{$opt_key}) for @$shortcut;
|
||||
} else {
|
||||
$self->set($opt_key, $args{$opt_key});
|
||||
}
|
||||
}
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
package Slic3r::Config::Static;
|
||||
use parent 'Slic3r::Config';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue