ENH: separate objects by 1mm when duplicating

jira: none
Change-Id: Ic5ac4d7d5ac3355abbf9553909d576b0d0de1d38
(cherry picked from commit f9f7f146e377f12b7067892e7379a155c5dda252)
This commit is contained in:
Arthur 2024-01-11 11:27:05 +08:00 committed by Lane.Wei
parent 53cab43d04
commit ebec1e2eb1
1 changed files with 2 additions and 1 deletions

View File

@ -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());