Fix of previous commit.

This commit is contained in:
Vojtech Bubnik 2020-09-24 20:32:52 +02:00
parent 7a799be426
commit e0b0a2cdcf
3 changed files with 10 additions and 8 deletions

View File

@ -440,7 +440,7 @@ std::pair<FillAdaptive::OctreePtr, FillAdaptive::OctreePtr> PrintObject::prepare
using namespace FillAdaptive; using namespace FillAdaptive;
auto [adaptive_line_spacing, support_line_spacing] = adaptive_fill_line_spacing(*this); auto [adaptive_line_spacing, support_line_spacing] = adaptive_fill_line_spacing(*this);
if (adaptive_line_spacing == 0. && support_line_spacing == 0. || this->layers().empty()) if ((adaptive_line_spacing == 0. && support_line_spacing == 0.) || this->layers().empty())
return std::make_pair(OctreePtr(), OctreePtr()); return std::make_pair(OctreePtr(), OctreePtr());
indexed_triangle_set mesh = this->model_object()->raw_indexed_triangle_set(); indexed_triangle_set mesh = this->model_object()->raw_indexed_triangle_set();
@ -1561,9 +1561,11 @@ static void apply_to_print_region_config(PrintRegionConfig &out, const DynamicPr
std::string sextruder = "extruder"; std::string sextruder = "extruder";
auto *opt_extruder = in.opt<ConfigOptionInt>(sextruder); auto *opt_extruder = in.opt<ConfigOptionInt>(sextruder);
if (opt_extruder) { if (opt_extruder) {
if (opt_extruder->value != 0) { int extruder = opt_extruder->value;
out.infill_extruder.value = opt_extruder->value; if (extruder != 0) {
out.perimeter_extruder.value = opt_extruder->value; out.infill_extruder .value = extruder;
out.solid_infill_extruder.value = extruder;
out.perimeter_extruder .value = extruder;
} }
} }
// 2) Copy the rest of the values. // 2) Copy the rest of the values.

View File

@ -219,7 +219,7 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Static::new_FullPrintCo
my $config = Slic3r::Config->new; my $config = Slic3r::Config->new;
$config->set('extruder', 2); $config->set('extruder', 2);
$config->set('perimeter_extruder', 3); $config->set('perimeter_extruder', 3);
$config->normalize; $config->normalize_fdm;
ok !$config->has('extruder'), 'extruder option is removed after normalize()'; ok !$config->has('extruder'), 'extruder option is removed after normalize()';
is $config->get('infill_extruder'), 2, 'undefined extruder is populated with default extruder'; is $config->get('infill_extruder'), 2, 'undefined extruder is populated with default extruder';
is $config->get('perimeter_extruder'), 3, 'defined extruder is not overwritten by default extruder'; is $config->get('perimeter_extruder'), 3, 'defined extruder is not overwritten by default extruder';
@ -228,7 +228,7 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Static::new_FullPrintCo
{ {
my $config = Slic3r::Config->new; my $config = Slic3r::Config->new;
$config->set('infill_extruder', 2); $config->set('infill_extruder', 2);
$config->normalize; $config->normalize_fdm;
is $config->get('solid_infill_extruder'), 2, 'undefined solid infill extruder is populated with infill extruder'; is $config->get('solid_infill_extruder'), 2, 'undefined solid infill extruder is populated with infill extruder';
} }
@ -236,7 +236,7 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Static::new_FullPrintCo
my $config = Slic3r::Config->new; my $config = Slic3r::Config->new;
$config->set('spiral_vase', 1); $config->set('spiral_vase', 1);
$config->set('retract_layer_change', [1,0]); $config->set('retract_layer_change', [1,0]);
$config->normalize; $config->normalize_fdm;
is_deeply $config->get('retract_layer_change'), [0,0], 'retract_layer_change is disabled with spiral_vase'; is_deeply $config->get('retract_layer_change'), [0,0], 'retract_layer_change is disabled with spiral_vase';
} }

View File

@ -48,7 +48,7 @@
%code{% THIS->apply(*other, true); %}; %code{% THIS->apply(*other, true); %};
%name{get_keys} std::vector<std::string> keys(); %name{get_keys} std::vector<std::string> keys();
void erase(t_config_option_key opt_key); void erase(t_config_option_key opt_key);
void normalize(); void normalize_fdm();
%name{setenv} void setenv_(); %name{setenv} void setenv_();
double min_object_distance() %code{% RETVAL = Slic3r::min_object_distance(*THIS); %}; double min_object_distance() %code{% RETVAL = Slic3r::min_object_distance(*THIS); %};
static DynamicPrintConfig* load(char *path) static DynamicPrintConfig* load(char *path)