From 0072e5ec37cec69780e8c25b695b2756e0b3e662 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Fri, 23 Sep 2022 10:55:56 +0800 Subject: [PATCH] FIX: prompt when opening 3mf Change-Id: Ife452f5b16bdcf3f8eb105aeb58ffccdccb9177f (cherry picked from commit c1e984d0feadef778fd09e61063ac1dacbbf9a64) --- src/libslic3r/Model.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index e834b26f5..2451cca7c 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -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::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::max()) + zmin = zmin_this; + else if (std::abs(zmin - zmin_this) > EPSILON) + // The Object don't share zmin. + return true; } return false; }