diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index 3767ccd2a9..a5cbc3ed34 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -1506,7 +1506,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ num_extruders > 1 && std::find_if(volumes.begin(), volumes.end(), [](const ModelVolume *v) { return ! v->mmu_segmentation_facets.empty(); }) != volumes.end()) { - std::array(EnforcerBlockerType::ExtruderMax)> used_facet_states{}; + std::array(EnforcerBlockerType::ExtruderMax) + 1> used_facet_states{}; for (const ModelVolume *volume : volumes) { const std::vector &volume_used_facet_states = volume->mmu_segmentation_facets.get_data().used_states; diff --git a/src/libslic3r/TriangleSelector.cpp b/src/libslic3r/TriangleSelector.cpp index e7c59b7119..6792f1aece 100644 --- a/src/libslic3r/TriangleSelector.cpp +++ b/src/libslic3r/TriangleSelector.cpp @@ -1665,7 +1665,7 @@ TriangleSelector::TriangleSplittingData TriangleSelector::serialize() const { } else { // In case this is leaf, we better save information about its state. int n = int(tr.get_state()); - if (n < static_cast(EnforcerBlockerType::ExtruderMax)) + if (n <= static_cast(EnforcerBlockerType::ExtruderMax)) data.used_states[n] = true; if (n >= 3) { diff --git a/src/libslic3r/TriangleSelector.hpp b/src/libslic3r/TriangleSelector.hpp index e22a551baf..f6026b1697 100644 --- a/src/libslic3r/TriangleSelector.hpp +++ b/src/libslic3r/TriangleSelector.hpp @@ -256,7 +256,7 @@ public: // Bit stream containing splitting information. std::vector bitstream; // Array indicating which triangle state types are used (encoded inside bitstream). - std::vector used_states { std::vector(static_cast(EnforcerBlockerType::ExtruderMax), false) }; + std::vector used_states { std::vector(static_cast(EnforcerBlockerType::ExtruderMax) + 1, false) }; TriangleSplittingData() = default; @@ -270,7 +270,7 @@ public: // Reset all used states before they are recomputed based on the bitstream. void reset_used_states() { - used_states.resize(static_cast(EnforcerBlockerType::ExtruderMax), false); + used_states.resize(static_cast(EnforcerBlockerType::ExtruderMax) + 1, false); std::fill(used_states.begin(), used_states.end(), false); }