Fix perimeters_* options to be singular to be consistent.

This commit is contained in:
Mark Hindess 2012-06-30 23:18:15 +01:00
parent cbb111ee64
commit 07f2dab5f6
4 changed files with 15 additions and 13 deletions

View File

@ -82,7 +82,7 @@ our $temperature = [200];
our $first_layer_temperature= []; our $first_layer_temperature= [];
# extruder mapping (1-based indexes) # extruder mapping (1-based indexes)
our $perimeters_extruder = 1; our $perimeter_extruder = 1;
our $infill_extruder = 1; our $infill_extruder = 1;
our $support_material_extruder = 1; our $support_material_extruder = 1;
@ -114,7 +114,7 @@ our $infill_every_layers = 1;
# flow options # flow options
our $extrusion_width = 0; our $extrusion_width = 0;
our $first_layer_extrusion_width = 0; our $first_layer_extrusion_width = 0;
our $perimeters_extrusion_width = 0; our $perimeter_extrusion_width = 0;
our $infill_extrusion_width = 0; our $infill_extrusion_width = 0;
our $support_material_extrusion_width = 0; our $support_material_extrusion_width = 0;
our $bridge_flow_ratio = 1; our $bridge_flow_ratio = 1;

View File

@ -122,10 +122,11 @@ our $Options = {
}, },
# extruder mapping # extruder mapping
'perimeters_extruder' => { 'perimeter_extruder' => {
label => 'Perimeters extruder', label => 'Perimeter extruder',
cli => 'perimeters-extruder=i', cli => 'perimeter-extruder=i',
type => 'i', type => 'i',
aliases => [qw(perimeters_extruder)],
}, },
'infill_extruder' => { 'infill_extruder' => {
label => 'Infill extruder', label => 'Infill extruder',
@ -252,10 +253,11 @@ our $Options = {
cli => 'first-layer-extrusion-width=s', cli => 'first-layer-extrusion-width=s',
type => 'f', type => 'f',
}, },
'perimeters_extrusion_width' => { 'perimeter_extrusion_width' => {
label => 'Perimeters extrusion width (mm or % or 0 for default)', label => 'Perimeter extrusion width (mm or % or 0 for default)',
cli => 'perimeters-extrusion-width=s', cli => 'perimeter-extrusion-width=s',
type => 'f', type => 'f',
aliases => [qw(perimeters_extrusion_width)],
}, },
'infill_extrusion_width' => { 'infill_extrusion_width' => {
label => 'Infill extrusion width (mm or % or 0 for default)', label => 'Infill extrusion width (mm or % or 0 for default)',
@ -700,7 +702,7 @@ sub validate {
# initialize extruder(s) # initialize extruder(s)
$Slic3r::extruders = []; $Slic3r::extruders = [];
for my $t (0, map $_-1, $Slic3r::perimeters_extruder, $Slic3r::infill_extruder, $Slic3r::support_material_extruder) { for my $t (0, map $_-1, $Slic3r::perimeter_extruder, $Slic3r::infill_extruder, $Slic3r::support_material_extruder) {
$Slic3r::extruders->[$t] ||= Slic3r::Extruder->new( $Slic3r::extruders->[$t] ||= Slic3r::Extruder->new(
map { $_ => Slic3r::Config->get($_)->[$t] // Slic3r::Config->get($_)->[0] } #/ map { $_ => Slic3r::Config->get($_)->[$t] // Slic3r::Config->get($_)->[0] } #/
qw(nozzle_diameter filament_diameter extrusion_multiplier temperature first_layer_temperature) qw(nozzle_diameter filament_diameter extrusion_multiplier temperature first_layer_temperature)
@ -715,8 +717,8 @@ sub validate {
width => $Slic3r::first_layer_extrusion_width, width => $Slic3r::first_layer_extrusion_width,
); );
} }
$Slic3r::perimeters_flow = $Slic3r::extruders->[ $Slic3r::perimeters_extruder-1 ] $Slic3r::perimeters_flow = $Slic3r::extruders->[ $Slic3r::perimeter_extruder-1 ]
->make_flow(width => $Slic3r::perimeters_extrusion_width || $Slic3r::extrusion_width); ->make_flow(width => $Slic3r::perimeter_extrusion_width || $Slic3r::extrusion_width);
$Slic3r::infill_flow = $Slic3r::extruders->[ $Slic3r::infill_extruder-1 ] $Slic3r::infill_flow = $Slic3r::extruders->[ $Slic3r::infill_extruder-1 ]
->make_flow(width => $Slic3r::infill_extrusion_width || $Slic3r::extrusion_width); ->make_flow(width => $Slic3r::infill_extrusion_width || $Slic3r::extrusion_width);
$Slic3r::support_material_flow = $Slic3r::extruders->[ $Slic3r::support_material_extruder-1 ] $Slic3r::support_material_flow = $Slic3r::extruders->[ $Slic3r::support_material_extruder-1 ]

View File

@ -71,7 +71,7 @@ sub new {
}, },
extrusion => { extrusion => {
title => 'Extrusion', title => 'Extrusion',
options => [qw(extrusion_width first_layer_extrusion_width perimeters_extrusion_width infill_extrusion_width support_material_extrusion_width bridge_flow_ratio)], options => [qw(extrusion_width first_layer_extrusion_width perimeter_extrusion_width infill_extrusion_width support_material_extrusion_width bridge_flow_ratio)],
}, },
output => { output => {
title => 'Output', title => 'Output',

View File

@ -598,7 +598,7 @@ sub write_gcode {
$gcodegen->shift_y($shift[Y] + unscale $copy->[Y]); $gcodegen->shift_y($shift[Y] + unscale $copy->[Y]);
# extrude perimeters # extrude perimeters
$gcode .= $gcodegen->set_tool($Slic3r::perimeters_extruder-1); $gcode .= $gcodegen->set_tool($Slic3r::perimeter_extruder-1);
$gcode .= $gcodegen->extrude($_, 'perimeter') for @{ $layer->perimeters }; $gcode .= $gcodegen->extrude($_, 'perimeter') for @{ $layer->perimeters };
# extrude fills # extrude fills