mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-07 05:54:03 -06:00
GUI
This commit is contained in:
parent
a311220c19
commit
f2f9178e07
9 changed files with 478 additions and 83 deletions
34
lib/Slic3r/Skein.pm
Normal file
34
lib/Slic3r/Skein.pm
Normal file
|
@ -0,0 +1,34 @@
|
|||
package Slic3r::Skein;
|
||||
use Moo;
|
||||
|
||||
use Time::HiRes qw(gettimeofday tv_interval);
|
||||
|
||||
has 'input_file' => (is => 'ro', required => 1);
|
||||
has 'output_file' => (is => 'rw', required => 0);
|
||||
|
||||
sub go {
|
||||
my $self = shift;
|
||||
|
||||
die "Input file must have .stl extension\n"
|
||||
if $self->input_file !~ /\.stl$/i;
|
||||
|
||||
my $t0 = [gettimeofday];
|
||||
my $print = Slic3r::Print->new_from_stl($self->input_file);
|
||||
$print->extrude_perimeters;
|
||||
$print->remove_small_features;
|
||||
$print->extrude_fills;
|
||||
|
||||
|
||||
if (!$self->output_file) {
|
||||
my $output_file = $self->input_file;
|
||||
$output_file =~ s/\.stl$/.gcode/i;
|
||||
$self->output_file($output_file);
|
||||
}
|
||||
$print->export_gcode($self->output_file);
|
||||
|
||||
my $processing_time = tv_interval($t0);
|
||||
printf "Done. Process took %d minutes and %.3f seconds\n",
|
||||
int($processing_time/60), $processing_time - int($processing_time/60)*60;
|
||||
}
|
||||
|
||||
1;
|
Loading…
Add table
Add a link
Reference in a new issue