From d346bc02cc45fc87052e18eea0eeaa2daae12475 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 14 Dec 2011 19:49:21 +0100 Subject: [PATCH] Comments are now disabled by default, new --gcode-comments option to enable them --- README.markdown | 7 ++++--- lib/Slic3r.pm | 1 + lib/Slic3r/Config.pm | 5 +++++ lib/Slic3r/Extruder.pm | 2 +- slic3r.pl | 3 ++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.markdown b/README.markdown index b637bea75..a37896752 100644 --- a/README.markdown +++ b/README.markdown @@ -95,8 +95,9 @@ The author is Alessandro Ranellucci (me). (+/-, default: 0) --gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported by all firmwares) - --g0 Use G0 commands for retraction (experimenta, not supported by all + --g0 Use G0 commands for retraction (experimental, not supported by all firmwares) + --gcode-comments Make GCODE verbose by adding comments (default: no) Filament options: --filament-diameter Diameter in mm of your raw filament (default: 3) @@ -132,7 +133,7 @@ The author is Alessandro Ranellucci (me). --solid-layers Number of solid layers to do for top/bottom surfaces (range: 1+, default: 3) --fill-density Infill density (range: 0-1, default: 0.4) - --fill-angle Infill angle in degrees (range: 0-90, default: 0) + --fill-angle Infill angle in degrees (range: 0-90, default: 45) --fill-pattern Pattern to use to fill non-solid layers (default: rectilinear) --solid-fill-pattern Pattern to use to fill solid layers (default: rectilinear) --start-gcode Load initial gcode from the supplied file. This will overwrite @@ -144,7 +145,7 @@ The author is Alessandro Ranellucci (me). Retraction options: --retract-length Length of retraction in mm when pausing extrusion (default: 1) - --retract-speed Speed for retraction in mm/sec (default: 40) + --retract-speed Speed for retraction in mm/sec (default: 30) --retract-restart-extra Additional amount of filament in mm to push after compensating retraction (default: 0) diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 8d970d3b8..c4a3bf209 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -41,6 +41,7 @@ our $extrusion_axis = 'E'; our $z_offset = 0; our $gcode_arcs = 0; our $g0 = 0; +our $gcode_comments = 0; # filament options our $filament_diameter = 3; # mm diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index ee12502f5..f5e0a424f 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -46,6 +46,11 @@ our $Options = { cli => 'g0', type => 'bool', }, + 'gcode_comments' => { + label => 'Verbose GCODE (comments)', + cli => 'gcode-comments', + type => 'bool', + }, # filament options 'filament_diameter' => { diff --git a/lib/Slic3r/Extruder.pm b/lib/Slic3r/Extruder.pm index 51deaf192..40c3c6ae9 100644 --- a/lib/Slic3r/Extruder.pm +++ b/lib/Slic3r/Extruder.pm @@ -292,7 +292,7 @@ sub _Gx { $gcode .= sprintf " %s%.5f", $Slic3r::extrusion_axis, $self->extrusion_distance; } - $gcode .= sprintf " ; %s", $comment if $comment; + $gcode .= sprintf " ; %s", $comment if $comment && $Slic3r::gcode_comments; return "$gcode\n"; } diff --git a/slic3r.pl b/slic3r.pl index ccb497448..4f35f25a9 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -100,8 +100,9 @@ Usage: slic3r.pl [ OPTIONS ] file.stl (+/-, default: $Slic3r::z_offset) --gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported by all firmwares) - --g0 Use G0 commands for retraction (experimenta, not supported by all + --g0 Use G0 commands for retraction (experimental, not supported by all firmwares) + --gcode-comments Make GCODE verbose by adding comments (default: no) Filament options: --filament-diameter Diameter in mm of your raw filament (default: $Slic3r::filament_diameter)