diff --git a/lib/Slic3r/Fill.pm b/lib/Slic3r/Fill.pm index 143dc905b..5da06753e 100644 --- a/lib/Slic3r/Fill.pm +++ b/lib/Slic3r/Fill.pm @@ -157,17 +157,13 @@ sub make_fill { next SURFACE unless $density > 0; } - my @paths; - { - my $f = $self->filler($filler); - $f->layer_id($layerm->id); - @paths = $f->fill_surface( - $surface, - density => $density, - flow_spacing => $flow_spacing, - ); - } - my $params = shift @paths; + my $f = $self->filler($filler); + $f->layer_id($layerm->id); + my ($params, @paths) = $f->fill_surface( + $surface, + density => $density, + flow_spacing => $flow_spacing, + ); # ugly hack(tm) to get the right amount of flow (GCode.pm should be fixed) $params->{flow_spacing} = $layerm->extruders->{infill}->bridge_flow->width if $is_bridge; diff --git a/lib/Slic3r/Layer/Region.pm b/lib/Slic3r/Layer/Region.pm index 877f64cae..93574e26d 100644 --- a/lib/Slic3r/Layer/Region.pm +++ b/lib/Slic3r/Layer/Region.pm @@ -531,7 +531,7 @@ sub _detect_bridge_direction { # detect anchors as intersection between our bridge expolygon and the lower slices my $anchors = intersection_ex( - [ @$expolygon ], + [ @$grown ], [ map @$_, @lower ], undef, 1, # safety offset required to avoid Clipper from detecting empty intersection while Boost actually found some @edges @@ -549,6 +549,7 @@ sub _detect_bridge_direction { # generate lines in this direction my $bounding_box = Slic3r::Geometry::BoundingBox->new_from_points([ map @$_, map @$_, @$anchors ]); + my @lines = (); for (my $x = $bounding_box->x_min; $x <= $bounding_box->x_max; $x += $line_increment) { push @lines, [ [$x, $bounding_box->y_min], [$x, $bounding_box->y_max] ];