diff --git a/README.markdown b/README.markdown index 0a4e2b95d..4fe41b879 100644 --- a/README.markdown +++ b/README.markdown @@ -7,7 +7,7 @@ A: Yes. ## What's it? Slic3r is a G-code generator for 3D printers. It's compatible with RepRaps, -Makerbots, Ultimakers and many more machines. +makerwares, Ultimakers and many more machines. See the [project homepage](http://slic3r.org/) at slic3r.org and the [documentation](https://github.com/alexrj/Slic3r/wiki/Documentation) on the Slic3r wiki for more information. @@ -112,7 +112,7 @@ The author of the Silk icon set is Mark James. (default: 100,100) --z-offset Additional height in mm to add to vertical coordinates (+/-, default: 0) - --gcode-flavor The type of G-code to generate (reprap/teacup/makerbot/sailfish/mach3/no-extrusion, + --gcode-flavor The type of G-code to generate (reprap/teacup/makerware/sailfish/mach3/no-extrusion, default: reprap) --use-relative-e-distances Enable this to get relative E values --gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 22edd0ff6..d83cc4c5f 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -74,8 +74,8 @@ our $Options = { tooltip => 'Some G/M-code commands, including temperature control and others, are not universal. Set this option to your printer\'s firmware to get a compatible output. The "No extrusion" flavor prevents Slic3r from exporting any extrusion value at all.', cli => 'gcode-flavor=s', type => 'select', - values => [qw(reprap teacup makerbot sailfish mach3 no-extrusion)], - labels => ['RepRap (Marlin/Sprinter)', 'Teacup', 'MakerBot', 'Sailfish', 'Mach3/EMC', 'No extrusion'], + values => [qw(reprap teacup makerware sailfish mach3 no-extrusion)], + labels => ['RepRap (Marlin/Sprinter/Repetier)', 'Teacup', 'MakerWare (MakerBot)', 'Sailfish (MakerBot)', 'Mach3/EMC', 'No extrusion'], default => 'reprap', }, 'use_relative_e_distances' => { @@ -1150,6 +1150,9 @@ sub set { if ($opt_key eq 'threads' && !$Slic3r::have_threads) { $value = 1; } + if ($opt_key eq 'gcode_flavor' && $value eq 'makerbot') { + $value = 'makerware'; + } # For historical reasons, the world's full of configs having these very low values; # to avoid unexpected behavior we need to ignore them. Banning these two hard-coded @@ -1271,6 +1274,10 @@ sub validate { die "Invalid value for --top-solid-layers\n" if $self->top_solid_layers < 0; die "Invalid value for --bottom-solid-layers\n" if $self->bottom_solid_layers < 0; + # --gcode-flavor + die "Invalid value for --gcode-flavor\n" + if !first { $_ eq $self->gcode_flavor } @{$Options->{gcode_flavor}{values}}; + # --print-center die "Invalid value for --print-center\n" if !ref $self->print_center diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index b7f855e83..3b05deb96 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -88,7 +88,7 @@ sub change_layer { } my $gcode = ""; - if ($self->config->gcode_flavor =~ /^(?:makerbot|sailfish)$/) { + if ($self->config->gcode_flavor =~ /^(?:makerware|sailfish)$/) { $gcode .= sprintf "M73 P%s%s\n", int(99 * ($layer->id / ($self->layer_count - 1))), ($self->config->gcode_comments ? ' ; update progress' : ''); @@ -420,7 +420,7 @@ sub retract { # this makes sure we leave sufficient precision in the firmware $gcode .= $self->reset_e; - $gcode .= "M103 ; extruder off\n" if $self->config->gcode_flavor eq 'makerbot'; + $gcode .= "M103 ; extruder off\n" if $self->config->gcode_flavor eq 'makerware'; return $gcode; } @@ -429,7 +429,7 @@ sub unretract { my $self = shift; my $gcode = ""; - $gcode .= "M101 ; extruder on\n" if $self->config->gcode_flavor eq 'makerbot'; + $gcode .= "M101 ; extruder on\n" if $self->config->gcode_flavor eq 'makerware'; if ($self->lifted) { $self->speed('travel'); @@ -451,7 +451,7 @@ sub unretract { sub reset_e { my $self = shift; - return "" if $self->config->gcode_flavor =~ /^(?:mach3|makerbot)$/; + return "" if $self->config->gcode_flavor =~ /^(?:mach3|makerware)$/; $self->extruder->e(0) if $self->extruder; return sprintf "G92 %s0%s\n", $self->config->extrusion_axis, ($self->config->gcode_comments ? ' ; reset extrusion distance' : '') @@ -591,7 +591,7 @@ sub set_extruder { # set the new extruder $self->extruder($extruder); $gcode .= sprintf "%s%d%s\n", - ($self->config->gcode_flavor eq 'makerbot' + ($self->config->gcode_flavor eq 'makerware' ? 'M135 T' : $self->config->gcode_flavor eq 'sailfish' ? 'M108 T' @@ -613,12 +613,12 @@ sub set_fan { if ($speed == 0) { my $code = $self->config->gcode_flavor eq 'teacup' ? 'M106 S0' - : $self->config->gcode_flavor =~ /^(?:makerbot|sailfish)$/ + : $self->config->gcode_flavor =~ /^(?:makerware|sailfish)$/ ? 'M127' : 'M107'; return sprintf "$code%s\n", ($self->config->gcode_comments ? ' ; disable fan' : ''); } else { - if ($self->config->gcode_flavor =~ /^(?:makerbot|sailfish)$/) { + if ($self->config->gcode_flavor =~ /^(?:makerware|sailfish)$/) { return sprintf "M126%s\n", ($self->config->gcode_comments ? ' ; enable fan' : ''); } else { return sprintf "M106 %s%d%s\n", ($self->config->gcode_flavor eq 'mach3' ? 'P' : 'S'), @@ -633,14 +633,14 @@ sub set_temperature { my $self = shift; my ($temperature, $wait, $tool) = @_; - return "" if $wait && $self->config->gcode_flavor =~ /^(?:makerbot|sailfish)$/; + return "" if $wait && $self->config->gcode_flavor =~ /^(?:makerware|sailfish)$/; my ($code, $comment) = ($wait && $self->config->gcode_flavor ne 'teacup') ? ('M109', 'wait for temperature to be reached') : ('M104', 'set temperature'); my $gcode = sprintf "$code %s%d %s; $comment\n", ($self->config->gcode_flavor eq 'mach3' ? 'P' : 'S'), $temperature, - (defined $tool && ($self->multiple_extruders || $self->config->gcode_flavor =~ /^(?:makerbot|sailfish)$/)) ? "T$tool " : ""; + (defined $tool && ($self->multiple_extruders || $self->config->gcode_flavor =~ /^(?:makerware|sailfish)$/)) ? "T$tool " : ""; $gcode .= "M116 ; wait for temperature to be reached\n" if $self->config->gcode_flavor eq 'teacup' && $wait; @@ -653,7 +653,7 @@ sub set_bed_temperature { my ($temperature, $wait) = @_; my ($code, $comment) = ($wait && $self->config->gcode_flavor ne 'teacup') - ? (($self->config->gcode_flavor =~ /^(?:makerbot|sailfish)$/ ? 'M109' : 'M190'), 'wait for bed temperature to be reached') + ? (($self->config->gcode_flavor =~ /^(?:makerware|sailfish)$/ ? 'M109' : 'M190'), 'wait for bed temperature to be reached') : ('M140', 'set bed temperature'); my $gcode = sprintf "$code %s%d ; $comment\n", ($self->config->gcode_flavor eq 'mach3' ? 'P' : 'S'), $temperature; diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index d17774318..6464ba90e 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -714,7 +714,7 @@ sub write_gcode { multiple_extruders => (@{$self->extruders} > 1), layer_count => $self->layer_count, ); - print $fh "G21 ; set units to millimeters\n" if $Slic3r::Config->gcode_flavor ne 'makerbot'; + print $fh "G21 ; set units to millimeters\n" if $Slic3r::Config->gcode_flavor ne 'makerware'; print $fh $gcodegen->set_fan(0, 1) if $Slic3r::Config->cooling && $Slic3r::Config->disable_fan_first_layers; # write start commands to file @@ -732,7 +732,7 @@ sub write_gcode { printf $fh $gcodegen->set_temperature($self->extruders->[$t]->first_layer_temperature, 1, $t) if $self->extruders->[$t]->first_layer_temperature && $Slic3r::Config->start_gcode !~ /M(?:109|104)/i; } - print $fh "G90 ; use absolute coordinates\n" if $Slic3r::Config->gcode_flavor ne 'makerbot'; + print $fh "G90 ; use absolute coordinates\n" if $Slic3r::Config->gcode_flavor ne 'makerware'; if ($Slic3r::Config->gcode_flavor =~ /^(?:reprap|teacup)$/) { printf $fh $gcodegen->reset_e; if ($Slic3r::Config->use_relative_e_distances) { diff --git a/slic3r.pl b/slic3r.pl index e792548ef..0b05cd043 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -173,7 +173,7 @@ $j (default: $config->{print_center}->[0],$config->{print_center}->[1]) --z-offset Additional height in mm to add to vertical coordinates (+/-, default: $config->{z_offset}) - --gcode-flavor The type of G-code to generate (reprap/teacup/makerbot/sailfish/mach3/no-extrusion, + --gcode-flavor The type of G-code to generate (reprap/teacup/makerware/sailfish/mach3/no-extrusion, default: $config->{gcode_flavor}) --use-relative-e-distances Enable this to get relative E values --gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported diff --git a/utils/zsh/functions/_slic3r b/utils/zsh/functions/_slic3r index 41b2594bd..10a0ce05b 100644 --- a/utils/zsh/functions/_slic3r +++ b/utils/zsh/functions/_slic3r @@ -22,7 +22,7 @@ _arguments -S \ '*--nozzle-diameter[specify nozzle diameter]:nozzle diameter in mm' \ '--print-center[specify print center coordinates]:print center coordinates in mm,mm' \ '--z-offset[specify Z-axis offset]:Z-axis offset in mm' \ - '--gcode-flavor[specify the type of G-code to generate]:G-code flavor:(reprap teacup makerbot sailfish mach3 no-extrusion)' \ + '--gcode-flavor[specify the type of G-code to generate]:G-code flavor:(reprap teacup makerware sailfish mach3 no-extrusion)' \ '(--use-relative-e-distances --no-use-relative-e-distances)'--{no-,}use-relative-e-distances'[disable/enable relative E values]' \ '--extrusion-axis[specify letter associated with the extrusion axis]:extrusion axis letter' \ '(--gcode-arcs --no-gcode-arcs)'--{no-,}gcode-arcs'[disable/enable G2/G3 commands for native arcs]' \