This file is indexed.

/usr/share/perl5/Slic3r/Layer.pm is in slic3r 1.1.7+dfsg-2+b1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package Slic3r::Layer;
use Moo;

use List::Util qw(first);
use Slic3r::Geometry qw(scale chained_path);
use Slic3r::Geometry::Clipper qw(union_ex);

has 'id'                => (is => 'rw', required => 1); # sequential number of layer, 0-based
has 'object'            => (is => 'ro', weak_ref => 1, required => 1, handles => [qw(print config)]);
has 'upper_layer'       => (is => 'rw', weak_ref => 1);
has 'lower_layer'       => (is => 'rw', weak_ref => 1);
has 'regions'           => (is => 'ro', default => sub { [] });
has 'slicing_errors'    => (is => 'rw');

has 'slice_z'           => (is => 'ro', required => 1); # Z used for slicing in unscaled coordinates
has 'print_z'           => (is => 'ro', required => 1); # Z used for printing in unscaled coordinates
has 'height'            => (is => 'ro', required => 1); # layer height in unscaled coordinates

# collection of expolygons generated by slicing the original geometry;
# also known as 'islands' (all regions and surface types are merged here)
has 'slices'            => (is => 'rw', default => sub { Slic3r::ExPolygon::Collection->new });

# the purpose of this method is to be overridden for ::Support layers
sub islands {
    my $self = shift;
    return $self->slices;
}

sub region {
    my $self = shift;
    my ($region_id) = @_;
    
    for (my $i = @{$self->regions}; $i <= $region_id; $i++) {
        $self->regions->[$i] //= Slic3r::Layer::Region->new(
            layer   => $self,
            region  => $self->object->print->regions->[$i],
        );
    }
    
    return $self->regions->[$region_id];
}

# merge all regions' slices to get islands
sub make_slices {
    my $self = shift;
    
    my $slices = union_ex([ map $_->p, map @{$_->slices}, @{$self->regions} ]);
    
    # sort slices
    $slices = [ @$slices[@{chained_path([ map $_->contour->first_point, @$slices ])}] ];
    
    $self->slices->clear;
    $self->slices->append(@$slices);
}

sub make_perimeters {
    my $self = shift;
    Slic3r::debugf "Making perimeters for layer %d\n", $self->id;
    $_->make_perimeters for @{$self->regions};
}

package Slic3r::Layer::Support;
use Moo;
extends 'Slic3r::Layer';

# ordered collection of extrusion paths to fill surfaces for support material
has 'support_islands'           => (is => 'rw', default => sub { Slic3r::ExPolygon::Collection->new });
has 'support_fills'             => (is => 'rw', default => sub { Slic3r::ExtrusionPath::Collection->new });
has 'support_interface_fills'   => (is => 'rw', default => sub { Slic3r::ExtrusionPath::Collection->new });

sub islands {
    my $self = shift;
    return [ @{$self->slices}, @{$self->support_islands} ];
}

1;