From 43d5d2da84973e2d9af69f0a94fcbcaeb307a3ce Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 30 Oct 2024 11:46:41 +0100 Subject: [PATCH 1/2] Fix spiralize mode CURA-12245 This was broken when moving to 3D GCodePath points for the scarf seam --- src/LayerPlan.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index 2b17229c36..9b07d2d22a 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -2381,7 +2381,7 @@ void LayerPlan::writeGCode(GCodeExport& gcode) for (const auto& reversed_chunk : paths | ranges::views::enumerate | ranges::views::reverse | ranges::views::chunk_by( - [](const auto&path_a, const auto&path_b) + [](const auto& path_a, const auto& path_b) { return (! std::get<1>(path_a).isTravelPath()) || std::get<1>(path_b).isTravelPath(); })) @@ -2664,14 +2664,14 @@ void LayerPlan::writeGCode(GCodeExport& gcode) const Point2LL p1 = spiral_path.points[point_idx].toPoint2LL(); length += vSizeMM(p0 - p1); p0 = p1; - gcode.setZ(std::round(z_ + layer_thickness_ * length / totalLength)); + const coord_t z_offset = std::round(layer_thickness_ * length / totalLength); const double extrude_speed = speed * spiral_path.speed_back_pressure_factor; writeExtrusionRelativeZ( gcode, spiral_path.points[point_idx], extrude_speed, - path.z_offset, + path.z_offset + z_offset, spiral_path.getExtrusionMM3perMM(), spiral_path.config.type, update_extrusion_offset); From 9a09cb29c051d328b3e50cba52467702de3b7cf6 Mon Sep 17 00:00:00 2001 From: wawanbreton Date: Wed, 30 Oct 2024 10:58:45 +0000 Subject: [PATCH 2/2] Applied clang-format. --- src/LayerPlan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index 9b07d2d22a..7d7dc3a2d1 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -2381,7 +2381,7 @@ void LayerPlan::writeGCode(GCodeExport& gcode) for (const auto& reversed_chunk : paths | ranges::views::enumerate | ranges::views::reverse | ranges::views::chunk_by( - [](const auto& path_a, const auto& path_b) + [](const auto&path_a, const auto&path_b) { return (! std::get<1>(path_a).isTravelPath()) || std::get<1>(path_b).isTravelPath(); }))