Move arc fitting code to its own post-processing filter and remove the built-in ExtrusionPath::Arc class

This commit is contained in:
Alessandro Ranellucci 2013-08-28 19:50:16 +02:00
parent 055273fbc8
commit 5f17fa342b
9 changed files with 149 additions and 196 deletions

View file

@ -1,34 +0,0 @@
package Slic3r::ExtrusionPath::Arc;
use Moo;
has 'polyline' => (is => 'rw', required => 1);
has 'role' => (is => 'rw', required => 1);
has 'height' => (is => 'rw');
has 'flow_spacing' => (is => 'rw');
has 'center' => (is => 'ro', required => 1);
has 'radius' => (is => 'ro', required => 1);
has 'orientation' => (is => 'ro', required => 1); # cw/ccw
use Slic3r::Geometry qw(PI angle3points);
sub points {
my $self = shift;
return $self->polyline;
}
sub angle {
my $self = shift;
return angle3points($self->center, @{$self->points});
}
sub length {
my $self = shift;
if($self->orientation eq 'ccw') {
return $self->radius * $self->angle;
} else {
return $self->radius * (2*PI() - $self->angle);
}
}
1;

View file

@ -47,10 +47,4 @@ sub cleanup {
$self->append(@paths);
}
sub detect_arcs {
my $self = shift;
return map $_->detect_arcs(@_), @$self;
}
1;