From 1a690589a84361dc82468299a6d4db487429648d Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 24 Dec 2013 12:03:30 +0100 Subject: [PATCH] Satisfy test suite --- lib/Slic3r/Extruder.pm | 2 +- lib/Slic3r/Fill/Base.pm | 5 +++++ lib/Slic3r/Layer/Region.pm | 1 + t/fill.t | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Extruder.pm b/lib/Slic3r/Extruder.pm index 9f4cba2b2..9444f6916 100644 --- a/lib/Slic3r/Extruder.pm +++ b/lib/Slic3r/Extruder.pm @@ -43,7 +43,7 @@ sub _build_retract_speed_mm_min { } sub scaled_wipe_distance { - my ($self, $travel_speed) = shift; + my ($self, $travel_speed) = @_; # how far do we move in XY at travel_speed for the time needed to consume # retract_length at retract_speed? diff --git a/lib/Slic3r/Fill/Base.pm b/lib/Slic3r/Fill/Base.pm index eaa922d16..a4bd88d2a 100644 --- a/lib/Slic3r/Fill/Base.pm +++ b/lib/Slic3r/Fill/Base.pm @@ -13,6 +13,11 @@ sub infill_direction { my $self = shift; my ($surface) = @_; + if (!defined $self->angle) { + warn "Using undefined infill angle"; + $self->angle(0); + } + # set infill angle my (@rotate, @shift); $rotate[0] = Slic3r::Geometry::deg2rad($self->angle); diff --git a/lib/Slic3r/Layer/Region.pm b/lib/Slic3r/Layer/Region.pm index aa43c7bc3..e68127bc3 100644 --- a/lib/Slic3r/Layer/Region.pm +++ b/lib/Slic3r/Layer/Region.pm @@ -333,6 +333,7 @@ sub _fill_gaps { return unless @$gaps; my $filler = Slic3r::Fill->new->filler('rectilinear'); + $filler->angle($self->config->fill_angle); $filler->layer_id($self->layer->id); # we should probably use this code to handle thin walls and remove that logic from diff --git a/t/fill.t b/t/fill.t index 2252f5eb9..2be4b87c1 100644 --- a/t/fill.t +++ b/t/fill.t @@ -37,6 +37,7 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ } my $expolygon = Slic3r::ExPolygon->new([ scale_points [0,0], [50,0], [50,50], [0,50] ]); my $filler = Slic3r::Fill::Rectilinear->new( bounding_box => $expolygon->bounding_box, + angle => 0, ); my $surface = Slic3r::Surface->new( surface_type => S_TYPE_TOP,