mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
Merge new-support2
This commit is contained in:
@@ -7,7 +7,7 @@ our @ISA = qw(Exporter);
|
||||
our @EXPORT_OK = qw(safety_offset safety_offset_ex 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 union_pt offset2 offset2_ex traverse_pt
|
||||
intersection);
|
||||
intersection union);
|
||||
|
||||
use Math::Clipper 1.22 qw(:cliptypes :polyfilltypes :jointypes is_counter_clockwise area);
|
||||
use Slic3r::Geometry qw(scale);
|
||||
@@ -88,6 +88,17 @@ sub diff {
|
||||
];
|
||||
}
|
||||
|
||||
sub union {
|
||||
my ($polygons, $jointype, $safety_offset) = @_;
|
||||
$jointype = PFT_NONZERO unless defined $jointype;
|
||||
$clipper->clear;
|
||||
$clipper->add_subject_polygons($safety_offset ? safety_offset($polygons) : $polygons);
|
||||
return [
|
||||
map Slic3r::Polygon->new(@$_),
|
||||
@{ $clipper->execute(CT_UNION, $jointype, $jointype) },
|
||||
];
|
||||
}
|
||||
|
||||
sub union_ex {
|
||||
my ($polygons, $jointype, $safety_offset) = @_;
|
||||
$jointype = PFT_NONZERO unless defined $jointype;
|
||||
|
||||
Reference in New Issue
Block a user