diff options
author | supermerill <merill@free.fr> | 2021-11-16 23:50:21 +0300 |
---|---|---|
committer | supermerill <merill@free.fr> | 2021-11-16 19:59:07 +0300 |
commit | 8226e4608b2f0af55c62f45fe8c95523baf395dd (patch) | |
tree | caf3e1f17c94a646c72f23d5fd25521cbd5ca04b /src | |
parent | d020d048e982133196e8f918c54b005f3efa8fa6 (diff) |
Fix get_computed_value
supermerill/SuperSlicer#1877
Diffstat (limited to 'src')
-rw-r--r-- | src/libslic3r/Config.cpp | 2 | ||||
-rw-r--r-- | src/slic3r/GUI/CalibrationBridgeDialog.cpp | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp index 741c1d832..ee3fda467 100644 --- a/src/libslic3r/Config.cpp +++ b/src/libslic3r/Config.cpp @@ -710,7 +710,7 @@ double ConfigBase::get_computed_value(const t_config_option_key &opt_key, int ex //FIXME there are some ratio_over chains, which end with empty ratio_with. // For example, XXX_extrusion_width parameters are not handled by get_abs_value correctly. if (!opt_def->ratio_over.empty() && opt_def->ratio_over != "depends") - return cast_opt->get_abs_value(this->get_computed_value(opt_def->ratio_over)); + return cast_opt->get_abs_value(this->get_computed_value(opt_def->ratio_over, extruder_id)); std::stringstream ss; ss << "ConfigBase::get_abs_value(): " << opt_key << " has no valid ratio_over to compute of"; throw ConfigurationError(ss.str()); diff --git a/src/slic3r/GUI/CalibrationBridgeDialog.cpp b/src/slic3r/GUI/CalibrationBridgeDialog.cpp index f1e521dc0..302c0c856 100644 --- a/src/slic3r/GUI/CalibrationBridgeDialog.cpp +++ b/src/slic3r/GUI/CalibrationBridgeDialog.cpp @@ -80,7 +80,13 @@ void CalibrationBridgeDialog::create_geometry(std::string setting_to_test, bool assert(objs_idx.size() == nb_items); const DynamicPrintConfig* print_config = this->gui_app->get_tab(Preset::TYPE_FFF_PRINT)->get_config(); + const DynamicPrintConfig* filament_config = this->gui_app->get_tab(Preset::TYPE_FFF_FILAMENT)->get_config(); const DynamicPrintConfig* printer_config = this->gui_app->get_tab(Preset::TYPE_PRINTER)->get_config(); + DynamicPrintConfig full_print_config; + full_print_config.apply(*print_config); + full_print_config.apply(*filament_config); + full_print_config.apply(*printer_config); + full_print_config.set_key_value("extruder_id", new ConfigOptionInt(0)); /// --- scale --- // model is created for a 0.4 nozzle, scale xy with nozzle size. @@ -144,14 +150,14 @@ void CalibrationBridgeDialog::create_geometry(std::string setting_to_test, bool //model.objects[objs_idx[i]]->config.set_key_value("top_fill_pattern", new ConfigOptionEnum<InfillPattern>(ipSmooth)); /not needed model.objects[objs_idx[i]]->config.set_key_value("ironing", new ConfigOptionBool(false)); // not needed, and it slow down things. } - /// if first ayer height is excatly at the wrong value, the text isn't drawed. Fix that by switching the first layer height just a little bit. - double first_layer_height = print_config->get_computed_value("first_layer_height", 0); + /// if first ayer height is excactly at the wrong value, the text isn't drawed. Fix that by switching the first layer height just a little bit. + double first_layer_height = full_print_config.get_computed_value("first_layer_height", 0); double layer_height = nozzle_diameter * 0.5; if (layer_height > 0.01 && (int(first_layer_height * 100) % int(layer_height * 100)) == int(layer_height * 50)) { double z_step = printer_config->option<ConfigOptionFloat>("z_step")->value; if (z_step == 0) z_step = 0.1; - double max_height = printer_config->get_computed_value("max_layer_height",0); + double max_height = full_print_config.get_computed_value("max_layer_height",0); if (max_height > first_layer_height + z_step) for (size_t i = 0; i < nb_items; i++) model.objects[objs_idx[i]]->config.set_key_value("first_layer_height", new ConfigOptionFloatOrPercent(first_layer_height + z_step, false)); |