New option to randomize starting points across layers

This commit is contained in:
Alessandro Ranellucci 2012-05-19 22:36:29 +02:00
parent b360b2bcea
commit fa4f2c8b97
8 changed files with 50 additions and 24 deletions

View file

@ -285,12 +285,10 @@ sub make_perimeters {
}
# do holes, then contours starting from innermost one
foreach my $polygon ((reverse @holes), (map $_->contour, map @$_, reverse @$island)) {
next unless $polygon->is_printable;
push @{ $self->perimeters }, Slic3r::ExtrusionLoop->new(
polygon => $polygon,
role => (abs($polygon->length) <= $Slic3r::small_perimeter_length) ? EXTR_ROLE_SMALLPERIMETER : EXTR_ROLE_PERIMETER,
);
$self->add_perimeter($_) for reverse @holes;
for my $depth (reverse 0 .. $#$island) {
my $role = $depth == $#$island ? EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER : EXTR_ROLE_PERIMETER;
$self->add_perimeter($_, $role) for map $_->contour, @{$island->[$depth]};
}
}
@ -304,6 +302,17 @@ sub make_perimeters {
}
}
sub add_perimeter {
my $self = shift;
my ($polygon, $role) = @_;
return unless $polygon->is_printable;
push @{ $self->perimeters }, Slic3r::ExtrusionLoop->new(
polygon => $polygon,
role => (abs($polygon->length) <= $Slic3r::small_perimeter_length) ? EXTR_ROLE_SMALLPERIMETER : ($role // EXTR_ROLE_PERIMETER), #/
);
}
sub prepare_fill_surfaces {
my $self = shift;