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 0049b02bed
commit b700278904
10 changed files with 154 additions and 188 deletions

View file

@ -1,27 +0,0 @@
package Slic3r::ExtrusionPath::Arc;
use Moo;
extends 'Slic3r::ExtrusionPath';
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 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

@ -36,9 +36,4 @@ sub cleanup {
@{$self->paths} = map $_->split_at_acute_angles, @{$self->paths};
}
sub detect_arcs {
my $self = shift;
@{$self->paths} = map $_->detect_arcs(@_), @{$self->paths};
}
1;