From 0184b0f2054e5f543deb4433b6c1bd57091599b8 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 11 Jan 2012 20:13:26 +0100 Subject: [PATCH] Fixed many little things that were not updated along with recent large refactoring. #157 #144 --- lib/Slic3r/Layer.pm | 8 ++++---- lib/Slic3r/Perimeter.pm | 2 +- lib/Slic3r/Print.pm | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index 3ccdbd32e1..d7c1ae53f4 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -321,13 +321,13 @@ sub process_bridges { my @edges = (); # edges are POLYLINES foreach my $supporting_surface (@supporting_surfaces) { my @surface_edges = map $_->clip_with_polygon($contour_offset), - ($supporting_surface->contour, @{$supporting_surface->holes}); + ($supporting_surface->contour, $supporting_surface->holes); if (@supporting_surfaces == 1 && @surface_edges == 1 && @{$supporting_surface->contour->p} == @{$surface_edges[0]->p}) { $bridge_over_hole = 1; } - push @edges, grep { @{$_->points} } @surface_edges; + push @edges, grep { @$_ } @surface_edges; } Slic3r::debugf " Bridge is supported on %d edge(s)\n", scalar(@edges); Slic3r::debugf " and covers a hole\n" if $bridge_over_hole; @@ -340,12 +340,12 @@ sub process_bridges { } if (@edges == 2) { - my @chords = map Slic3r::Line->new($_->points->[0], $_->points->[-1]), @edges; + my @chords = map Slic3r::Line->new($_->[0], $_->[-1]), @edges; my @midpoints = map $_->midpoint, @chords; my $line_between_midpoints = Slic3r::Line->new(@midpoints); $bridge_angle = rad2deg_dir($line_between_midpoints->direction); } elsif (@edges == 1) { - my $line = Slic3r::Line->new($edges[0]->points->[0], $edges[0]->points->[-1]); + my $line = Slic3r::Line->new($edges[0]->[0], $edges[0]->[-1]); $bridge_angle = rad2deg_dir($line->direction); } else { my $center = bounding_box_center([ map @{$_->points}, @edges ]); diff --git a/lib/Slic3r/Perimeter.pm b/lib/Slic3r/Perimeter.pm index 0b9b190bfe..ed9f7df0a5 100644 --- a/lib/Slic3r/Perimeter.pm +++ b/lib/Slic3r/Perimeter.pm @@ -83,7 +83,7 @@ sub make_perimeter { if ($_->isa('Slic3r::Polygon')) { push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->new(polygon => $_, role => 'perimeter'); } else { - push @{ $layer->perimeters }, Slic3r::ExtrusionPath->new(polyline => $_->points, role => 'perimeter'); + push @{ $layer->perimeters }, Slic3r::ExtrusionPath->new(polyline => $_, role => 'perimeter'); } } } diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 90157a4dc5..d962be62f3 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -330,7 +330,10 @@ sub extrude_skirt { my $skirt_height = $Slic3r::skirt_height; $skirt_height = $self->layer_count if $skirt_height > $self->layer_count; my @layers = map $self->layer($_), 0..($skirt_height-1); - my @points = map @$_, map $_->p, map +(@{$_->slices}, @{$_->thin_walls}), @layers; + my @points = ( + (map @$_, map @{$_->expolygon}, map @{$_->slices}, @layers), + (map @$_, map @{$_->thin_walls}, @layers), + ); return if !@points; # find out convex hull