mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-12 03:29:02 +08:00
Bugfix: first_layer_temperature was ignored by ooze_prevention for first layer skirt/brim. #3964
This commit is contained in:
parent
fbb606d026
commit
6e2ffaf4ca
@ -136,6 +136,10 @@ sub export {
|
|||||||
# prepare the helper object for replacing placeholders in custom G-code and output filename
|
# prepare the helper object for replacing placeholders in custom G-code and output filename
|
||||||
$self->placeholder_parser->update_timestamp;
|
$self->placeholder_parser->update_timestamp;
|
||||||
|
|
||||||
|
# GCode sets this automatically whenever we call change_layer(),
|
||||||
|
# but we need it for skirt/brim too
|
||||||
|
$gcodegen->set_first_layer(1);
|
||||||
|
|
||||||
# disable fan
|
# disable fan
|
||||||
print $fh $gcodegen->writer->set_fan(0, 1)
|
print $fh $gcodegen->writer->set_fan(0, 1)
|
||||||
if $self->config->cooling && $self->config->disable_fan_first_layers;
|
if $self->config->cooling && $self->config->disable_fan_first_layers;
|
||||||
|
16
t/multi.t
16
t/multi.t
@ -16,6 +16,8 @@ use Slic3r::Test;
|
|||||||
|
|
||||||
{
|
{
|
||||||
my $config = Slic3r::Config->new_from_defaults;
|
my $config = Slic3r::Config->new_from_defaults;
|
||||||
|
$config->set('layer_height', 0.3);
|
||||||
|
$config->set('first_layer_height', 0.35);
|
||||||
$config->set('raft_layers', 2);
|
$config->set('raft_layers', 2);
|
||||||
$config->set('infill_extruder', 2);
|
$config->set('infill_extruder', 2);
|
||||||
$config->set('solid_infill_extruder', 3);
|
$config->set('solid_infill_extruder', 3);
|
||||||
@ -24,7 +26,9 @@ use Slic3r::Test;
|
|||||||
$config->set('extruder_offset', [ [0,0], [20,0], [0,20], [20,20] ]);
|
$config->set('extruder_offset', [ [0,0], [20,0], [0,20], [20,20] ]);
|
||||||
$config->set('temperature', [200, 180, 170, 160]);
|
$config->set('temperature', [200, 180, 170, 160]);
|
||||||
$config->set('first_layer_temperature', [206, 186, 166, 156]);
|
$config->set('first_layer_temperature', [206, 186, 166, 156]);
|
||||||
|
$config->set('standby_temperature_delta', -5);
|
||||||
$config->set('toolchange_gcode', ';toolchange'); # test that it doesn't crash when this is supplied
|
$config->set('toolchange_gcode', ';toolchange'); # test that it doesn't crash when this is supplied
|
||||||
|
$config->set('skirts', 2); # test correct temperatures are applied to skirt as well
|
||||||
|
|
||||||
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
|
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
|
||||||
|
|
||||||
@ -57,6 +61,18 @@ use Slic3r::Test;
|
|||||||
} elsif ($cmd eq 'G1' && $info->{extruding} && $info->{dist_XY} > 0) {
|
} elsif ($cmd eq 'G1' && $info->{extruding} && $info->{dist_XY} > 0) {
|
||||||
push @extrusion_points, my $point = Slic3r::Point->new_scale($args->{X}, $args->{Y});
|
push @extrusion_points, my $point = Slic3r::Point->new_scale($args->{X}, $args->{Y});
|
||||||
$point->translate(map +scale($_), @{ $config->extruder_offset->[$tool] });
|
$point->translate(map +scale($_), @{ $config->extruder_offset->[$tool] });
|
||||||
|
|
||||||
|
# check temperature (we don't do it at M104/M109 because that may be
|
||||||
|
# issued before layer change)
|
||||||
|
if ($self->Z == $config->first_layer_height) {
|
||||||
|
fail 'unexpected temperature in first layer'
|
||||||
|
unless $tool_temp[$tool] == ($config->first_layer_temperature->[$tool] + $config->standby_temperature_delta)
|
||||||
|
|| $tool_temp[$tool] == $config->first_layer_temperature->[$tool];
|
||||||
|
} else {
|
||||||
|
fail 'unexpected temperature'
|
||||||
|
unless $tool_temp[$tool] == ($config->temperature->[$tool] + $config->standby_temperature_delta)
|
||||||
|
|| $tool_temp[$tool] == $config->temperature->[$tool];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
my $convex_hull = convex_hull(\@extrusion_points);
|
my $convex_hull = convex_hull(\@extrusion_points);
|
||||||
|
@ -119,7 +119,7 @@ OozePrevention::post_toolchange(GCode &gcodegen)
|
|||||||
int
|
int
|
||||||
OozePrevention::_get_temp(GCode &gcodegen)
|
OozePrevention::_get_temp(GCode &gcodegen)
|
||||||
{
|
{
|
||||||
return (gcodegen.layer != NULL && gcodegen.layer->id() == 0)
|
return gcodegen.first_layer
|
||||||
? gcodegen.config.first_layer_temperature.get_at(gcodegen.writer.extruder()->id)
|
? gcodegen.config.first_layer_temperature.get_at(gcodegen.writer.extruder()->id)
|
||||||
: gcodegen.config.temperature.get_at(gcodegen.writer.extruder()->id);
|
: gcodegen.config.temperature.get_at(gcodegen.writer.extruder()->id);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user