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).
This commit is contained in:
Lukas Matena 2021-01-02 13:13:54 +01:00
parent 7a41ab20ed
commit 837070a246

View File

@ -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