mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 17:55:56 +08:00
Fixed crash when a part of a multipart object is completely below the printbed
This commit is contained in:
parent
9a4863a14b
commit
145f0489b8
@ -1587,6 +1587,10 @@ unsigned int ModelObject::check_instances_print_volume_state(const Polygon& prin
|
|||||||
if (vol->is_model_part()) {
|
if (vol->is_model_part()) {
|
||||||
const Transform3d matrix = model_instance->get_matrix() * vol->get_matrix();
|
const Transform3d matrix = model_instance->get_matrix() * vol->get_matrix();
|
||||||
const BoundingBoxf3 bb = vol->mesh().transformed_bounding_box(matrix, 0.0);
|
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);
|
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());
|
ModelInstanceEPrintVolumeState state = printbed_collision_state(printbed_shape, print_volume_height, volume_hull_2d, bb.min.z(), bb.max.z());
|
||||||
if (state == ModelInstancePVS_Inside)
|
if (state == ModelInstancePVS_Inside)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user