mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 13:17:54 -06:00
Refactored Perimeter code with new Slic3r::Polygon and Slic3r::ExPolygon objects
Large refactoring. Speed gains. Removed convex hull for bridges.
This commit is contained in:
parent
2d784fac9b
commit
5090ae561c
11 changed files with 174 additions and 100 deletions
30
lib/Slic3r/Polygon.pm
Normal file
30
lib/Slic3r/Polygon.pm
Normal file
|
@ -0,0 +1,30 @@
|
|||
package Slic3r::Polygon;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# a polygon is a closed polyline.
|
||||
# if you're asking why there's a Slic3r::Polygon as well
|
||||
# as a Slic3r::Polyline::Closed you're right. I plan to
|
||||
# ditch the latter and port everything to this class.
|
||||
|
||||
use Slic3r::Geometry qw(polygon_remove_parallel_continuous_edges);
|
||||
|
||||
# the constructor accepts an array(ref) of points
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self;
|
||||
if (@_ == 1) {
|
||||
$self = [ @{$_[0]} ];
|
||||
} else {
|
||||
$self = [ @_ ];
|
||||
}
|
||||
bless $self, $class;
|
||||
$self;
|
||||
}
|
||||
|
||||
sub cleanup {
|
||||
my $self = shift;
|
||||
polygon_remove_parallel_continuous_edges($self);
|
||||
}
|
||||
|
||||
1;
|
Loading…
Add table
Add a link
Reference in a new issue