Layer.pm 711 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # Extends the C++ class Slic3r::Layer.
  2. package Slic3r::Layer;
  3. use strict;
  4. use warnings;
  5. # the following two were previously generated by Moo
  6. sub print {
  7. my $self = shift;
  8. return $self->object->print;
  9. }
  10. sub config {
  11. my $self = shift;
  12. return $self->object->config;
  13. }
  14. sub region {
  15. my $self = shift;
  16. my ($region_id) = @_;
  17. while ($self->region_count <= $region_id) {
  18. $self->add_region($self->object->print->get_region($self->region_count));
  19. }
  20. return $self->get_region($region_id);
  21. }
  22. sub regions {
  23. my ($self) = @_;
  24. return [ map $self->get_region($_), 0..($self->region_count-1) ];
  25. }
  26. package Slic3r::Layer::Support;
  27. our @ISA = qw(Slic3r::Layer);
  28. 1;