diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 5ea4939e3..9f01bd7f5 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3272,7 +3272,7 @@ void PrintConfigDef::init_fff_params() //def->sidetext = L("mm"); def->mode = comDevelop; // BBS: change data type to floats to add partplate logic - def->set_default_value(new ConfigOptionFloats{ 165.-10. }); + def->set_default_value(new ConfigOptionFloats{ 15. }); def = this->add("wipe_tower_y", coFloats); //def->label = L("Position Y"); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 235cb161c..ab8c1f278 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2636,15 +2636,32 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re BoundingBoxf3 plate_bbox = wxGetApp().plater()->get_partplate_list().get_plate(plate_id)->get_bounding_box(); coordf_t plate_bbox_x_max_local_coord = plate_bbox.max(0) - plate_origin(0); coordf_t plate_bbox_y_max_local_coord = plate_bbox.max(1) - plate_origin(1); + bool need_update = false; if (x + margin + wipe_tower_size(0) > plate_bbox_x_max_local_coord) { x = plate_bbox_x_max_local_coord - wipe_tower_size(0) - margin; + need_update = true; + } + else if (x < plate_origin(0) + margin) { + x = plate_origin(0) + margin; + need_update = true; + } + if (need_update) { ConfigOptionFloat wt_x_opt(x); dynamic_cast(proj_cfg.option("wipe_tower_x"))->set_at(&wt_x_opt, plate_id, 0); + need_update = false; } + if (y + margin + wipe_tower_size(1) > plate_bbox_y_max_local_coord) { y = plate_bbox_y_max_local_coord - wipe_tower_size(1) - margin; + need_update = true; + } + else if (y < plate_origin(1) + margin) { + y = plate_origin(1) + margin; + need_update = true; + } + if (need_update) { ConfigOptionFloat wt_y_opt(y); - dynamic_cast(proj_cfg.option("wipe_tower_y"))->set_at(&wt_y_opt, plate_id, 0); + dynamic_cast(proj_cfg.option("wipe_tower_y"))->set_at(&wt_y_opt, plate_id, 0); } int volume_idx_wipe_tower_new = m_volumes.load_wipe_tower_preview(