mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-05 13:04:03 -06:00
Adopt XS containers everywhere (incomplete work)
This commit is contained in:
parent
339ba9e5c3
commit
9b582a11ff
30 changed files with 130 additions and 311 deletions
|
@ -2,51 +2,17 @@ package Slic3r::ExtrusionLoop;
|
|||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::Geometry qw(same_point);
|
||||
|
||||
sub polygon { $_[0] }
|
||||
|
||||
# class or object method
|
||||
sub pack {
|
||||
my $self = shift;
|
||||
|
||||
if (ref $self) {
|
||||
return $self;
|
||||
} else {
|
||||
return $self->new(@_);
|
||||
}
|
||||
}
|
||||
|
||||
# no-op
|
||||
sub unpack { $_[0] }
|
||||
|
||||
sub split_at_index {
|
||||
my $self = shift;
|
||||
|
||||
return Slic3r::ExtrusionPath->new(
|
||||
polyline => $self->as_polygon->split_at_index(@_),
|
||||
role => $self->role,
|
||||
flow_spacing => $self->flow_spacing,
|
||||
height => $self->height,
|
||||
);
|
||||
}
|
||||
|
||||
sub split_at {
|
||||
my $self = shift;
|
||||
|
||||
return Slic3r::ExtrusionPath->new(
|
||||
polyline => $self->as_polygon->split_at(@_),
|
||||
polyline => $self->polygon->split_at(@_),
|
||||
role => $self->role,
|
||||
flow_spacing => $self->flow_spacing,
|
||||
height => $self->height,
|
||||
);
|
||||
}
|
||||
|
||||
sub split_at_first_point {
|
||||
my $self = shift;
|
||||
return $self->split_at_index(0);
|
||||
}
|
||||
|
||||
sub first_point {
|
||||
my $self = shift;
|
||||
return $self->polygon->[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue