Bugfix: simplification of support areas could lead to complex polygons with bad orientation, thus causing wrong pattern clipping. #1032

This commit is contained in:
Alessandro Ranellucci 2013-03-14 14:27:08 +01:00
parent 0feef890b1
commit dc0f706789
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);
@ -83,4 +83,13 @@ sub xor_ex {
];
}
sub collapse_ex {
my ($polygons, $width) = @_;
my @result = offset(
[ offset($polygons, -$width/2,) ],
+$width/2,
);
return union_ex([@result]);
}
1;