From 1cfb6deb72b4d25af7166998607d4979b22854cb Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Thu, 25 Jan 2024 10:59:42 +0800 Subject: [PATCH] FIX: the position is incorrect when adding stl part github: 980 Change-Id: I7274dc67ddeb646770281e7a13b322eab7d756bb --- src/slic3r/GUI/GUI_ObjectList.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 746000cf0..c8e9aa68b 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2043,10 +2043,6 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo ModelVolume* new_volume = model_object.add_volume(std::move(mesh), type); new_volume->name = boost::filesystem::path(input_file).filename().string(); - // BBS: object_mesh.get_init_shift() keep the relative position - TriangleMesh object_mesh = model_object.volumes[0]->mesh(); - new_volume->set_offset(new_volume->mesh().get_init_shift() - object_mesh.get_init_shift()); - // set a default extruder value, since user can't add it manually // BBS int extruder_id = 0; @@ -2069,6 +2065,8 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo const Vec3d offset = Vec3d(instance_bb.max.x(), instance_bb.min.y(), instance_bb.min.z()) + 0.5 * mesh_bb.size() - instance_offset; new_volume->set_offset(inv_inst_transform * offset); } + else + new_volume->set_offset(new_volume->source.mesh_offset - model_object.volumes.front()->source.mesh_offset); added_volumes.push_back(new_volume); }