From 1659e4c77f27cab6406415869d6d251dcdda4128 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Thu, 29 Jul 2021 15:02:16 +0200 Subject: [PATCH] Fixed splitting of triangle meshes, where the splitting function may produce a single triangle, which is then removed by the repair function. --- src/libslic3r/Model.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index f6980e5b2..0b9614fa2 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -1699,6 +1699,10 @@ size_t ModelVolume::split(unsigned int max_extruders) for (TriangleMesh *mesh : meshptrs) { mesh->repair(); + if (mesh->empty()) + // Repair may have removed unconnected triangles, thus emptying the mesh. + continue; + if (idx == 0) { this->set_mesh(std::move(*mesh));