mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 03:07:55 -06:00
Safer safety_offset() for ExPolygons
This commit is contained in:
parent
4cb36fcbe2
commit
4c41f6c462
3 changed files with 7 additions and 15 deletions
|
@ -4,7 +4,7 @@ use warnings;
|
|||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT_OK = qw(safety_offset offset offset_ex collapse_ex
|
||||
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);
|
||||
|
||||
|
@ -17,6 +17,11 @@ sub safety_offset {
|
|||
return Math::Clipper::offset($polygons, $factor // (scale 1e-05), 100000, JT_MITER, 2);
|
||||
}
|
||||
|
||||
sub safety_offset_ex {
|
||||
# offset polygons and then apply holes to the right contours
|
||||
return @{ union_ex([ safety_offset(@_) ]) };
|
||||
}
|
||||
|
||||
sub offset {
|
||||
my ($polygons, $distance, $scale, $joinType, $miterLimit) = @_;
|
||||
$scale ||= 100000;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue