From f48dec9e4131edae5d645880f6a8ef3383025692 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 25 Sep 2011 19:51:03 +0200 Subject: [PATCH] Remove old code --- lib/Slic3r/Perimeter.pm | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/lib/Slic3r/Perimeter.pm b/lib/Slic3r/Perimeter.pm index d221be4ba..8d48d526e 100644 --- a/lib/Slic3r/Perimeter.pm +++ b/lib/Slic3r/Perimeter.pm @@ -146,39 +146,6 @@ sub offset_polygon { outer => $_, holes => [ @hole_offsets ], }} @contour_offsets; - - - # OLD CODE to be removed - if (0) { - #my $contour_offsets = $contour_p->offset_polygon($Slic3r::flow_width / $Slic3r::resolution); - #my @hole_offsets = map @$_, map $_->offset_polygon(- $Slic3r::flow_width / $Slic3r::resolution), @holes_p; - Slic3r::SVG::output_polygons($main::print, "holes.svg", [ @holes_p ]); - my $contour_offsets = offset([ $contour_p ], -$distance); - my @hole_offsets = map { ref $_ eq 'ARRAY' ? @$_ : () } map offset([ $_ ], -$distance), @holes_p; - - # defensive programming - if (@$contour_offsets > 1) { - die "Got more than one contour offset!"; - } - - # now we subtract perimeter offsets from the contour offset polygon - # this will generate a single polygon with correct holes and also - # will take care of collisions between contour offset and holes - my $clipper = Math::Clipper->new; - my @resulting_offsets = (); - foreach my $contour_points (@$contour_offsets) { - $clipper->clear; - $clipper->add_subject_polygon($contour_points); - $clipper->add_clip_polygon($_) for @hole_offsets; - - my $result = $clipper->ex_execute(CT_DIFFERENCE, PFT_NONZERO, PFT_NONZERO); - # now we've got @$result, which is an array of Math::Clipper ExPolygons - # representing the inner surface including hole perimeters - push @resulting_offsets, @$result; - } - - return @resulting_offsets; - } } sub _mgp_from_points_ref {