PrusaSlicer-NonPlainar/lib/Slic3r/Layer.pm

47 lines
924 B
Perl
Raw Normal View History

2016-09-13 09:24:55 +00:00
# Extends the C++ class Slic3r::Layer.
2011-09-01 19:06:28 +00:00
package Slic3r::Layer;
2014-06-12 07:23:10 +00:00
use strict;
use warnings;
2011-09-01 19:06:28 +00:00
# the following two were previously generated by Moo
sub print {
my $self = shift;
return $self->object->print;
}
sub config {
my $self = shift;
return $self->object->config;
}
2012-09-23 00:52:31 +00:00
sub region {
my $self = shift;
2012-09-23 00:52:31 +00:00
my ($region_id) = @_;
while ($self->region_count <= $region_id) {
$self->add_region($self->object->print->get_region($self->region_count));
}
return $self->get_region($region_id);
}
sub regions {
my ($self) = @_;
return [ map $self->get_region($_), 0..($self->region_count-1) ];
}
sub make_fill {
my ($self) = @_;
foreach my $layerm (@{$self->regions}) {
$layerm->fills->clear;
$layerm->fills->append($_) for $self->object->fill_maker->make_fill($layerm);
}
}
2013-07-29 18:49:54 +00:00
package Slic3r::Layer::Support;
our @ISA = qw(Slic3r::Layer);
2013-07-29 18:49:54 +00:00
2011-09-01 19:06:28 +00:00
1;