mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
New experimental --gcode-arcs options to generate G2/G3 commands. #23
This commit is contained in:
23
lib/Slic3r/ExtrusionPath/Arc.pm
Normal file
23
lib/Slic3r/ExtrusionPath/Arc.pm
Normal 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;
|
||||
Reference in New Issue
Block a user