mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-07 22:14:00 -06:00
Bugfix: incorrect number of raft layers was generated when too few were requested. #1678
This commit is contained in:
parent
26f0fab27a
commit
130e8dd8e7
4 changed files with 55 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
use Test::More tests => 7;
|
||||
use Test::More tests => 8;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
|
29
t/support.t
29
t/support.t
|
@ -1,4 +1,4 @@
|
|||
use Test::More tests => 14;
|
||||
use Test::More tests => 15;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
@ -123,4 +123,31 @@ use Slic3r::Test;
|
|||
'first object layer is completely supported by raft';
|
||||
}
|
||||
|
||||
{
|
||||
my $config = Slic3r::Config->new_from_defaults;
|
||||
$config->set('skirts', 0);
|
||||
$config->set('raft_layers', 2);
|
||||
$config->set('layer_height', 0.35);
|
||||
$config->set('first_layer_height', 0.3);
|
||||
$config->set('nozzle_diameter', [0.5]);
|
||||
$config->set('support_material_extruder', 2);
|
||||
$config->set('support_material_interface_extruder', 2);
|
||||
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
|
||||
my %raft_z = (); # z => 1
|
||||
my $tool = undef;
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($cmd =~ /^T(\d+)/) {
|
||||
$tool = $1;
|
||||
} elsif ($info->{extruding} && $info->{dist_XY} > 0) {
|
||||
if ($tool == $config->support_material_extruder-1) {
|
||||
$raft_z{$self->Z} = 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
is scalar(keys %raft_z), $config->raft_layers, 'correct number of raft layers is generated';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue