From e9c7460c110c294f704943ce93060d7f0a737ca9 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 9 Mar 2013 20:31:09 +0100 Subject: [PATCH] New --bridge-acceleration option --- README.markdown | 3 +++ lib/Slic3r/Config.pm | 8 ++++++++ lib/Slic3r/GCode.pm | 11 +++++++---- lib/Slic3r/GUI/Tab.pm | 2 +- slic3r.pl | 3 +++ 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.markdown b/README.markdown index 17976e39f..5a8a1ba54 100644 --- a/README.markdown +++ b/README.markdown @@ -163,6 +163,9 @@ The author of the Silk icon set is Mark James. --infill-acceleration Overrides firmware's default acceleration for infill. (mm/s^2, set zero to disable; default: 0) + --bridge-acceleration + Overrides firmware's default acceleration for bridges. (mm/s^2, set zero + to disable; default: 0) --default-acceleration Acceleration will be reset to this value after the specific settings above have been applied. (mm/s^2, set zero to disable; default: 130) diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 7775d4e64..f1b25c30e 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -343,6 +343,14 @@ our $Options = { type => 'f', default => 0, }, + 'bridge_acceleration' => { + label => 'Bridge', + tooltip => 'This is the acceleration your printer will use for bridges. Set zero to disable acceleration control for bridges.', + sidetext => 'mm/s²', + cli => 'bridge-acceleration=f', + type => 'f', + default => 0, + }, # accuracy options 'layer_height' => { diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index e0fac066a..1cb2783a7 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -199,10 +199,13 @@ sub extrude_path { # adjust acceleration my $acceleration; - $acceleration = $Slic3r::Config->perimeter_acceleration - if $Slic3r::Config->perimeter_acceleration && $path->is_perimeter; - $acceleration = $Slic3r::Config->infill_acceleration - if $Slic3r::Config->infill_acceleration && $path->is_fill; + if ($Slic3r::Config->perimeter_acceleration && $path->is_perimeter) { + $acceleration = $Slic3r::Config->perimeter_acceleration; + } elsif ($Slic3r::Config->infill_acceleration && $path->is_fill) { + $acceleration = $Slic3r::Config->infill_acceleration; + } elsif ($Slic3r::Config->infill_acceleration && $path->role == EXTR_ROLE_BRIDGE) { + $acceleration = $Slic3r::Config->bridge_acceleration; + } $gcode .= $self->set_acceleration($acceleration) if $acceleration; my $area; # mm^3 of extrudate per mm of tool movement diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index eac4f9d57..0463fb041 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -438,7 +438,7 @@ sub build { }, { title => 'Acceleration control (advanced)', - options => [qw(perimeter_acceleration infill_acceleration default_acceleration)], + options => [qw(perimeter_acceleration infill_acceleration bridge_acceleration default_acceleration)], }, ]); diff --git a/slic3r.pl b/slic3r.pl index 12173aa12..d73874d26 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -216,6 +216,9 @@ $j --infill-acceleration Overrides firmware's default acceleration for infill. (mm/s^2, set zero to disable; default: $config->{infill_acceleration}) + --bridge-acceleration + Overrides firmware's default acceleration for bridges. (mm/s^2, set zero + to disable; default: $config->{bridge_acceleration}) --default-acceleration Acceleration will be reset to this value after the specific settings above have been applied. (mm/s^2, set zero to disable; default: $config->{travel_speed})