From ebec1e2eb18e688eed361423e7941cb21d7c816d Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 11 Jan 2024 11:27:05 +0800 Subject: [PATCH] ENH: separate objects by 1mm when duplicating jira: none Change-Id: Ic5ac4d7d5ac3355abbf9553909d576b0d0de1d38 (cherry picked from commit f9f7f146e377f12b7067892e7379a155c5dda252) --- src/slic3r/GUI/GUI_ObjectList.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index d0147587e..11bc7613a 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2254,8 +2254,9 @@ void ObjectList::load_mesh_object(const TriangleMesh &mesh, const wxString &name Slic3r::save_object_mesh(*new_object); // BBS: find an empty cell to put the copied object + // Use the new object's size as step to avoid collision (only for duplicated object) auto start_point = wxGetApp().plater()->build_volume().bounding_volume2d().center(); - auto empty_cell = wxGetApp().plater()->canvas3D()->get_nearest_empty_cell({start_point(0), start_point(1)}); + auto empty_cell = wxGetApp().plater()->canvas3D()->get_nearest_empty_cell({ start_point(0), start_point(1) }, { bb.size().x() + 1,bb.size().y() + 1 }); new_object->instances[0]->set_offset(center ? to_3d(Vec2d(empty_cell(0), empty_cell(1)), -new_object->origin_translation.z()) : bb.center());