diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2013-07-31 17:10:11 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2013-07-31 17:10:11 +0400 |
commit | 3b47e1a492269c07663ea043bb9465202c3bcd7d (patch) | |
tree | e23788e67d0c20ff28f1906688e811fb665ffa51 /utils | |
parent | 1479d6933b417e26bf49f39d2b6de3ccee84a600 (diff) |
New --info option to show file info (size, volume, repair stats). Removed utils/file_info.pl
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/file_info.pl | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/utils/file_info.pl b/utils/file_info.pl deleted file mode 100755 index 44063ab70..000000000 --- a/utils/file_info.pl +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/perl -# This script reads a file and outputs information about it - -use strict; -use warnings; - -BEGIN { - use FindBin; - use lib "$FindBin::Bin/../lib"; -} - -use File::Basename qw(basename); -use Getopt::Long qw(:config no_auto_abbrev); -use Slic3r; -$|++; - -my %opt = (); -{ - my %options = ( - 'help' => sub { usage() }, - ); - GetOptions(%options) or usage(1); - $ARGV[0] or usage(1); -} - -{ - my $input_file = $ARGV[0]; - die "This script doesn't support AMF yet\n" if $input_file =~ /\.amf$/i; - - my $model; - $model = Slic3r::Format::STL->read_file($input_file) if $input_file =~ /\.stl$/i; - die "Unable to read file\n" if !$model; - - printf "Info about %s:\n", basename($input_file); - my $mesh = $model->mesh; - $mesh->check_manifoldness; - printf " number of facets: %d\n", scalar @{$mesh->facets}; - printf " size: x=%s y=%s z=%s\n", @{$mesh->size}; -} - - -sub usage { - my ($exit_code) = @_; - - print <<"EOF"; -Usage: file_info.pl [ OPTIONS ] file.stl - - --help Output this usage screen and exit - -EOF - exit ($exit_code || 0); -} - -__END__ |