From 98a32f57aa4f0d5128ba3ab7a754a80cc5b7a569 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Wed, 25 Jun 2025 14:11:02 +0800 Subject: [PATCH] FIX: CLI: fix the default wipe_tower_x incorrect issue jira: no-jira Change-Id: I847a0fc0e69bfdf80cea68cafabaac1daee98b8a (cherry picked from commit 5b8af6cbe60c1a6a3fc11b5275131d4895d2f838) --- src/OrcaSlicer.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp index f7773e5206..049fe3fa92 100644 --- a/src/OrcaSlicer.cpp +++ b/src/OrcaSlicer.cpp @@ -4455,6 +4455,37 @@ int CLI::run(int argc, char **argv) BOOST_LOG_TRIVIAL(debug) << boost::format("plate %1%: no arrange, directly translate object %2% by {%3%, %4%}") % (i+1) % mo->name %plate_origin(0) %plate_origin(1); } + + bool is_seq_print = false; + get_print_sequence(cur_plate, m_print_config, is_seq_print); + + if (!is_seq_print && assemble_plate.filaments_count > 1) + { + //prepare the wipe tower + auto printer_structure_opt = m_print_config.option>("printer_structure"); + // set the default position, the same with print config(left top) + float x = WIPE_TOWER_DEFAULT_X_POS; + float y = WIPE_TOWER_DEFAULT_Y_POS; + if (printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3) { + x = I3_WIPE_TOWER_DEFAULT_X_POS; + y = I3_WIPE_TOWER_DEFAULT_Y_POS; + } + if (x < WIPE_TOWER_MARGIN) { + x = WIPE_TOWER_MARGIN; + } + if (y < WIPE_TOWER_MARGIN) { + y = WIPE_TOWER_MARGIN; + } + + //create the options using default if neccessary + ConfigOptionFloats* wipe_x_option = m_print_config.option("wipe_tower_x", true); + ConfigOptionFloats* wipe_y_option = m_print_config.option("wipe_tower_y", true); + ConfigOptionFloat wt_x_opt(x); + ConfigOptionFloat wt_y_opt(y); + + wipe_x_option->set_at(&wt_x_opt, i, 0); + wipe_y_option->set_at(&wt_y_opt, i, 0); + } } }