From f3a11c36843250a5a1af7245ef5c62fab20dc3a9 Mon Sep 17 00:00:00 2001 From: supermerill Date: Wed, 6 Oct 2021 13:45:04 +0200 Subject: [PATCH] Fix Bridge flow calibration text with first layer height of 0.3 for a 0.4 nozzle supermerill/SuperSlicer#1462 --- src/slic3r/GUI/CalibrationBridgeDialog.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/slic3r/GUI/CalibrationBridgeDialog.cpp b/src/slic3r/GUI/CalibrationBridgeDialog.cpp index 97e13a0a2..9f98f855a 100644 --- a/src/slic3r/GUI/CalibrationBridgeDialog.cpp +++ b/src/slic3r/GUI/CalibrationBridgeDialog.cpp @@ -143,6 +143,21 @@ void CalibrationBridgeDialog::create_geometry(std::string setting_to_test, bool model.objects[objs_idx[i]]->config.set_key_value("no_perimeter_unsupported_algo", new ConfigOptionEnum(npuaBridges)); model.objects[objs_idx[i]]->config.set_key_value("top_fill_pattern", new ConfigOptionEnum(ipSmooth)); } + /// 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); + 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("z_step")->value; + if (z_step == 0) + z_step = 0.1; + double max_height = printer_config->option("max_layer_height")->values[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)); + else + 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)); + } //update plater GLCanvas3D::set_warning_freeze(false);