Further memory savings
This commit is contained in:
parent
25b2cdc6d9
commit
08efb15f4d
1 changed files with 27 additions and 13 deletions
|
@ -1,21 +1,35 @@
|
||||||
package Slic3r::Surface;
|
package Slic3r::Surface;
|
||||||
use Moo;
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
has 'expolygon' => (
|
use constant S_EXPOLYGON => 0;
|
||||||
is => 'ro',
|
use constant S_SURFACE_TYPE => 1;
|
||||||
required => 1,
|
use constant S_DEPTH_LAYERS => 2;
|
||||||
handles => [qw(encloses_point lines contour holes)],
|
use constant S_BRIDGE_ANGLE => 3;
|
||||||
);
|
|
||||||
|
|
||||||
has 'surface_type' => (
|
sub new {
|
||||||
is => 'rw',
|
my $class = shift;
|
||||||
#isa => enum([qw(internal internal-solid bottom top)]),
|
my %args = @_;
|
||||||
);
|
|
||||||
|
|
||||||
# this integer represents the thickness of the surface expressed in layers
|
my $self = [
|
||||||
has 'depth_layers' => (is => 'ro', default => sub {1});
|
map delete $args{$_}, qw(expolygon surface_type depth_layers bridge_angle),
|
||||||
|
];
|
||||||
|
$self->[S_DEPTH_LAYERS] //= 1; #/
|
||||||
|
|
||||||
has 'bridge_angle' => (is => 'ro');
|
bless $self, $class;
|
||||||
|
$self;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub expolygon { $_[0][S_EXPOLYGON] }
|
||||||
|
sub surface_type { $_[0][S_SURFACE_TYPE] = $_[1] if $_[1]; $_[0][S_SURFACE_TYPE] }
|
||||||
|
sub depth_layers { $_[0][S_DEPTH_LAYERS] } # this integer represents the thickness of the surface expressed in layers
|
||||||
|
sub bridge_angle { $_[0][S_BRIDGE_ANGLE] }
|
||||||
|
|
||||||
|
# delegate handles
|
||||||
|
sub encloses_point { $_[0]->expolygon->encloses_point }
|
||||||
|
sub lines { $_[0]->expolygon->lines }
|
||||||
|
sub contour { $_[0]->expolygon->contour }
|
||||||
|
sub holes { $_[0]->expolygon->holes }
|
||||||
|
|
||||||
# static method to group surfaces having same surface_type, bridge_angle and depth_layers
|
# static method to group surfaces having same surface_type, bridge_angle and depth_layers
|
||||||
sub group {
|
sub group {
|
||||||
|
|
Loading…
Reference in a new issue