mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 07:03:59 -06:00
Rename ex_int_offset2 to offset2_ex
This commit is contained in:
parent
5bf3f5f5e4
commit
6b8894cf9a
3 changed files with 16 additions and 16 deletions
|
@ -6,7 +6,7 @@ require Exporter;
|
|||
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 ex_int_offset2 offset2);
|
||||
JT_SQUARE is_counter_clockwise union_pt offset2 offset2_ex);
|
||||
|
||||
use Math::Clipper 1.17 qw(:cliptypes :polyfilltypes :jointypes is_counter_clockwise area);
|
||||
use Slic3r::Geometry qw(scale);
|
||||
|
@ -53,6 +53,16 @@ sub offset_ex {
|
|||
return map Slic3r::ExPolygon->new($_), @$offsets;
|
||||
}
|
||||
|
||||
sub offset2_ex {
|
||||
my ($polygons, $delta1, $delta2, $scale, $joinType, $miterLimit) = @_;
|
||||
$scale ||= 100000;
|
||||
$joinType //= JT_MITER;
|
||||
$miterLimit //= 3;
|
||||
|
||||
my $offsets = Math::Clipper::ex_int_offset2($polygons, $delta1, $delta2, $scale, $joinType, $miterLimit);
|
||||
return map Slic3r::ExPolygon->new($_), @$offsets;
|
||||
}
|
||||
|
||||
sub diff_ex {
|
||||
my ($subject, $clip, $safety_offset) = @_;
|
||||
|
||||
|
@ -120,19 +130,9 @@ sub xor_ex {
|
|||
];
|
||||
}
|
||||
|
||||
sub ex_int_offset2 {
|
||||
my ($polygons, $delta1, $delta2, $scale, $joinType, $miterLimit) = @_;
|
||||
$scale ||= 100000;
|
||||
$joinType //= JT_MITER;
|
||||
$miterLimit //= 3;
|
||||
|
||||
my $offsets = Math::Clipper::ex_int_offset2($polygons, $delta1, $delta2, $scale, $joinType, $miterLimit);
|
||||
return map Slic3r::ExPolygon->new($_), @$offsets;
|
||||
}
|
||||
|
||||
sub collapse_ex {
|
||||
my ($polygons, $width) = @_;
|
||||
return [ ex_int_offset2($polygons, -$width/2, +$width/2) ];
|
||||
return [ offset2_ex($polygons, -$width/2, +$width/2) ];
|
||||
}
|
||||
|
||||
sub simplify_polygon {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue