From a3f5fbf5322aba4bee7401a5252d9ae465b16306 Mon Sep 17 00:00:00 2001 From: Saumya Jain Date: Thu, 22 Feb 2024 16:48:03 +0100 Subject: [PATCH 1/4] adding an extra travel move at the beginning to machine_start_pos CURA-11444 --- src/FffGcodeWriter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index d4c64cb685..a21081daec 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -140,6 +140,12 @@ void FffGcodeWriter::writeGCode(SliceDataStorage& storage, TimeKeeper& time_keep mesh_order_per_extruder.push_back(calculateMeshOrder(storage, extruder_nr)); } } + + // Setting first travel move of the first extruder to the machine start position + const auto extruder_settings = Application::getInstance().current_slice_->scene.extruders[start_extruder_nr].settings_; + Point3LL p(extruder_settings.get("machine_extruder_start_pos_x"), extruder_settings.get("machine_extruder_start_pos_y"), gcode.getPositionZ()); + gcode.writeTravel(p, Application::getInstance().current_slice_->scene.extruders[gcode.getExtruderNr()].settings_.get("speed_travel"));; + calculateExtruderOrderPerLayer(storage); calculatePrimeLayerPerExtruder(storage); From 4548f7253d7ee9518748534e1a27d76e913597cc Mon Sep 17 00:00:00 2001 From: saumyaj3 Date: Thu, 22 Feb 2024 15:48:43 +0000 Subject: [PATCH 2/4] Applied clang-format. --- src/FffGcodeWriter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index a21081daec..c014d733f5 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -144,7 +144,8 @@ void FffGcodeWriter::writeGCode(SliceDataStorage& storage, TimeKeeper& time_keep // Setting first travel move of the first extruder to the machine start position const auto extruder_settings = Application::getInstance().current_slice_->scene.extruders[start_extruder_nr].settings_; Point3LL p(extruder_settings.get("machine_extruder_start_pos_x"), extruder_settings.get("machine_extruder_start_pos_y"), gcode.getPositionZ()); - gcode.writeTravel(p, Application::getInstance().current_slice_->scene.extruders[gcode.getExtruderNr()].settings_.get("speed_travel"));; + gcode.writeTravel(p, Application::getInstance().current_slice_->scene.extruders[gcode.getExtruderNr()].settings_.get("speed_travel")); + ; calculateExtruderOrderPerLayer(storage); calculatePrimeLayerPerExtruder(storage); From 8ea17cc29f672979dafce2bbc24f5d9c5dfe4b98 Mon Sep 17 00:00:00 2001 From: Saumya Jain Date: Thu, 22 Feb 2024 16:54:32 +0100 Subject: [PATCH 3/4] removing extra semicolon CURA-11553 --- src/FffGcodeWriter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index c014d733f5..e6d7980f8b 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -145,7 +145,6 @@ void FffGcodeWriter::writeGCode(SliceDataStorage& storage, TimeKeeper& time_keep const auto extruder_settings = Application::getInstance().current_slice_->scene.extruders[start_extruder_nr].settings_; Point3LL p(extruder_settings.get("machine_extruder_start_pos_x"), extruder_settings.get("machine_extruder_start_pos_y"), gcode.getPositionZ()); gcode.writeTravel(p, Application::getInstance().current_slice_->scene.extruders[gcode.getExtruderNr()].settings_.get("speed_travel")); - ; calculateExtruderOrderPerLayer(storage); calculatePrimeLayerPerExtruder(storage); From 404c1c690c82a8863176ab995d3426476a2fb737 Mon Sep 17 00:00:00 2001 From: Saumya Jain Date: Thu, 22 Feb 2024 17:15:03 +0100 Subject: [PATCH 4/4] writeing initial travel move of the extruder to avoid scarring CURA-11553 --- src/FffGcodeWriter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index e6d7980f8b..dcef0e3eab 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -142,9 +142,9 @@ void FffGcodeWriter::writeGCode(SliceDataStorage& storage, TimeKeeper& time_keep } // Setting first travel move of the first extruder to the machine start position - const auto extruder_settings = Application::getInstance().current_slice_->scene.extruders[start_extruder_nr].settings_; + const auto extruder_settings = Application::getInstance().current_slice_->scene.extruders[gcode.getExtruderNr()].settings_; Point3LL p(extruder_settings.get("machine_extruder_start_pos_x"), extruder_settings.get("machine_extruder_start_pos_y"), gcode.getPositionZ()); - gcode.writeTravel(p, Application::getInstance().current_slice_->scene.extruders[gcode.getExtruderNr()].settings_.get("speed_travel")); + gcode.writeTravel(p, extruder_settings.get("speed_travel")); calculateExtruderOrderPerLayer(storage); calculatePrimeLayerPerExtruder(storage);