From 837070a246050023bbbdb03a968dfd54ef0776b8 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Sat, 2 Jan 2021 13:13:54 +0100 Subject: [PATCH] Hotfix of a crash with raft and one-layer object (#5652) The problem is that PrintObject support generator is only run when m_layers.size() > 1, so one-layer object will skip it. It apparently never worked, after recent refactoring (probably 8bfc986) it started to crash in GCode generator. This commit fixes the crash, but not the problem. The raft is still not generated (like in all versions since 2.0.0 at least). --- src/libslic3r/GCode.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index b07db889c..f19185f9e 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1709,7 +1709,9 @@ namespace Skirt { //FIXME infinite or high skirt does not make sense for sequential print! (skirt_done.size() < (size_t)print.config().skirt_height.value || print.has_infinite_skirt()) && // This print_z has not been extruded yet (sequential print) - skirt_done.back() < layer_tools.print_z - EPSILON && + // FIXME: The skirt_done should not be empty at this point. The check is a workaround + // of https://github.com/prusa3d/PrusaSlicer/issues/5652, but it deserves a real fix. + (! skirt_done.empty() && skirt_done.back() < layer_tools.print_z - EPSILON) && // and this layer is an object layer, or it is a raft layer. (layer_tools.has_object || support_layer->id() < (size_t)support_layer->object()->config().raft_layers.value)) { #if 0