Fixed crash when a part of a multipart object is completely below the printbed

This commit is contained in:
enricoturri1966 2021-10-27 08:56:10 +02:00
parent 9a4863a14b
commit 145f0489b8

View file

@ -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<float>(), 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)