Dual extruder for support material
This commit is contained in:
parent
375829204f
commit
94a2585b97
5 changed files with 23 additions and 1 deletions
|
@ -97,6 +97,7 @@ our $solid_fill_pattern = 'rectilinear';
|
||||||
our $fill_density = 0.4; # 1 = 100%
|
our $fill_density = 0.4; # 1 = 100%
|
||||||
our $fill_angle = 45;
|
our $fill_angle = 45;
|
||||||
our $support_material = 0;
|
our $support_material = 0;
|
||||||
|
our $support_material_tool = 0;
|
||||||
our $start_gcode = "G28 ; home all axes";
|
our $start_gcode = "G28 ; home all axes";
|
||||||
our $end_gcode = <<"END";
|
our $end_gcode = <<"END";
|
||||||
M104 S0 ; turn off temperature
|
M104 S0 ; turn off temperature
|
||||||
|
|
|
@ -220,6 +220,13 @@ our $Options = {
|
||||||
cli => 'support-material',
|
cli => 'support-material',
|
||||||
type => 'bool',
|
type => 'bool',
|
||||||
},
|
},
|
||||||
|
'support_material_tool' => {
|
||||||
|
label => 'Tool used to extrude support material',
|
||||||
|
cli => 'support-material-tool=i',
|
||||||
|
type => 'select',
|
||||||
|
values => [0,1],
|
||||||
|
labels => [qw(Primary Secondary)],
|
||||||
|
},
|
||||||
'start_gcode' => {
|
'start_gcode' => {
|
||||||
label => 'Start GCODE',
|
label => 'Start GCODE',
|
||||||
cli => 'start-gcode=s',
|
cli => 'start-gcode=s',
|
||||||
|
|
|
@ -326,4 +326,11 @@ sub _Gx {
|
||||||
return "$gcode\n";
|
return "$gcode\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub set_tool {
|
||||||
|
my $self = shift;
|
||||||
|
my ($tool) = @_;
|
||||||
|
|
||||||
|
return sprintf "T%d%s\n", $tool, ($Slic3r::gcode_comments ? ' ; change tool' : '');
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -41,7 +41,7 @@ sub new {
|
||||||
},
|
},
|
||||||
print => {
|
print => {
|
||||||
title => 'Print settings',
|
title => 'Print settings',
|
||||||
options => [qw(perimeters solid_layers fill_density fill_angle fill_pattern solid_fill_pattern support_material)],
|
options => [qw(perimeters solid_layers fill_density fill_angle fill_pattern solid_fill_pattern support_material support_material_tool)],
|
||||||
},
|
},
|
||||||
retract => {
|
retract => {
|
||||||
title => 'Retraction',
|
title => 'Retraction',
|
||||||
|
|
|
@ -566,6 +566,9 @@ sub export_gcode {
|
||||||
|
|
||||||
# set up our extruder object
|
# set up our extruder object
|
||||||
my $extruder = Slic3r::Extruder->new;
|
my $extruder = Slic3r::Extruder->new;
|
||||||
|
if ($Slic3r::support_material && $Slic3r::support_material_tool > 0) {
|
||||||
|
print $fh $extruder->set_tool(0);
|
||||||
|
}
|
||||||
|
|
||||||
# write gcode commands layer by layer
|
# write gcode commands layer by layer
|
||||||
foreach my $layer (@{ $self->layers }) {
|
foreach my $layer (@{ $self->layers }) {
|
||||||
|
@ -594,8 +597,12 @@ sub export_gcode {
|
||||||
|
|
||||||
# extrude support material
|
# extrude support material
|
||||||
if ($layer->support_fills) {
|
if ($layer->support_fills) {
|
||||||
|
print $fh $extruder->set_tool($Slic3r::support_material_tool)
|
||||||
|
if $Slic3r::support_material_tool > 0;
|
||||||
print $fh $extruder->extrude_path($_, 'support material')
|
print $fh $extruder->extrude_path($_, 'support material')
|
||||||
for $layer->support_fills->shortest_path($extruder->last_pos);
|
for $layer->support_fills->shortest_path($extruder->last_pos);
|
||||||
|
print $fh $extruder->set_tool(0)
|
||||||
|
if $Slic3r::support_material_tool > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue