From b5b0df2426cd5b37d257fd6941e6987da7eb76a9 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 26 Dec 2014 18:57:21 +0100 Subject: [PATCH] Adapt SectionCut to the new APIs --- lib/Slic3r/Test/SectionCut.pm | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/Slic3r/Test/SectionCut.pm b/lib/Slic3r/Test/SectionCut.pm index 51bda6b7f..5886b3362 100644 --- a/lib/Slic3r/Test/SectionCut.pm +++ b/lib/Slic3r/Test/SectionCut.pm @@ -84,24 +84,25 @@ sub _plot { foreach my $copy (@{$object->_shifted_copies}) { foreach my $layer (@{$object->layers}, @{$object->support_layers}) { # get all ExtrusionPath objects - my @paths = - map { $_->isa('Slic3r::ExtrusionLoop') ? $_->split_at_first_point : $_->clone } - map { $_->isa('Slic3r::ExtrusionPath::Collection') ? @$_ : $_ } + my @paths = map $_->clone, + map { ($_->isa('Slic3r::ExtrusionLoop') || $_->isa('Slic3r::ExtrusionPath::Collection')) ? @$_ : $_ } grep defined $_, $filter->($layer); $_->polyline->translate(@$copy) for @paths; - require "Slic3r/SVG.pm"; - Slic3r::SVG::output( - "line.svg", - no_arrows => 1, - #polygon => $line->grow(Slic3r::Geometry::scale $path->width/2), - polygons => [ $object->bounding_box->polygon ], - lines => [ $self->line ], - red_polylines => [ map $_->polyline, @paths ], - ); - exit; + if (0) { + require "Slic3r/SVG.pm"; + Slic3r::SVG::output( + "line.svg", + no_arrows => 1, + #polygon => $line->grow(Slic3r::Geometry::scale $path->width/2), + polygons => [ $object->bounding_box->polygon ], + lines => [ $self->line ], + red_polylines => [ map $_->polyline, @paths ], + ); + exit; + } foreach my $path (@paths) { foreach my $line (@{$path->lines}) {