From 8bb63ebeaf642584468c58750eec73df76d1f979 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 27 Sep 2023 19:26:43 +0800 Subject: [PATCH] FIX: auto-arranging crash for single plate arranging Jira: STUDIO-4651 Change-Id: I8e4be997292d7f7dbd741368e20db5a0d2e693cb (cherry picked from commit 7d75f5903f67fb332eaff4563308d5f196e45d1f) --- src/libnest2d/include/libnest2d/selections/firstfit.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libnest2d/include/libnest2d/selections/firstfit.hpp b/src/libnest2d/include/libnest2d/selections/firstfit.hpp index ef05398da..bb7f4b45c 100644 --- a/src/libnest2d/include/libnest2d/selections/firstfit.hpp +++ b/src/libnest2d/include/libnest2d/selections/firstfit.hpp @@ -163,7 +163,8 @@ public: if (was_packed && it->get().has_tried_with_excluded) { placers[j].clearItems([](const Item &itm) { return itm.isFixed() && !itm.is_wipe_tower; }); - placers[j].preload(fixed_bins[placers.size() - 1]); + if (fixed_bins.size() >= placers.size()) + placers[j].preload(fixed_bins[placers.size() - 1]); } bool placer_not_packed = !was_packed && !placers.empty() && j == placers.size() && placers[j - 1].getPackedSize() == 0; // large item is not placed into the bin if (placer_not_packed) {