mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 22:54:08 -06:00
Initial import
This commit is contained in:
commit
55a523e1fa
12 changed files with 891 additions and 0 deletions
29
lib/Slic3r/Print.pm
Normal file
29
lib/Slic3r/Print.pm
Normal file
|
@ -0,0 +1,29 @@
|
|||
package Slic3r::Print;
|
||||
use Moose;
|
||||
|
||||
has 'layers' => (
|
||||
traits => ['Array'],
|
||||
is => 'rw',
|
||||
isa => 'ArrayRef[Slic3r::Layer]',
|
||||
default => sub { [] },
|
||||
handles => {
|
||||
layer_count => 'count',
|
||||
add_layer => 'push',
|
||||
},
|
||||
);
|
||||
|
||||
sub layer {
|
||||
my $self = shift;
|
||||
my ($layer_id) = @_;
|
||||
|
||||
# extend our print by creating all necessary layers
|
||||
if ($self->layer_count < $layer_id + 1) {
|
||||
for (my $i = $self->layer_count; $i <= $layer_id; $i++) {
|
||||
$self->add_layer(Slic3r::Layer->new(id => $i));
|
||||
}
|
||||
}
|
||||
|
||||
return $self->layers->[$layer_id];
|
||||
}
|
||||
|
||||
1;
|
Loading…
Add table
Add a link
Reference in a new issue