Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2018-02-13 13:18:58 +0300
committerbubnikv <bubnikv@gmail.com>2018-02-13 13:18:58 +0300
commite7f05f8516e5e7ab52bfc4af0d5bbbd1bc5ae43c (patch)
tree0bd238230c89c66d9df17b3b635145db4421344b
parent81a80ebd618ada3494e6c996d0b607bf522dddb0 (diff)
Fix of "Crash while trying to slice with a raft" #686
This was an issue specific to multi-material print with raft and no support.
-rw-r--r--xs/src/libslic3r/Print.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp
index 0bc63f2f3..c689929c6 100644
--- a/xs/src/libslic3r/Print.cpp
+++ b/xs/src/libslic3r/Print.cpp
@@ -997,7 +997,8 @@ void Print::_make_wipe_tower()
// Find the position in this->objects.first()->support_layers to insert these new support layers.
double wipe_tower_new_layer_print_z_first = m_tool_ordering.layer_tools()[idx_begin].print_z;
SupportLayerPtrs::iterator it_layer = this->objects.front()->support_layers.begin();
- for (; (*it_layer)->print_z - EPSILON < wipe_tower_new_layer_print_z_first; ++ it_layer) ;
+ SupportLayerPtrs::iterator it_end = this->objects.front()->support_layers.end();
+ for (; it_layer != it_end && (*it_layer)->print_z - EPSILON < wipe_tower_new_layer_print_z_first; ++ it_layer);
// Find the stopper of the sequence of wipe tower layers, which do not have a counterpart in an object or a support layer.
for (size_t i = idx_begin; i < idx_end; ++ i) {
ToolOrdering::LayerTools &lt = const_cast<ToolOrdering::LayerTools&>(m_tool_ordering.layer_tools()[i]);
@@ -1005,9 +1006,9 @@ void Print::_make_wipe_tower()
break;
lt.has_support = true;
// Insert the new support layer.
- //FIXME the support layer ID is duplicated, but Vojtech hopes it is not being used anywhere anyway.
double height = lt.print_z - m_tool_ordering.layer_tools()[i-1].print_z;
- auto *new_layer = new SupportLayer((*it_layer)->id(), this->objects.front(),
+ //FIXME the support layer ID is set to -1, as Vojtech hopes it is not being used anyway.
+ auto *new_layer = new SupportLayer(size_t(-1), this->objects.front(),
height, lt.print_z, lt.print_z - 0.5 * height);
it_layer = this->objects.front()->support_layers.insert(it_layer, new_layer);
++ it_layer;