From a49caea6cc49397ecc034582d8f8b902f09c8251 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Fri, 9 Aug 2019 17:13:18 +0200 Subject: [PATCH] Hotfix for crash when empty pad and support mesh is generated. --- src/libslic3r/SLA/SLASupportTree.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/SLA/SLASupportTree.cpp b/src/libslic3r/SLA/SLASupportTree.cpp index 8f4998ce1..ac3b50831 100644 --- a/src/libslic3r/SLA/SLASupportTree.cpp +++ b/src/libslic3r/SLA/SLASupportTree.cpp @@ -713,7 +713,7 @@ struct Pad { } tmesh.translate(0, 0, float(zlevel)); - tmesh.require_shared_vertices(); + if (!tmesh.empty()) tmesh.require_shared_vertices(); } bool empty() const { return tmesh.facets_count() == 0; } @@ -2626,10 +2626,10 @@ std::vector SLASupportTree::slice( } size_t len = grid.size(); - for (const Slices slv : slices) { len = std::min(len, slv.size()); } + for (const Slices &slv : slices) { len = std::min(len, slv.size()); } // Either the support or the pad or both has to be non empty - assert(!slices.empty()); + if (slices.empty()) return {}; Slices &mrg = slices.front();