FIX: prompt when opening 3mf

Change-Id: Ife452f5b16bdcf3f8eb105aeb58ffccdccb9177f
(cherry picked from commit c1e984d0feadef778fd09e61063ac1dacbbf9a64)
This commit is contained in:
zhimin.zeng 2022-09-23 10:55:56 +08:00 committed by Lane.Wei
parent 0d25141a90
commit 0072e5ec37
1 changed files with 7 additions and 13 deletions

View File

@ -565,19 +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) {
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)
// The volumes don't share zmin.
return true;
}
double zmin_this = obj->get_min_z();
if (zmin == std::numeric_limits<double>::max())
zmin = zmin_this;
else if (std::abs(zmin - zmin_this) > EPSILON)
// The Object don't share zmin.
return true;
}
return false;
}