FIX: modify the default position of wipe tower
Change-Id: I27eacb73a7e32d20416da785378d3ff0c31f5c23
This commit is contained in:
parent
9560a292f2
commit
13857dba34
|
@ -3272,7 +3272,7 @@ void PrintConfigDef::init_fff_params()
|
||||||
//def->sidetext = L("mm");
|
//def->sidetext = L("mm");
|
||||||
def->mode = comDevelop;
|
def->mode = comDevelop;
|
||||||
// BBS: change data type to floats to add partplate logic
|
// 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 = this->add("wipe_tower_y", coFloats);
|
||||||
//def->label = L("Position Y");
|
//def->label = L("Position Y");
|
||||||
|
|
|
@ -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();
|
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_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);
|
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) {
|
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;
|
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);
|
ConfigOptionFloat wt_x_opt(x);
|
||||||
dynamic_cast<ConfigOptionFloats *>(proj_cfg.option("wipe_tower_x"))->set_at(&wt_x_opt, plate_id, 0);
|
dynamic_cast<ConfigOptionFloats *>(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) {
|
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;
|
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);
|
ConfigOptionFloat wt_y_opt(y);
|
||||||
dynamic_cast<ConfigOptionFloats*>(proj_cfg.option("wipe_tower_y"))->set_at(&wt_y_opt, plate_id, 0);
|
dynamic_cast<ConfigOptionFloats *>(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(
|
int volume_idx_wipe_tower_new = m_volumes.load_wipe_tower_preview(
|
||||||
|
|
Loading…
Reference in New Issue