mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 22:54:08 -06:00
Port offset_ex() and offset2_ex() to XS
This commit is contained in:
parent
9458c7db97
commit
898007fc36
20 changed files with 4349 additions and 52 deletions
|
@ -45,26 +45,6 @@ sub offset2 {
|
|||
return @$offsets;
|
||||
}
|
||||
|
||||
sub offset_ex {
|
||||
my ($polygons, $distance, $scale, $joinType, $miterLimit) = @_;
|
||||
$scale ||= 100000;
|
||||
$joinType //= JT_MITER;
|
||||
$miterLimit //= 3;
|
||||
|
||||
my $offsets = Math::Clipper::ex_int_offset(_convert($polygons), $distance, $scale, $joinType, $miterLimit);
|
||||
return map Slic3r::ExPolygon->new($_->{outer}, @{$_->{holes}}), @$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(_convert($polygons), $delta1, $delta2, $scale, $joinType, $miterLimit);
|
||||
return map Slic3r::ExPolygon->new($_->{outer}, @{$_->{holes}}), @$offsets;
|
||||
}
|
||||
|
||||
sub diff_ex {
|
||||
my ($subject, $clip, $safety_offset) = @_;
|
||||
|
||||
|
@ -147,7 +127,7 @@ sub xor_ex {
|
|||
|
||||
sub collapse_ex {
|
||||
my ($polygons, $width) = @_;
|
||||
return [ offset2_ex($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