From 87718e67259023b6386949e2a8610e194b0250f6 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Wed, 21 Sep 2022 09:43:06 +0800 Subject: [PATCH] FIX: prompt when opening 3mf Change-Id: I645bb675ea060ca3827a597b13a86cd56425735f (cherry picked from commit 743d0bf1757a886784a41cc35c4f13381d27699d) --- src/libslic3r/Model.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 3d74e78975..e834b26f54 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -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::max()) zmin = zmin_this; else if (std::abs(zmin - zmin_this) > EPSILON)