From b7ce546cfc43235291f4d94bc8cfe172aa591f5c Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 13 May 2024 16:57:19 +0200 Subject: [PATCH] Workaround for SPE-2295 - Crash when re-cutting with dowel connectors --- src/slic3r/GUI/Selection.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index e9fdef933a..a2955acc96 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -832,8 +832,14 @@ std::pair Selection::get_bounding_box_in_reference_s const GLVolume& vol = *get_volume(id); const Transform3d vol_world_rafo = vol.world_matrix(); const TriangleMesh* mesh = vol.convex_hull(); - if (mesh == nullptr) + if (mesh == nullptr) { + // workaround to avoid a crash, see spe-2295 -> Crash when re-cutting with dowel connectors + const int obj_id = vol.object_idx(); + const int vol_id = vol.volume_idx(); + if (m_model->objects[obj_id]->volumes.size() <= vol_id) + continue; mesh = &m_model->objects[vol.object_idx()]->volumes[vol.volume_idx()]->mesh(); + } assert(mesh != nullptr); for (const stl_vertex& v : mesh->its.vertices) { const Vec3d world_v = vol_world_rafo * v.cast();