From bd066e7f96b65074d255525caa829a322407764c Mon Sep 17 00:00:00 2001 From: "shan.chang" Date: Mon, 4 Aug 2025 21:44:39 +0800 Subject: [PATCH] ENH: add new arrangement features for wrapping detection area Jira: STUDIO-13735 Change-Id: I198d19f5e6ef70f0adfa6370269290c81d21a557 (cherry picked from commit dc83637652526111611d0833d5f5798aaa3e7be7) --- src/OrcaSlicer.cpp | 14 ++++--- src/libslic3r/GCode/GCodeProcessor.cpp | 6 +++ src/libslic3r/GCode/GCodeProcessor.hpp | 2 + src/slic3r/GUI/GCodeViewer.cpp | 6 ++- src/slic3r/GUI/Jobs/ArrangeJob.cpp | 13 +++++-- src/slic3r/GUI/Jobs/FillBedJob.cpp | 7 ++-- src/slic3r/GUI/MainFrame.cpp | 2 +- src/slic3r/GUI/PartPlate.cpp | 52 ++++++++++++++++++++++---- src/slic3r/GUI/PartPlate.hpp | 13 ++++++- src/slic3r/GUI/Plater.cpp | 33 ++++++++++++---- src/slic3r/GUI/Plater.hpp | 10 ++++- 11 files changed, 127 insertions(+), 31 deletions(-) diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp index 494660aeb7..de021bb7f6 100644 --- a/src/OrcaSlicer.cpp +++ b/src/OrcaSlicer.cpp @@ -3431,6 +3431,7 @@ int CLI::run(int argc, char **argv) //use Pointfs insteadof Points Pointfs current_printable_area = m_print_config.opt("printable_area")->values; Pointfs current_exclude_area = m_print_config.opt("bed_exclude_area")->values; + Pointfs current_wrapping_exclude_area = m_print_config.opt("wrapping_exclude_area", true)->values; std::vector current_extruder_areas; //update part plate's size double print_height = m_print_config.opt_float("printable_height"); @@ -3497,7 +3498,8 @@ int CLI::run(int argc, char **argv) else { partplate_list.reset_size(old_printable_width, old_printable_depth, old_printable_height, false); } - partplate_list.set_shapes(make_counter_clockwise(current_printable_area), current_exclude_area, current_extruder_areas, current_extruder_print_heights, bed_texture, height_to_lid, height_to_rod); + partplate_list.set_shapes(make_counter_clockwise(current_printable_area), current_exclude_area, current_wrapping_exclude_area, current_extruder_areas, current_extruder_print_heights, bed_texture, + height_to_lid, height_to_rod); //plate_stride = partplate_list.plate_stride_x(); } @@ -4426,7 +4428,7 @@ int CLI::run(int argc, char **argv) } // add the virtual object into unselect list if has - partplate_list.preprocess_exclude_areas(unselected, i + 1); + partplate_list.preprocess_exclude_areas(unselected, enable_wrapping_detect, i + 1); if (avoid_extrusion_cali_region) partplate_list.preprocess_nonprefered_areas(unselected, i + 1); @@ -4454,7 +4456,7 @@ int CLI::run(int argc, char **argv) beds = get_shrink_bedpts(&m_print_config, arrange_cfg); - partplate_list.preprocess_exclude_areas(arrange_cfg.excluded_regions, 1, scale_(1)); + partplate_list.preprocess_exclude_areas(arrange_cfg.excluded_regions, enable_wrapping_detect, 1, scale_(1)); { BOOST_LOG_TRIVIAL(debug) << "arrange bedpts:" << beds[0].transpose() << ", " << beds[1].transpose() << ", " << beds[2].transpose() << ", " << beds[3].transpose(); @@ -4663,7 +4665,7 @@ int CLI::run(int argc, char **argv) } //add the virtual object into unselect list if has - partplate_list.preprocess_exclude_areas(unselected); + partplate_list.preprocess_exclude_areas(unselected, enable_wrapping_detect); if (used_filament_set.size() > 0) { @@ -4877,7 +4879,7 @@ int CLI::run(int argc, char **argv) } // add the virtual object into unselect list if has - partplate_list.preprocess_exclude_areas(unselected, plate_to_slice); + partplate_list.preprocess_exclude_areas(unselected, enable_wrapping_detect, plate_to_slice); } @@ -4905,7 +4907,7 @@ int CLI::run(int argc, char **argv) beds=get_shrink_bedpts(&m_print_config, arrange_cfg); - partplate_list.preprocess_exclude_areas(arrange_cfg.excluded_regions, 1, scale_(1)); + partplate_list.preprocess_exclude_areas(arrange_cfg.excluded_regions, enable_wrapping_detect, 1, scale_(1)); { BOOST_LOG_TRIVIAL(debug) << "arrange bedpts:" << beds[0].transpose() << ", " << beds[1].transpose() << ", " << beds[2].transpose() << ", " << beds[3].transpose(); diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 7c4610a78c..026eca25bf 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -1440,6 +1440,7 @@ void GCodeProcessorResult::reset() { printable_area = Pointfs(); //BBS: add bed exclude area bed_exclude_area = Pointfs(); + wrapping_exclude_area = Pointfs(); //BBS: add toolpath_outside toolpath_outside = false; //BBS: add label_object_enabled @@ -1468,6 +1469,7 @@ void GCodeProcessorResult::reset() { printable_area = Pointfs(); //BBS: add bed exclude area bed_exclude_area = Pointfs(); + wrapping_exclude_area = Pointfs(); //BBS: add toolpath_outside toolpath_outside = false; //BBS: add label_object_enabled @@ -1990,6 +1992,10 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config) if (bed_exclude_area != nullptr) m_result.bed_exclude_area = bed_exclude_area->values; + const ConfigOptionPoints* wrapping_exclude_area = config.option("wrapping_exclude_area"); + if (wrapping_exclude_area != nullptr) + m_result.wrapping_exclude_area = wrapping_exclude_area->values; + const ConfigOptionString* print_settings_id = config.option("print_settings_id"); if (print_settings_id != nullptr) m_result.settings_ids.print = print_settings_id->value; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 195c0c6872..fa99f09a17 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -227,6 +227,7 @@ class Print; Pointfs printable_area; //BBS: add bed exclude area Pointfs bed_exclude_area; + Pointfs wrapping_exclude_area; std::vector extruder_areas; std::vector extruder_heights; //BBS: add toolpath_outside @@ -277,6 +278,7 @@ class Print; lines_ends = other.lines_ends; printable_area = other.printable_area; bed_exclude_area = other.bed_exclude_area; + wrapping_exclude_area = other.wrapping_exclude_area; toolpath_outside = other.toolpath_outside; label_object_enabled = other.label_object_enabled; long_retraction_when_cut = other.long_retraction_when_cut; diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 32b058204e..80f8c54b2b 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1021,6 +1021,7 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr Pointfs printable_area; //BBS: add bed exclude area Pointfs bed_exclude_area = Pointfs(); + Pointfs wrapping_exclude_area = Pointfs(); std::vector extruder_areas; std::vector extruder_heights; std::string texture; @@ -1042,12 +1043,15 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr if (!gcode_result.bed_exclude_area.empty()) bed_exclude_area = gcode_result.bed_exclude_area; + if (!gcode_result.wrapping_exclude_area.empty()) + wrapping_exclude_area = gcode_result.wrapping_exclude_area; + if (!gcode_result.extruder_areas.empty()) extruder_areas = gcode_result.extruder_areas; if (!gcode_result.extruder_heights.empty()) extruder_heights = gcode_result.extruder_heights; - wxGetApp().plater()->set_bed_shape(printable_area, bed_exclude_area, gcode_result.printable_height, extruder_areas, extruder_heights, texture, model, gcode_result.printable_area.empty()); + wxGetApp().plater()->set_bed_shape(printable_area, bed_exclude_area, wrapping_exclude_area, gcode_result.printable_height, extruder_areas, extruder_heights, texture, model, gcode_result.printable_area.empty()); } /*else { // adjust printbed size in dependence of toolpaths bbox diff --git a/src/slic3r/GUI/Jobs/ArrangeJob.cpp b/src/slic3r/GUI/Jobs/ArrangeJob.cpp index cff4ebb785..2e43f0271e 100644 --- a/src/slic3r/GUI/Jobs/ArrangeJob.cpp +++ b/src/slic3r/GUI/Jobs/ArrangeJob.cpp @@ -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("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& extruder_ids) @@ -421,8 +424,11 @@ void ArrangeJob::prepare_partplate() { m_unselected.emplace_back(std::move(ap)); } + const DynamicPrintConfig ¤t_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; + bool enable_wrapping = current_config.option("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("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(); diff --git a/src/slic3r/GUI/Jobs/FillBedJob.cpp b/src/slic3r/GUI/Jobs/FillBedJob.cpp index b4aa69c4e9..91d6126a41 100644 --- a/src/slic3r/GUI/Jobs/FillBedJob.cpp +++ b/src/slic3r/GUI/Jobs/FillBedJob.cpp @@ -119,10 +119,11 @@ void FillBedJob::prepare() if (m_selected.empty()) return; + bool enable_wrapping = global_config.option("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); diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index becb290162..b26e5fb5d1 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -871,7 +871,7 @@ void MainFrame::update_layout() { m_main_sizer->Add(m_plater, 1, wxEXPAND); //BBS: add bed exclude area - m_plater->set_bed_shape({ { 0.0, 0.0 }, { 200.0, 0.0 }, { 200.0, 200.0 }, { 0.0, 200.0 } }, {}, 0.0, {}, {}, {}, {}, true); + m_plater->set_bed_shape({{0.0, 0.0}, {200.0, 0.0}, {200.0, 200.0}, {0.0, 200.0}}, {}, {}, 0.0, {}, {}, {}, {}, true); m_plater->get_collapse_toolbar().set_enabled(false); m_plater->enable_sidebar(false); m_plater->Show(); diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 79049b2325..6d5ea87273 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -3982,7 +3982,7 @@ void PartPlateList::reset_size(int width, int depth, int height, bool reload_obj m_plate_height = height; update_all_plates_pos_and_size(false, false, true); if (update_shapes) { - set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); + set_shapes(m_shape, m_exclude_areas, m_wrapping_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); } if (reload_objects) reload_all_objects(); @@ -4084,7 +4084,7 @@ void PartPlateList::reinit() void PartPlateList::update_plates() { update_all_plates_pos_and_size(true, false); - set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); + set_shapes(m_shape, m_exclude_areas, m_wrapping_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); } int PartPlateList::create_plate(bool adjust_position) @@ -4125,7 +4125,7 @@ int PartPlateList::create_plate(bool adjust_position) BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":old_cols %1% -> new_cols %2%") % old_cols % cols; //update the origin of each plate update_all_plates_pos_and_size(adjust_position, false); - set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); + set_shapes(m_shape, m_exclude_areas, m_wrapping_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); if (m_plater) { Vec2d pos = compute_shape_position(m_current_plate, cols); @@ -4319,7 +4319,7 @@ int PartPlateList::delete_plate(int index) { //update the origin of each plate update_all_plates_pos_and_size(); - set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); + set_shapes(m_shape, m_exclude_areas, m_wrapping_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); } else { @@ -5134,10 +5134,40 @@ bool PartPlateList::preprocess_arrange_polygon_other_locked(int obj_index, int i return locked; } -bool PartPlateList::preprocess_exclude_areas(arrangement::ArrangePolygons& unselected, int num_plates, float inflation) +bool PartPlateList::preprocess_exclude_areas(arrangement::ArrangePolygons &unselected, bool enable_wrapping_detect, int num_plates, float inflation) { bool added = false; + // wrapping detection area + if (enable_wrapping_detect) + { + if (!m_wrapping_exclude_areas.empty()) + { + Polygon ap{}; + for (const Vec2d &p : m_wrapping_exclude_areas) + { + ap.append({scale_(p(0)), scale_(p(1))}); + } + + for(int j = 0; j < num_plates; j++) + { + arrangement::ArrangePolygon ret; + ret.poly.contour = ap; + ret.translation = Vec2crd(0, 0); + ret.rotation = 0.0f; + ret.is_virt_object = true; + ret.bed_idx = j; + ret.height = 1; + ret.name = "WrappingRegion"; + ret.inflation = inflation; + + unselected.emplace_back(std::move(ret)); + } + } + added = true; + } + + // excluded area if (m_exclude_areas.size() > 0) { //has exclude areas @@ -5442,11 +5472,19 @@ void PartPlateList::select_plate_view() m_plater->get_camera().select_view("topfront"); } -bool PartPlateList::set_shapes(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector& extruder_areas, const std::vector& extruder_heights, const std::string& texture_filename, float height_to_lid, float height_to_rod) +bool PartPlateList::set_shapes(const Pointfs &shape, + const Pointfs &exclude_areas, + const Pointfs &wrapping_exclude_areas, + const std::vector &extruder_areas, + const std::vector &extruder_heights, + const std::string &texture_filename, + float height_to_lid, + float height_to_rod) { const std::lock_guard local_lock(m_plates_mutex); m_shape = shape; m_exclude_areas = exclude_areas; + m_wrapping_exclude_areas = wrapping_exclude_areas; m_extruder_areas = extruder_areas; m_extruder_heights = extruder_heights; m_height_to_lid = height_to_lid; @@ -5642,7 +5680,7 @@ int PartPlateList::rebuild_plates_after_deserialize(std::vector& previous_ } update_plate_cols(); update_all_plates_pos_and_size(false, false, false, false); - set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); + set_shapes(m_shape, m_exclude_areas, m_wrapping_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i) { bool need_reset_print = false; diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index 027bafd19f..298186ff25 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -579,6 +579,7 @@ class PartPlateList : public ObjectBase PartPlate unprintable_plate; Pointfs m_shape; Pointfs m_exclude_areas; + Pointfs m_wrapping_exclude_areas; std::vector m_extruder_areas; std::vector m_extruder_heights; BoundingBoxf3 m_bounding_box; @@ -755,6 +756,7 @@ public: Vec3d get_current_plate_origin() { return compute_origin(m_current_plate, m_plate_cols); } Vec2d get_current_shape_position() { return compute_shape_position(m_current_plate, m_plate_cols); } Pointfs get_exclude_area() { return m_exclude_areas; } + Pointfs get_wrapping_exclude_area() const { return m_wrapping_exclude_areas; } std::set get_extruders(bool conside_custom_gcode = false) const; @@ -816,7 +818,7 @@ public: //preprocess an arrangement::ArrangePolygon, return true if it is in a locked plate bool preprocess_arrange_polygon(int obj_index, int instance_index, arrangement::ArrangePolygon& arrange_polygon, bool selected); bool preprocess_arrange_polygon_other_locked(int obj_index, int instance_index, arrangement::ArrangePolygon& arrange_polygon, bool selected); - bool preprocess_exclude_areas(arrangement::ArrangePolygons& unselected, int num_plates = 16, float inflation = 0); + bool preprocess_exclude_areas(arrangement::ArrangePolygons& unselected, bool enable_wrapping_detect, int num_plates = 16, float inflation = 0); bool preprocess_nonprefered_areas(arrangement::ArrangePolygons& regions, int num_plates = 1, float inflation=0); void postprocess_bed_index_for_selected(arrangement::ArrangePolygon& arrange_polygon); @@ -841,7 +843,14 @@ public: int select_plate_by_obj(int obj_index, int instance_index); void calc_bounding_boxes(); void select_plate_view(); - bool set_shapes(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector& extruder_areas, const std::vector& extruder_heights, const std::string& custom_texture, float height_to_lid, float height_to_rod); + bool set_shapes(const Pointfs &shape, + const Pointfs &exclude_areas, + const Pointfs &wrapping_exclude_areas, + const std::vector &extruder_areas, + const std::vector &extruder_heights, + const std::string &custom_texture, + float height_to_lid, + float height_to_rod); void set_hover_id(int id); void reset_hover_id(); bool intersects(const BoundingBoxf3 &bb); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index f37224483a..e267908535 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -4175,7 +4175,15 @@ struct Plater::priv // fills the m_bed.m_grid_lines and sets m_bed.m_origin. // Sets m_bed.m_polygon to limit the object placement. //BBS: add bed exclude area - void set_bed_shape(const Pointfs& shape, const Pointfs& exclude_areas, const double printable_height, std::vector extruder_areas, std::vector extruder_heights, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom = false); + void set_bed_shape(const Pointfs &shape, + const Pointfs &exclude_areas, + const Pointfs &wrapping_exclude_areas, + const double printable_height, + std::vector extruder_areas, + std::vector extruder_heights, + const std::string &custom_texture, + const std::string &custom_model, + bool force_as_custom = false); bool can_delete() const; bool can_delete_all() const; @@ -4334,7 +4342,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) , main_frame(main_frame) //BBS: add bed_exclude_area , config(Slic3r::DynamicPrintConfig::new_from_defaults_keys({ - "printable_area", "bed_exclude_area", "extruder_printable_area", "bed_custom_texture", "bed_custom_model", "print_sequence", + "printable_area", "bed_exclude_area", "wrapping_exclude_area", "extruder_printable_area", "bed_custom_texture", "bed_custom_model", "print_sequence", "extruder_clearance_radius", "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", "nozzle_height", "skirt_type", "skirt_loops", "skirt_speed","min_skirt_length", "skirt_distance", "skirt_start_angle", @@ -10215,7 +10223,15 @@ bool Plater::priv::show_publish_dlg(bool show) } //BBS: add bed exclude area -void Plater::priv::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_areas, const double printable_height, std::vector extruder_areas, std::vector extruder_heights, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom) +void Plater::priv::set_bed_shape(const Pointfs &shape, + const Pointfs &exclude_areas, + const Pointfs &wrapping_exclude_areas, + const double printable_height, + std::vector extruder_areas, + std::vector extruder_heights, + const std::string &custom_texture, + const std::string &custom_model, + bool force_as_custom) { //Orca: reduce resolution for large bed printer BoundingBoxf bed_size = get_extents(shape); @@ -10234,7 +10250,9 @@ void Plater::priv::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_ar double height_to_rod = config->opt_float("extruder_clearance_height_to_rod"); Pointfs prev_exclude_areas = partplate_list.get_exclude_area(); - new_shape |= (height_to_lid != prev_height_lid) || (height_to_rod != prev_height_rod) || (prev_exclude_areas != exclude_areas); + Pointfs prev_wrapping_exclude_areas = partplate_list.get_wrapping_exclude_area(); + new_shape |= (height_to_lid != prev_height_lid) || (height_to_rod != prev_height_rod) || (prev_exclude_areas != exclude_areas) + || (prev_wrapping_exclude_areas != wrapping_exclude_areas); if (!new_shape && partplate_list.get_logo_texture_filename() != custom_texture) { partplate_list.update_logo_texture_filename(custom_texture); } @@ -10250,7 +10268,7 @@ void Plater::priv::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_ar //Pointfs& exclude_areas = config->option("bed_exclude_area")->values; partplate_list.reset_size(max.x() - min.x() - Bed3D::Axes::DefaultTipRadius, max.y() - min.y() - Bed3D::Axes::DefaultTipRadius, z); - partplate_list.set_shapes(shape, exclude_areas, extruder_areas, extruder_heights, custom_texture, height_to_lid, height_to_rod); + partplate_list.set_shapes(shape, exclude_areas, wrapping_exclude_areas, extruder_areas, extruder_heights, custom_texture, height_to_lid, height_to_rod); Vec2d new_shape_position = partplate_list.get_current_shape_position(); if (shape_position != new_shape_position) @@ -15490,6 +15508,7 @@ void Plater::set_bed_shape() const set_bed_shape(p->config->option("printable_area")->values, //BBS: add bed exclude areas p->config->option("bed_exclude_area")->values, + p->config->option("wrapping_exclude_area")->values, p->config->option("printable_height")->value, p->config->option("extruder_printable_area")->values, p->config->option("extruder_printable_height")->values, @@ -15498,9 +15517,9 @@ void Plater::set_bed_shape() const } //BBS: add bed exclude area -void Plater::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_area, const double printable_height, std::vector extruder_areas, std::vector extruder_heights, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom) const +void Plater::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_area, const Pointfs& wrapping_exclude_area, const double printable_height, std::vector extruder_areas, std::vector extruder_heights, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom) const { - p->set_bed_shape(make_counter_clockwise(shape), exclude_area, printable_height, extruder_areas, extruder_heights, custom_texture, custom_model, force_as_custom); + p->set_bed_shape(make_counter_clockwise(shape), exclude_area, wrapping_exclude_area, printable_height, extruder_areas, extruder_heights, custom_texture, custom_model, force_as_custom); } void Plater::force_filament_colors_update() diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 25feae3687..9b44830e74 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -755,7 +755,15 @@ public: void update_flush_volume_matrix(size_t old_nozzle_size, size_t new_nozzle_size); //BBS: add bed exclude area void set_bed_shape() const; - void set_bed_shape(const Pointfs& shape, const Pointfs& exclude_area, const double printable_height, std::vector extruder_areas, std::vector extruder_heights, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom = false) const; + void set_bed_shape(const Pointfs &shape, + const Pointfs &exclude_area, + const Pointfs &wrapping_exclude_area, + const double printable_height, + std::vector extruder_areas, + std::vector extruder_heights, + const std::string &custom_texture, + const std::string &custom_model, + bool force_as_custom = false) const; const NotificationManager* get_notification_manager() const; NotificationManager* get_notification_manager();