ENH: add new arrangement features for wrapping detection area

Jira: STUDIO-13735

Change-Id: I198d19f5e6ef70f0adfa6370269290c81d21a557
(cherry picked from commit dc83637652526111611d0833d5f5798aaa3e7be7)
This commit is contained in:
shan.chang
2025-08-04 21:44:39 +08:00
committed by Noisyfox
parent 942d023a1e
commit bd066e7f96
11 changed files with 127 additions and 31 deletions

View File

@@ -247,8 +247,11 @@ void ArrangeJob::prepare_all() {
prepare_wipe_tower();
const DynamicPrintConfig& current_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
bool enable_wrapping = current_config.option<ConfigOptionBool>("enable_wrapping_detection")->value;
// add the virtual object into unselect list if has
plate_list.preprocess_exclude_areas(m_unselected, MAX_NUM_PLATES);
plate_list.preprocess_exclude_areas(m_unselected, enable_wrapping, MAX_NUM_PLATES);
}
arrangement::ArrangePolygon estimate_wipe_tower_info(int plate_index, std::set<int>& extruder_ids)
@@ -421,8 +424,11 @@ void ArrangeJob::prepare_partplate() {
m_unselected.emplace_back(std::move(ap));
}
const DynamicPrintConfig &current_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
bool enable_wrapping = current_config.option<ConfigOptionBool>("enable_wrapping_detection")->value;
// add the virtual object into unselect list if has
plate_list.preprocess_exclude_areas(m_unselected, current_plate_index + 1);
plate_list.preprocess_exclude_areas(m_unselected, enable_wrapping, current_plate_index + 1);
}
//BBS: add partplate logic
@@ -534,7 +540,8 @@ void ArrangeJob::process(Ctl &ctl)
Points bedpts = get_shrink_bedpts(m_plater->config(),params);
partplate_list.preprocess_exclude_areas(params.excluded_regions, 1, scale_(1));
bool enable_wrapping = global_config.option<ConfigOptionBool>("enable_wrapping_detection")->value;
partplate_list.preprocess_exclude_areas(params.excluded_regions, enable_wrapping, 1, scale_(1));
BOOST_LOG_TRIVIAL(debug) << "arrange bedpts:" << bedpts[0].transpose() << ", " << bedpts[1].transpose() << ", " << bedpts[2].transpose() << ", " << bedpts[3].transpose();

View File

@@ -119,10 +119,11 @@ void FillBedJob::prepare()
if (m_selected.empty()) return;
bool enable_wrapping = global_config.option<ConfigOptionBool>("enable_wrapping_detection")->value;
//add the virtual object into unselect list if has
double scaled_exclusion_gap = scale_(1);
plate_list.preprocess_exclude_areas(params.excluded_regions, 1, scaled_exclusion_gap);
plate_list.preprocess_exclude_areas(m_unselected);
plate_list.preprocess_exclude_areas(params.excluded_regions, enable_wrapping, 1, scaled_exclusion_gap);
plate_list.preprocess_exclude_areas(m_unselected, enable_wrapping);
m_bedpts = get_bed_shape(*m_plater->config());
@@ -213,7 +214,7 @@ void FillBedJob::process(Ctl &ctl)
const bool is_bbl = wxGetApp().preset_bundle->is_bbl_vendor();
if (is_bbl && params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer"))
partplate_list.preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES);
update_selected_items_inflation(m_selected, m_plater->config(), params);
update_unselected_items_inflation(m_unselected, m_plater->config(), params);