New experimental --gcode-arcs options to generate G2/G3 commands. #23

This commit is contained in:
Alessandro Ranellucci 2011-10-20 18:11:59 +02:00
parent 7f341cfcd3
commit 6d6533831e
13 changed files with 333 additions and 21 deletions

View file

@ -0,0 +1,23 @@
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;
return $self->radius * $self->angle;
}
1;

View file

@ -55,4 +55,9 @@ 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;