From 145f0489b877c17443ca4a9cd82e05d28e987fe3 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 27 Oct 2021 08:56:10 +0200 Subject: [PATCH] Fixed crash when a part of a multipart object is completely below the printbed --- src/libslic3r/Model.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 2dcf342116..8531ab07e0 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -1587,6 +1587,10 @@ unsigned int ModelObject::check_instances_print_volume_state(const Polygon& prin if (vol->is_model_part()) { const Transform3d matrix = model_instance->get_matrix() * vol->get_matrix(); const BoundingBoxf3 bb = vol->mesh().transformed_bounding_box(matrix, 0.0); + if (!bb.defined) { + // this may happen if the part is fully below the printbed, leading to a crash in the following call to its_convex_hull_2d_above() + continue; + } const Polygon volume_hull_2d = its_convex_hull_2d_above(vol->mesh().its, matrix.cast(), 0.0f); ModelInstanceEPrintVolumeState state = printbed_collision_state(printbed_shape, print_volume_height, volume_hull_2d, bb.min.z(), bb.max.z()); if (state == ModelInstancePVS_Inside)