From 0a2001ed1c862553ff9d1229cf09be8b9bdbf8c8 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 14 Mar 2022 15:21:00 +0100 Subject: [PATCH] #8032 - GCodeProcessor - Fixed parsing of LAYER_CHANGE tag for spiral vase mode --- src/libslic3r/GCode/GCodeProcessor.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 50c0ce4a5..3bf7c4ffd 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -1952,12 +1952,15 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers ++m_layer_id; #if ENABLE_SPIRAL_VASE_LAYERS if (m_spiral_vase_active) { - assert(!m_result.moves.empty()); - size_t move_id = m_result.moves.size() - 1; - if (!m_result.spiral_vase_layers.empty() && m_end_position[Z] == m_result.spiral_vase_layers.back().first) - m_result.spiral_vase_layers.back().second.second = move_id; - else - m_result.spiral_vase_layers.push_back({ static_cast(m_end_position[Z]), { move_id, move_id } }); + if (m_result.moves.empty()) + m_result.spiral_vase_layers.push_back({ m_first_layer_height, { 0, 0 } }); + else { + const size_t move_id = m_result.moves.size() - 1; + if (!m_result.spiral_vase_layers.empty() && m_end_position[Z] == m_result.spiral_vase_layers.back().first) + m_result.spiral_vase_layers.back().second.second = move_id; + else + m_result.spiral_vase_layers.push_back({ static_cast(m_end_position[Z]), { move_id, move_id } }); + } } #endif // ENABLE_SPIRAL_VASE_LAYERS return;