FIX: prompt when opening 3mf

Change-Id: I645bb675ea060ca3827a597b13a86cd56425735f
(cherry picked from commit 743d0bf1757a886784a41cc35c4f13381d27699d)
This commit is contained in:
zhimin.zeng 2022-09-21 09:43:06 +08:00 committed by Lane.Wei
parent 46a0e67be7
commit 87718e6725

View file

@ -565,8 +565,13 @@ bool Model::looks_like_multipart_object() const
for (const ModelObject *obj : this->objects) {
if (obj->volumes.size() > 1 || obj->config.keys().size() > 1)
return false;
Vec3d instance_offset_matrix = obj->instances[0]->m_transformation.get_offset();
for (const ModelVolume *vol : obj->volumes) {
double zmin_this = vol->mesh().bounding_box().min(2);
Vec3d volume_offset_matrix = vol->m_transformation.get_offset();
BoundingBoxf3 bounding_box = vol->mesh().bounding_box();
bounding_box.translate(instance_offset_matrix);
bounding_box.translate(volume_offset_matrix);
double zmin_this = bounding_box.min(2);
if (zmin == std::numeric_limits<double>::max())
zmin = zmin_this;
else if (std::abs(zmin - zmin_this) > EPSILON)