Fix extruder assignment and tests
This commit is contained in:
parent
10bf334a58
commit
071097d3f1
10 changed files with 109 additions and 186 deletions
18
t/print.t
18
t/print.t
|
@ -1,4 +1,4 @@
|
|||
use Test::More tests => 3;
|
||||
use Test::More tests => 5;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
@ -35,16 +35,24 @@ use Slic3r::Test;
|
|||
my $config = Slic3r::Config->new_from_defaults;
|
||||
|
||||
# user adds one object to the plater
|
||||
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
|
||||
my $print = Slic3r::Test::init_print(my $model = Slic3r::Test::model('20mm_cube'), config => $config);
|
||||
|
||||
# user sets a per-object option
|
||||
$print->objects->[0]->config->set('fill_density', 100);
|
||||
# user sets a per-region option
|
||||
$print->objects->[0]->model_object->config->set('fill_density', 100);
|
||||
$print->reload_object(0);
|
||||
|
||||
# user exports G-code, thus the default config is reapplied
|
||||
$print->apply_config($config);
|
||||
|
||||
is $print->objects->[0]->config->fill_density, 100, 'apply_config() does not override per-object settings';
|
||||
is $print->regions->[0]->config->fill_density, 100, 'apply_config() does not override per-object settings';
|
||||
|
||||
# user assigns object extruders
|
||||
$print->objects->[0]->model_object->config->set('extruder', 3);
|
||||
$print->objects->[0]->model_object->config->set('perimeter_extruder', 2);
|
||||
$print->reload_object(0);
|
||||
|
||||
is $print->regions->[0]->config->infill_extruder, 3, 'extruder setting is correctly expanded';
|
||||
is $print->regions->[0]->config->perimeter_extruder, 2, 'extruder setting does not override explicitely specified extruders';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue