Bugfix: avoid-crossing-perimeters was failing on layers only containing single walls. #978
This commit is contained in:
parent
8efe46e58d
commit
11637d527a
1 changed files with 10 additions and 4 deletions
|
@ -727,11 +727,17 @@ sub write_gcode {
|
||||||
# compute the offsetted convex hull for each object and repeat it for each copy.
|
# compute the offsetted convex hull for each object and repeat it for each copy.
|
||||||
my @islands = ();
|
my @islands = ();
|
||||||
foreach my $obj_idx (0 .. $#{$self->objects}) {
|
foreach my $obj_idx (0 .. $#{$self->objects}) {
|
||||||
my @island = Slic3r::ExPolygon->new(convex_hull([
|
my $convex_hull = convex_hull([
|
||||||
map @{$_->contour}, map @{$_->slices}, @{$self->objects->[$obj_idx]->layers},
|
map @{$_->contour}, map @{$_->slices}, @{$self->objects->[$obj_idx]->layers},
|
||||||
]))->translate(scale $shift[X], scale $shift[Y])->offset_ex(scale $distance_from_objects, 1, JT_SQUARE);
|
]);
|
||||||
foreach my $copy (@{ $self->objects->[$obj_idx]->copies }) {
|
# discard layers only containing thin walls (offset would fail on an empty polygon)
|
||||||
push @islands, map $_->clone->translate(@$copy), @island;
|
if (@$convex_hull) {
|
||||||
|
my @island = Slic3r::ExPolygon->new($convex_hull)
|
||||||
|
->translate(scale $shift[X], scale $shift[Y])
|
||||||
|
->offset_ex(scale $distance_from_objects, 1, JT_SQUARE);
|
||||||
|
foreach my $copy (@{ $self->objects->[$obj_idx]->copies }) {
|
||||||
|
push @islands, map $_->clone->translate(@$copy), @island;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$gcodegen->external_mp(Slic3r::GCode::MotionPlanner->new(
|
$gcodegen->external_mp(Slic3r::GCode::MotionPlanner->new(
|
||||||
|
|
Loading…
Add table
Reference in a new issue