2012-02-25 17:35:25 +01:00
|
|
|
package Slic3r::Format::STL;
|
2011-09-06 11:50:43 +02:00
|
|
|
use Moo;
|
2011-09-01 21:06:28 +02:00
|
|
|
|
2014-02-14 22:24:30 +01:00
|
|
|
use File::Basename qw(basename);
|
|
|
|
|
|
2012-01-28 15:05:42 +01:00
|
|
|
sub write_file {
|
|
|
|
|
my $self = shift;
|
2014-04-25 10:20:30 +02:00
|
|
|
my ($file, $mesh, %params) = @_;
|
|
|
|
|
|
|
|
|
|
$mesh = $mesh->mesh if $mesh->isa('Slic3r::Model');
|
2012-01-28 15:05:42 +01:00
|
|
|
|
2013-09-11 09:49:28 +02:00
|
|
|
my $path = Slic3r::encode_path($file);
|
2012-01-28 15:05:42 +01:00
|
|
|
|
2012-08-29 16:49:38 +02:00
|
|
|
$params{binary}
|
2014-04-25 10:20:30 +02:00
|
|
|
? $mesh->write_binary($path)
|
|
|
|
|
: $mesh->write_ascii($path);
|
2012-02-19 15:45:27 +01:00
|
|
|
}
|
|
|
|
|
|
2011-09-01 21:06:28 +02:00
|
|
|
1;
|