Rename makerbot G-code flavor to makerware; also mention Repetier among RepRap firmwares. #1034

This commit is contained in:
Alessandro Ranellucci 2013-06-07 23:24:53 +02:00
parent 510c2092df
commit b12a09ed71
6 changed files with 25 additions and 18 deletions

View File

@ -7,7 +7,7 @@ A: Yes.
## What's it? ## What's it?
Slic3r is a G-code generator for 3D printers. It's compatible with RepRaps, 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 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. [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) (default: 100,100)
--z-offset Additional height in mm to add to vertical coordinates --z-offset Additional height in mm to add to vertical coordinates
(+/-, default: 0) (+/-, 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) default: reprap)
--use-relative-e-distances Enable this to get relative E values --use-relative-e-distances Enable this to get relative E values
--gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported --gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported

View File

@ -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.', 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', cli => 'gcode-flavor=s',
type => 'select', type => 'select',
values => [qw(reprap teacup makerbot sailfish mach3 no-extrusion)], values => [qw(reprap teacup makerware sailfish mach3 no-extrusion)],
labels => ['RepRap (Marlin/Sprinter)', 'Teacup', 'MakerBot', 'Sailfish', 'Mach3/EMC', 'No extrusion'], labels => ['RepRap (Marlin/Sprinter/Repetier)', 'Teacup', 'MakerWare (MakerBot)', 'Sailfish (MakerBot)', 'Mach3/EMC', 'No extrusion'],
default => 'reprap', default => 'reprap',
}, },
'use_relative_e_distances' => { 'use_relative_e_distances' => {
@ -1150,6 +1150,9 @@ sub set {
if ($opt_key eq 'threads' && !$Slic3r::have_threads) { if ($opt_key eq 'threads' && !$Slic3r::have_threads) {
$value = 1; $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; # 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 # 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 --top-solid-layers\n" if $self->top_solid_layers < 0;
die "Invalid value for --bottom-solid-layers\n" if $self->bottom_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 # --print-center
die "Invalid value for --print-center\n" die "Invalid value for --print-center\n"
if !ref $self->print_center if !ref $self->print_center

View File

@ -88,7 +88,7 @@ sub change_layer {
} }
my $gcode = ""; my $gcode = "";
if ($self->config->gcode_flavor =~ /^(?:makerbot|sailfish)$/) { if ($self->config->gcode_flavor =~ /^(?:makerware|sailfish)$/) {
$gcode .= sprintf "M73 P%s%s\n", $gcode .= sprintf "M73 P%s%s\n",
int(99 * ($layer->id / ($self->layer_count - 1))), int(99 * ($layer->id / ($self->layer_count - 1))),
($self->config->gcode_comments ? ' ; update progress' : ''); ($self->config->gcode_comments ? ' ; update progress' : '');
@ -420,7 +420,7 @@ sub retract {
# this makes sure we leave sufficient precision in the firmware # this makes sure we leave sufficient precision in the firmware
$gcode .= $self->reset_e; $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; return $gcode;
} }
@ -429,7 +429,7 @@ sub unretract {
my $self = shift; my $self = shift;
my $gcode = ""; 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) { if ($self->lifted) {
$self->speed('travel'); $self->speed('travel');
@ -451,7 +451,7 @@ sub unretract {
sub reset_e { sub reset_e {
my $self = shift; 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; $self->extruder->e(0) if $self->extruder;
return sprintf "G92 %s0%s\n", $self->config->extrusion_axis, ($self->config->gcode_comments ? ' ; reset extrusion distance' : '') 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 # set the new extruder
$self->extruder($extruder); $self->extruder($extruder);
$gcode .= sprintf "%s%d%s\n", $gcode .= sprintf "%s%d%s\n",
($self->config->gcode_flavor eq 'makerbot' ($self->config->gcode_flavor eq 'makerware'
? 'M135 T' ? 'M135 T'
: $self->config->gcode_flavor eq 'sailfish' : $self->config->gcode_flavor eq 'sailfish'
? 'M108 T' ? 'M108 T'
@ -613,12 +613,12 @@ sub set_fan {
if ($speed == 0) { if ($speed == 0) {
my $code = $self->config->gcode_flavor eq 'teacup' my $code = $self->config->gcode_flavor eq 'teacup'
? 'M106 S0' ? 'M106 S0'
: $self->config->gcode_flavor =~ /^(?:makerbot|sailfish)$/ : $self->config->gcode_flavor =~ /^(?:makerware|sailfish)$/
? 'M127' ? 'M127'
: 'M107'; : 'M107';
return sprintf "$code%s\n", ($self->config->gcode_comments ? ' ; disable fan' : ''); return sprintf "$code%s\n", ($self->config->gcode_comments ? ' ; disable fan' : '');
} else { } 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' : ''); return sprintf "M126%s\n", ($self->config->gcode_comments ? ' ; enable fan' : '');
} else { } else {
return sprintf "M106 %s%d%s\n", ($self->config->gcode_flavor eq 'mach3' ? 'P' : 'S'), 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 $self = shift;
my ($temperature, $wait, $tool) = @_; 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') my ($code, $comment) = ($wait && $self->config->gcode_flavor ne 'teacup')
? ('M109', 'wait for temperature to be reached') ? ('M109', 'wait for temperature to be reached')
: ('M104', 'set temperature'); : ('M104', 'set temperature');
my $gcode = sprintf "$code %s%d %s; $comment\n", my $gcode = sprintf "$code %s%d %s; $comment\n",
($self->config->gcode_flavor eq 'mach3' ? 'P' : 'S'), $temperature, ($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" $gcode .= "M116 ; wait for temperature to be reached\n"
if $self->config->gcode_flavor eq 'teacup' && $wait; if $self->config->gcode_flavor eq 'teacup' && $wait;
@ -653,7 +653,7 @@ sub set_bed_temperature {
my ($temperature, $wait) = @_; my ($temperature, $wait) = @_;
my ($code, $comment) = ($wait && $self->config->gcode_flavor ne 'teacup') 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'); : ('M140', 'set bed temperature');
my $gcode = sprintf "$code %s%d ; $comment\n", my $gcode = sprintf "$code %s%d ; $comment\n",
($self->config->gcode_flavor eq 'mach3' ? 'P' : 'S'), $temperature; ($self->config->gcode_flavor eq 'mach3' ? 'P' : 'S'), $temperature;

View File

@ -714,7 +714,7 @@ sub write_gcode {
multiple_extruders => (@{$self->extruders} > 1), multiple_extruders => (@{$self->extruders} > 1),
layer_count => $self->layer_count, 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; print $fh $gcodegen->set_fan(0, 1) if $Slic3r::Config->cooling && $Slic3r::Config->disable_fan_first_layers;
# write start commands to file # 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) 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; 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)$/) { if ($Slic3r::Config->gcode_flavor =~ /^(?:reprap|teacup)$/) {
printf $fh $gcodegen->reset_e; printf $fh $gcodegen->reset_e;
if ($Slic3r::Config->use_relative_e_distances) { if ($Slic3r::Config->use_relative_e_distances) {

View File

@ -173,7 +173,7 @@ $j
(default: $config->{print_center}->[0],$config->{print_center}->[1]) (default: $config->{print_center}->[0],$config->{print_center}->[1])
--z-offset Additional height in mm to add to vertical coordinates --z-offset Additional height in mm to add to vertical coordinates
(+/-, default: $config->{z_offset}) (+/-, 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}) default: $config->{gcode_flavor})
--use-relative-e-distances Enable this to get relative E values --use-relative-e-distances Enable this to get relative E values
--gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported --gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported

View File

@ -22,7 +22,7 @@ _arguments -S \
'*--nozzle-diameter[specify nozzle diameter]:nozzle diameter in mm' \ '*--nozzle-diameter[specify nozzle diameter]:nozzle diameter in mm' \
'--print-center[specify print center coordinates]:print center coordinates in mm,mm' \ '--print-center[specify print center coordinates]:print center coordinates in mm,mm' \
'--z-offset[specify Z-axis offset]:Z-axis offset in 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]' \ '(--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' \ '--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]' \ '(--gcode-arcs --no-gcode-arcs)'--{no-,}gcode-arcs'[disable/enable G2/G3 commands for native arcs]' \