mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 03:07:55 -06:00
Merge branch 'master' into grow-narrow
This commit is contained in:
commit
38b79c6bf7
18 changed files with 152 additions and 66 deletions
|
@ -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,23 @@ sub xor_ex {
|
|||
];
|
||||
}
|
||||
|
||||
sub collapse_ex {
|
||||
my ($polygons, $width) = @_;
|
||||
my @result = offset(
|
||||
[ offset($polygons, -$width/2,) ],
|
||||
+$width/2,
|
||||
);
|
||||
return union_ex([@result]);
|
||||
}
|
||||
|
||||
sub simplify_polygon {
|
||||
my ($polygon, $pft) = @_;
|
||||
return @{ Math::Clipper::simplify_polygon($polygon, $pft // PFT_NONZERO) };
|
||||
}
|
||||
|
||||
sub simplify_polygons {
|
||||
my ($polygons, $pft) = @_;
|
||||
return @{ Math::Clipper::simplify_polygons($polygons, $pft // PFT_NONZERO) };
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue