mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
Take brim width into consideration when placing wipe tower
This commit is contained in:
parent
27f140fb18
commit
554366d493
3 changed files with 18 additions and 11 deletions
|
@ -3839,6 +3839,9 @@ int CLI::run(int argc, char **argv)
|
|||
int plate_count = partplate_list.get_plate_count();
|
||||
|
||||
auto printer_structure_opt = m_print_config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure");
|
||||
const float tower_brim_width = m_print_config.option<ConfigOptionFloat>("prime_tower_width", true)->value;
|
||||
const float tower_margin = WIPE_TOWER_MARGIN + tower_brim_width;
|
||||
|
||||
// set the default position, the same with print config(left top)
|
||||
float x = WIPE_TOWER_DEFAULT_X_POS;
|
||||
float y = WIPE_TOWER_DEFAULT_Y_POS;
|
||||
|
@ -3846,11 +3849,11 @@ int CLI::run(int argc, char **argv)
|
|||
x = I3_WIPE_TOWER_DEFAULT_X_POS;
|
||||
y = I3_WIPE_TOWER_DEFAULT_Y_POS;
|
||||
}
|
||||
if (x < WIPE_TOWER_MARGIN) {
|
||||
x = WIPE_TOWER_MARGIN;
|
||||
if (x < tower_margin) {
|
||||
x = tower_margin;
|
||||
}
|
||||
if (y < WIPE_TOWER_MARGIN) {
|
||||
y = WIPE_TOWER_MARGIN;
|
||||
if (y < tower_margin) {
|
||||
y = tower_margin;
|
||||
}
|
||||
|
||||
ConfigOptionFloat wt_x_opt(x);
|
||||
|
@ -4091,6 +4094,8 @@ int CLI::run(int argc, char **argv)
|
|||
int extruder_size = used_filament_set.size();
|
||||
|
||||
auto printer_structure_opt = m_print_config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure");
|
||||
const float tower_brim_width = m_print_config.option<ConfigOptionFloat>("prime_tower_width", true)->value;
|
||||
const float tower_margin = WIPE_TOWER_MARGIN + tower_brim_width;
|
||||
// set the default position, the same with print config(left top)
|
||||
float x = WIPE_TOWER_DEFAULT_X_POS;
|
||||
float y = WIPE_TOWER_DEFAULT_Y_POS;
|
||||
|
@ -4099,11 +4104,11 @@ int CLI::run(int argc, char **argv)
|
|||
y = I3_WIPE_TOWER_DEFAULT_Y_POS;
|
||||
}
|
||||
|
||||
if (x < WIPE_TOWER_MARGIN) {
|
||||
x = WIPE_TOWER_MARGIN;
|
||||
if (x < tower_margin) {
|
||||
x = tower_margin;
|
||||
}
|
||||
if (y < WIPE_TOWER_MARGIN) {
|
||||
y = WIPE_TOWER_MARGIN;
|
||||
if (y < tower_margin) {
|
||||
y = tower_margin;
|
||||
}
|
||||
ConfigOptionFloat wt_x_opt(x);
|
||||
ConfigOptionFloat wt_y_opt(y);
|
||||
|
|
|
@ -2692,6 +2692,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
|||
float y = dynamic_cast<const ConfigOptionFloats*>(proj_cfg.option("wipe_tower_y"))->get_at(plate_id);
|
||||
float w = dynamic_cast<const ConfigOptionFloat*>(m_config->option("prime_tower_width"))->value;
|
||||
float a = dynamic_cast<const ConfigOptionFloat*>(proj_cfg.option("wipe_tower_rotation_angle"))->value;
|
||||
float tower_brim_width = dynamic_cast<const ConfigOptionFloat*>(m_config->option("prime_tower_brim_width"))->value;
|
||||
// BBS
|
||||
// float v = dynamic_cast<const ConfigOptionFloat*>(m_config->option("prime_volume"))->value;
|
||||
Vec3d plate_origin = ppl.get_plate(plate_id)->get_origin();
|
||||
|
@ -2702,7 +2703,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
|||
const DynamicPrintConfig &print_cfg = wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
Vec3d wipe_tower_size = ppl.get_plate(plate_id)->estimate_wipe_tower_size(print_cfg, w, wipe_tower_data.depth);
|
||||
|
||||
const float margin = WIPE_TOWER_MARGIN;
|
||||
const float margin = WIPE_TOWER_MARGIN + tower_brim_width;
|
||||
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);
|
||||
|
|
|
@ -1674,10 +1674,11 @@ arrangement::ArrangePolygon PartPlate::estimate_wipe_tower_polygon(const Dynamic
|
|||
float w = dynamic_cast<const ConfigOptionFloat*>(config.option("prime_tower_width"))->value;
|
||||
//float a = dynamic_cast<const ConfigOptionFloat*>(config.option("wipe_tower_rotation_angle"))->value;
|
||||
float v = dynamic_cast<const ConfigOptionFloat*>(config.option("prime_volume"))->value;
|
||||
Vec3d wipe_tower_size = estimate_wipe_tower_size(config, w, v, plate_extruder_size, use_global_objects);
|
||||
float tower_brim_width = dynamic_cast<const ConfigOptionFloat*>(config.option("prime_tower_brim_width"))->value;
|
||||
Vec3d wipe_tower_size = estimate_wipe_tower_size(config, w, v, plate_extruder_size, use_global_objects);
|
||||
int plate_width=m_width, plate_depth=m_depth;
|
||||
float depth = wipe_tower_size(1);
|
||||
float margin = WIPE_TOWER_MARGIN, wp_brim_width = 0.f;
|
||||
float margin = WIPE_TOWER_MARGIN + tower_brim_width, wp_brim_width = 0.f;
|
||||
const ConfigOption* wipe_tower_brim_width_opt = config.option("prime_tower_brim_width");
|
||||
if (wipe_tower_brim_width_opt) {
|
||||
wp_brim_width = wipe_tower_brim_width_opt->getFloat();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue