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

@ -2,6 +2,11 @@ package Slic3r::Line;
use strict;
use warnings;
use constant A => 0;
use constant B => 1;
use constant X => 0;
use constant Y => 1;
sub new {
my $class = shift;
my $self;
@ -70,4 +75,29 @@ sub length {
return Slic3r::Geometry::line_length($self);
}
sub atan {
my $self = shift;
return Slic3r::Geometry::line_atan($self);
}
sub intersection {
my $self = shift;
my ($line, $require_crossing) = @_;
return Slic3r::Geometry::line_intersection($self, $line, $require_crossing);
}
sub point_on_left {
my $self = shift;
my ($point) = @_;
return Slic3r::Geometry::point_is_on_left_of_segment($point, $self);
}
sub midpoint {
my $self = shift;
return Slic3r::Point->new(
($self->[A][X] + $self->[B][X]) / 2,
($self->[A][Y] + $self->[B][Y]) / 2,
);
}
1;