Faster implementation of concentric infill, with loop order reversed so that smaller loops will be printed at the end. #898

This commit is contained in:
Alessandro Ranellucci 2013-05-13 21:22:57 +02:00
parent ccdb29ddc9
commit a73020c10e
3 changed files with 18 additions and 40 deletions

View file

@ -2,6 +2,7 @@ package Slic3r::ExtrusionPath::Collection;
use Moo;
has 'paths' => (is => 'rw', default => sub { [] });
has 'no_sort' => (is => 'rw');
# no-op
sub unpack { $_[0] }
@ -15,6 +16,8 @@ sub chained_path {
my $self = shift;
my ($start_near) = @_;
return @{$self->paths} if $self->no_sort;
# make sure we pass the same path objects to the Collection constructor
# and the ->chained_path() method because the latter will reverse the
# paths in-place when needed and we need to return them that way