Add a wkt() method to ExPolygon

This commit is contained in:
Alessandro Ranellucci 2013-01-28 00:02:34 +01:00
parent 50526dea5a
commit 4c8c725eec

View file

@ -59,6 +59,12 @@ sub boost_polygon {
return Boost::Geometry::Utils::polygon(@$self);
}
sub wkt {
my $self = shift;
return sprintf "POLYGON(%s)",
join ',', map "($_)", map { join ',', map "$_->[0] $_->[1]", @$_ } @$self;
}
sub offset {
my $self = shift;
return Slic3r::Geometry::Clipper::offset($self, @_);