Ported union() to XS

This commit is contained in:
Alessandro Ranellucci 2013-08-17 12:24:04 +02:00
parent fa07c512b4
commit 94ca28644e
4 changed files with 16 additions and 14 deletions

View file

@ -25,17 +25,6 @@ sub safety_offset_ex {
@{Math::Clipper::ex_int_offset(_convert($polygons), $factor // (scale 1e-05), 100000, JT_MITER, 2)};
}
sub union {
my ($polygons, $jointype, $safety_offset) = @_;
$jointype = PFT_NONZERO unless defined $jointype;
$clipper->clear;
$clipper->add_subject_polygons(_convert($safety_offset ? safety_offset($polygons) : $polygons));
return [
map Slic3r::Polygon->new(@$_),
@{ $clipper->execute(CT_UNION, $jointype, $jointype) },
];
}
sub union_pt {
my ($polygons, $jointype, $safety_offset) = @_;
$jointype = PFT_NONZERO unless defined $jointype;