diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 087a9d0daf..3408ecede5 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -38,6 +38,9 @@ use Slic3r::TriangleMesh::IntersectionLine; our $threads = 4; +# miscellaneous options +our $notes = ''; + # output options our $output_filename_format = '[input_filename_base].gcode'; diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 42b7d80263..a8300c1ba5 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -7,6 +7,18 @@ use constant PI => 4 * atan2(1, 1); our $Options = { + # miscellaneous options + 'notes' => { + label => 'Configuraton notes', + cli => 'notes=s', + type => 's', + multiline => 1, + width => 350, + height => 300, + serialize => sub { join '\n', split /\R/, $_[0] }, + deserialize => sub { join "\n", split /\\n/, $_[0] }, + }, + # output options 'output_filename_format' => { label => 'Output filename format', diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm index 58b5198e0f..8f2c50a89b 100644 --- a/lib/Slic3r/GUI/SkeinPanel.pm +++ b/lib/Slic3r/GUI/SkeinPanel.pm @@ -67,6 +67,10 @@ sub new { title => 'Output', options => [qw(output_filename_format)], }, + notes => { + title => 'Notes', + options => [qw(notes)], + }, ); $self->{panels} = \%panels; @@ -99,13 +103,15 @@ sub new { $make_tab->([qw(transform accuracy skirt)], [qw(print retract)]), $make_tab->([qw(printer filament)], [qw(print_speed speed)]), $make_tab->([qw(gcode)]), + $make_tab->([qw(notes)]), $make_tab->([qw(extrusion)], [qw(output)]), ); $tabpanel->AddPage($tabs[0], "Print Settings"); $tabpanel->AddPage($tabs[1], "Printer and Filament"); $tabpanel->AddPage($tabs[2], "Start/End GCODE"); - $tabpanel->AddPage($tabs[3], "Advanced"); + $tabpanel->AddPage($tabs[3], "Notes"); + $tabpanel->AddPage($tabs[4], "Advanced"); my $buttons_sizer; { diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index bdb393b14e..f33ff2b740 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -463,6 +463,9 @@ sub export_gcode { my @lt = localtime; printf $fh "; generated by Slic3r $Slic3r::VERSION on %02d-%02d-%02d at %02d:%02d:%02d\n\n", $lt[5] + 1900, $lt[4]+1, $lt[3], $lt[2], $lt[1], $lt[0]; + + print $fh "; $_\n" foreach split /\R/, $Slic3r::notes; + print $fh "\n" if $Slic3r::notes; for (qw(layer_height perimeters solid_layers fill_density nozzle_diameter filament_diameter perimeter_speed infill_speed travel_speed extrusion_width_ratio scale)) { diff --git a/slic3r.pl b/slic3r.pl index 9cd944201f..6823f00ceb 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -191,6 +191,9 @@ Usage: slic3r.pl [ OPTIONS ] file.stl --duplicate-x Number of items along X axis (1+, default: $Slic3r::duplicate_x) --duplicate-y Number of items along Y axis (1+, default: $Slic3r::duplicate_y) --duplicate-distance Distance in mm between copies (default: $Slic3r::duplicate_distance) + + Miscellaneous options: + --notes Notes to be added as comments to the output file Flow options (advanced): --extrusion-width-ratio