mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-23 19:00:59 -07:00
Optimization in Polyline instantiation
This commit is contained in:
parent
27c421c27f
commit
8061cc6e30
14 changed files with 40 additions and 45 deletions
|
|
@ -38,12 +38,12 @@ sub polygon {
|
|||
my $self = shift;
|
||||
|
||||
my $e = $self->extents;
|
||||
return Slic3r::Polygon->new([
|
||||
return Slic3r::Polygon->new(
|
||||
[ $e->[X][MIN], $e->[Y][MIN] ],
|
||||
[ $e->[X][MAX], $e->[Y][MIN] ],
|
||||
[ $e->[X][MAX], $e->[Y][MAX] ],
|
||||
[ $e->[X][MIN], $e->[Y][MAX] ],
|
||||
]);
|
||||
);
|
||||
}
|
||||
|
||||
# note to $self
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ sub diff {
|
|||
$clipper->add_subject_polygons($subject);
|
||||
$clipper->add_clip_polygons($safety_offset ? safety_offset($clip) : $clip);
|
||||
return [
|
||||
map Slic3r::Polygon->new($_),
|
||||
map Slic3r::Polygon->new(@$_),
|
||||
@{ $clipper->execute(CT_DIFFERENCE, PFT_NONZERO, PFT_NONZERO) },
|
||||
];
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ sub intersection {
|
|||
$clipper->add_subject_polygons($subject);
|
||||
$clipper->add_clip_polygons($safety_offset ? safety_offset($clip) : $clip);
|
||||
return [
|
||||
map Slic3r::Polygon->new($_),
|
||||
map Slic3r::Polygon->new(@$_),
|
||||
@{ $clipper->execute(CT_INTERSECTION, $jointype, $jointype) },
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue