Merge branch 'master' into grow-narrow

This commit is contained in:
Alessandro Ranellucci 2013-03-16 16:22:03 +01:00
commit 0f8ca6191a
3 changed files with 22 additions and 2 deletions

View file

@ -4,7 +4,7 @@ use warnings;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(safety_offset offset offset_ex
our @EXPORT_OK = qw(safety_offset offset offset_ex collapse_ex
diff_ex diff union_ex intersection_ex xor_ex PFT_EVENODD JT_MITER JT_ROUND
JT_SQUARE is_counter_clockwise);
@ -91,4 +91,13 @@ sub xor_ex {
];
}
sub collapse_ex {
my ($polygons, $width) = @_;
my @result = offset(
[ offset($polygons, -$width/2,) ],
+$width/2,
);
return union_ex([@result]);
}
1;