/usr/lib/slic3r/Slic3r/Format/STL.pm is in slic3r 1.2.9+dfsg-9~deb9u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | package Slic3r::Format::STL;
use Moo;
use File::Basename qw(basename);
sub read_file {
my $self = shift;
my ($file) = @_;
my $path = Slic3r::encode_path($file);
die "Failed to open $file\n" if !-e $path;
my $mesh = Slic3r::TriangleMesh->new;
$mesh->ReadSTLFile($path);
$mesh->repair;
die "This STL file couldn't be read because it's empty.\n"
if $mesh->facets_count == 0;
my $model = Slic3r::Model->new;
my $basename = basename($file);
my $object = $model->add_object(input_file => $file, name => $basename);
my $volume = $object->add_volume(mesh => $mesh, name => $basename);
return $model;
}
sub write_file {
my $self = shift;
my ($file, $mesh, %params) = @_;
$mesh = $mesh->mesh if $mesh->isa('Slic3r::Model');
my $path = Slic3r::encode_path($file);
$params{binary}
? $mesh->write_binary($path)
: $mesh->write_ascii($path);
}
1;
|