From 2a2633da0afcca36cf875cd28b798c639ae3c628 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 23 Jun 2013 21:11:46 +0200 Subject: New automatic built-in STL repair --- slic3r.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'slic3r.pl') diff --git a/slic3r.pl b/slic3r.pl index 0b05cd043..771dc80ce 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -33,6 +33,7 @@ my %cli_options = (); 'datadir=s' => \$opt{datadir}, 'export-svg' => \$opt{export_svg}, 'merge|m' => \$opt{merge}, + 'repair' => \$opt{repair}, ); foreach my $opt_key (keys %{$Slic3r::Config::Options}) { my $cli = $Slic3r::Config::Options->{$opt_key}->{cli} or next; @@ -92,6 +93,18 @@ die $@ if $@ && $opt{gui}; if (@ARGV) { # slicing from command line $config->validate; + if ($opt{repair}) { + foreach my $file (@ARGV) { + die "Repair is currently supported only on STL files\n" + if $file !~ /\.stl$/i; + + my $output_file = $file; + $output_file =~ s/\.(stl)$/_fixed.obj/i; + Slic3r::TriangleMesh::XS::stl_repair($file, $output_file); + } + exit; + } + while (my $input_file = shift @ARGV) { my $model; if ($opt{merge}) { @@ -150,6 +163,7 @@ Usage: slic3r.pl [ OPTIONS ] file.stl -o, --output File to output gcode to (by default, the file will be saved into the same directory as the input file using the --output-filename-format to generate the filename) + --repair Automatically repair given STL files and saves them as _fixed.obj $j GUI options: --no-plater Disable the plater tab -- cgit v1.2.3