Bugfix: arcs now work (some glitches in detecting their center, though). #30

This commit is contained in:
Alessandro Ranellucci 2011-11-07 14:12:07 +01:00
parent 8172bcb772
commit d620b46beb
4 changed files with 85 additions and 44 deletions

View file

@ -70,6 +70,9 @@ sub extrude {
my $self = shift;
my ($path, $description, $recursive) = @_;
$path->merge_continuous_lines;
# detect arcs
if ($Slic3r::gcode_arcs && !$recursive) {
my $gcode = "";
$gcode .= $self->extrude($_, $description, 1) for $path->detect_arcs;
@ -173,8 +176,8 @@ sub G2_G3 {
# XY distance of the center from the start position
$gcode .= sprintf " I%.${dec}f J%.${dec}f",
($point->[X] - $self->last_pos->[X]) * $Slic3r::resolution + $self->shift_x,
($point->[Y] - $self->last_pos->[Y]) * $Slic3r::resolution + $self->shift_y;
($center->[X] - $self->last_pos->[X]) * $Slic3r::resolution,
($center->[Y] - $self->last_pos->[Y]) * $Slic3r::resolution;
$self->last_pos($point);
return $self->_Gx($gcode, $e, $comment);