FIX: modify the behavior of wipe tower

The prime tower is not allowed to extend beyond the plate boundary when moving it.
jira: STUDIO-11817 & STUDIO-12313

Change-Id: Icbb85dad26531b0ac01f088fc086b4ff499ac423
(cherry picked from commit 8f4d5f44d721fa9cae70cd9b47735c93151f2b81)
This commit is contained in:
zhimin.zeng
2025-05-23 11:18:24 +08:00
committed by Noisyfox
parent 517b6c09a8
commit 3fd9b7ef8a
3 changed files with 25 additions and 49 deletions

View File

@@ -1194,7 +1194,10 @@ void Selection::translate(const Vec3d &displacement, TransformationType transfor
Vec3d tower_size = v.bounding_box().size();
Vec3d tower_origin = m_cache.volumes_data[i].get_volume_position();
Vec3d actual_displacement = displacement;
const double margin = wxGetApp().plater()->get_partplate_list().get_plate(plate_idx)->fff_print()->is_step_done(psWipeTower)?2.:WIPE_TOWER_MARGIN;
bool show_read_wipe_tower = wxGetApp().plater()->get_partplate_list().get_plate(plate_idx)->fff_print()->is_step_done(psWipeTower);
float brim_width = wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("prime_tower_brim_width");
const double margin = show_read_wipe_tower ? WIPE_TOWER_MARGIN : brim_width + 0.5; // 0.5 is the line width of wipe tower
actual_displacement = (m_cache.volumes_data[i].get_instance_rotation_matrix() * m_cache.volumes_data[i].get_instance_scale_matrix() *
m_cache.volumes_data[i].get_instance_mirror_matrix())