From dee9538ee44aae8c17a848351591701e1f77c5f5 Mon Sep 17 00:00:00 2001 From: "qing.zhang" Date: Tue, 5 Nov 2024 20:13:51 +0800 Subject: [PATCH] FIX: last layer height error on gcodeviewer Jira: STUDIO-8627 On scarf seam mode or spiral vase mode if the last layer is empty,layer height would be wrong need to move extra data, and update layer range Signed-off-by: qing.zhang Change-Id: I802ec266f4cebc8079fac2444061f362fd620381 (cherry picked from commit 7311dda480cb0deb1feba8ed2b29c36113a93a16) --- src/libslic3r/GCode.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 45e02f46c..47484011e 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1190,6 +1190,16 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu BOOST_LOG_TRIVIAL(debug) << "Start processing gcode, " << log_memory_info(); // Post-process the G-code to update time stamps. + // BBS: FIX: layers count error, while the last layer extrude is empty + // spiral_vase_layer can't get right height + while (!m_processor.result().spiral_vase_layers.empty()) { + if (m_processor.result().spiral_vase_layers.back().first != FLT_MAX) + break; + //record last move, update prev layer move range + int last_move = m_processor.result().spiral_vase_layers.back().second.second; + m_processor.result().spiral_vase_layers.pop_back(); + m_processor.result().spiral_vase_layers.back().second.second = last_move; + } m_timelapse_warning_code = 0; if (m_config.printer_structure.value == PrinterStructure::psI3 && m_spiral_vase) {