From 629108265b5c9c1e6f4496a73fe6b1c0d0f83d6d Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 26 Jul 2018 12:57:47 +0200 Subject: [PATCH] Fix for SPE-421 and emergency fix for SPE-422 (needs further investigation) --- xs/src/libnest2d/libnest2d/selections/firstfit.hpp | 3 +-- xs/src/libslic3r/Model.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/xs/src/libnest2d/libnest2d/selections/firstfit.hpp b/xs/src/libnest2d/libnest2d/selections/firstfit.hpp index b6e80520c..5185014a8 100644 --- a/xs/src/libnest2d/libnest2d/selections/firstfit.hpp +++ b/xs/src/libnest2d/libnest2d/selections/firstfit.hpp @@ -61,8 +61,7 @@ public: while (it != store_.end()) { Placer p(bin); if(!p.pack(*it)) { - auto itmp = it++; - store_.erase(itmp); + it = store_.erase(it); } else it++; } } diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp index b2e439e5d..8054d6a69 100644 --- a/xs/src/libslic3r/Model.cpp +++ b/xs/src/libslic3r/Model.cpp @@ -549,7 +549,7 @@ bool arrange(Model &model, coordf_t dist, const Slic3r::BoundingBoxf* bb, auto& sh = pile.back(); // We retrieve the reference point of this item - auto rv = Nfp::referenceVertex(sh); + auto rv = ShapeLike::boundingBox(sh).center(); // We get the distance of the reference point from the center of the // heat bed @@ -558,7 +558,7 @@ bool arrange(Model &model, coordf_t dist, const Slic3r::BoundingBoxf* bb, // The score will be the normalized distance which will be minimized, // effectively creating a circle shaped pile of items - double score = double(d)/norm; + double score = d/norm; // If it does not fit into the print bed we will beat it // with a large penality. If we would not do this, there would be only