From e21c806ee952e51dcedba889d1267bb240fee59d Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 6 Nov 2012 20:31:50 +0100 Subject: [PATCH] New wkt() method for debugging --- lib/Slic3r/Polygon.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Slic3r/Polygon.pm b/lib/Slic3r/Polygon.pm index 96288f73d..50805ab47 100644 --- a/lib/Slic3r/Polygon.pm +++ b/lib/Slic3r/Polygon.pm @@ -19,6 +19,11 @@ sub boost_linestring { return Boost::Geometry::Utils::linestring([@$self, $self->[0]]); } +sub wkt { + my $self = shift; + return sprintf "POLYGON((%s))", join ',', map "$_->[0] $_->[1]", @$self; +} + sub is_counter_clockwise { my $self = shift; return Slic3r::Geometry::Clipper::is_counter_clockwise($self);