From 0c4b112718b9ba5961bd753e7a5d296bafd99814 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 7 Jun 2012 19:53:27 +0200 Subject: [PATCH] Fixed regression preventing arcs to be generated at all (center detection is still buggy) --- lib/Slic3r/Extruder.pm | 5 ++++- lib/Slic3r/ExtrusionLoop.pm | 3 +++ lib/Slic3r/Fill.pm | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Extruder.pm b/lib/Slic3r/Extruder.pm index 2d17f8037..6094e53e7 100644 --- a/lib/Slic3r/Extruder.pm +++ b/lib/Slic3r/Extruder.pm @@ -120,7 +120,10 @@ sub extrude_path { # detect arcs if ($Slic3r::gcode_arcs && !$recursive) { my $gcode = ""; - $gcode .= $self->extrude_path($_, $description, 1) for $path->detect_arcs; + foreach my $arc_path ($path->detect_arcs) { + $arc_path->deserialize; + $gcode .= $self->extrude_path($arc_path, $description, 1); + } return $gcode; } diff --git a/lib/Slic3r/ExtrusionLoop.pm b/lib/Slic3r/ExtrusionLoop.pm index a90725b0c..592f5d031 100644 --- a/lib/Slic3r/ExtrusionLoop.pm +++ b/lib/Slic3r/ExtrusionLoop.pm @@ -28,6 +28,8 @@ sub split_at { $point = Slic3r::Point->new($point); + $self->deserialize; + # find index of point my $i = -1; for (my $n = 0; $n <= $#{$self->polygon}; $n++) { @@ -50,6 +52,7 @@ sub split_at { sub split_at_first_point { my $self = shift; + $self->deserialize; return $self->split_at($self->polygon->[0]); } diff --git a/lib/Slic3r/Fill.pm b/lib/Slic3r/Fill.pm index 509b0aa84..6d79a1c94 100644 --- a/lib/Slic3r/Fill.pm +++ b/lib/Slic3r/Fill.pm @@ -184,7 +184,7 @@ sub make_fill { paths => [ map { $_->isa('Slic3r::Polygon') - ? Slic3r::ExtrusionLoop->new(polygon => $_, role => EXTR_ROLE_SOLIDFILL)->split_at($_->[0]) + ? Slic3r::ExtrusionLoop->new(polygon => $_, role => EXTR_ROLE_SOLIDFILL)->split_at_first_point : Slic3r::ExtrusionPath->new(polyline => $_, role => EXTR_ROLE_SOLIDFILL) } @{$layer->thin_fills}, ],