From 947edbc7eb1f7de44185637a5bad8912c9b8b54e Mon Sep 17 00:00:00 2001 From: QIDI TECH <893239786@qq.com> Date: Wed, 3 Sep 2025 09:38:32 +0800 Subject: [PATCH] fix some bug --- src/libslic3r/BuildVolume.cpp | 44 +++++++++++++++++------------------ src/slic3r/GUI/Plater.cpp | 14 +++++++++-- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/src/libslic3r/BuildVolume.cpp b/src/libslic3r/BuildVolume.cpp index 0915de1..0ca3aea 100644 --- a/src/libslic3r/BuildVolume.cpp +++ b/src/libslic3r/BuildVolume.cpp @@ -394,18 +394,18 @@ BuildVolume::ObjectState BuildVolume::check_outside(Polygon hull) const { const Vec3d bed_offset = s_multiple_beds.get_bed_translation(i); if (m_exclude_bed_shape.size() > 0) { - for (int i = 1; i < m_exclude_bed_shape.size(); i += 7) { - std::vector tem_exclude_bed_shap; - for (int j = 1; j < 6; j++) - tem_exclude_bed_shap.push_back(Vec2d{ m_exclude_bed_shape[i + j].x() + bed_offset.x(), m_exclude_bed_shape[i + j].y() + bed_offset.y() }); - BoundingBoxf tem_bboxf = get_extents(tem_exclude_bed_shap); - auto tem_exclude_bboxf = BoundingBoxf3{ to_3d(tem_bboxf.min, 0.), to_3d(tem_bboxf.max, m_max_print_height) }; - Slic3r::Polygon p = tem_exclude_bboxf.polygon(true); // instance convex hull is scaled, so we need to scale here - if (intersection({ p }, { hull }).empty() == false) { - return ObjectState::Colliding; - break; - } + //y29 + std::vector tem_exclude_bed_shap; + for (int i = 0; i < m_exclude_bed_shape.size(); i++) + tem_exclude_bed_shap.push_back(Vec2d{ m_exclude_bed_shape[i].x() + bed_offset.x(), m_exclude_bed_shape[i].y() + bed_offset.y() }); + BoundingBoxf tem_bboxf = get_extents(tem_exclude_bed_shap); + auto tem_exclude_bboxf = BoundingBoxf3{ to_3d(tem_bboxf.min, 0.), to_3d(tem_bboxf.max, m_max_print_height) }; + Slic3r::Polygon p = tem_exclude_bboxf.polygon(true); // instance convex hull is scaled, so we need to scale here + if (intersection({ p }, { hull }).empty() == false) { + return ObjectState::Colliding; + break; } + //y29 } else { return ObjectState::Inside; @@ -441,18 +441,18 @@ bool BuildVolume::all_paths_inside(const GCodeProcessorResult& paths, const Boun if ((build_volume.contains(paths_bbox))) { if (m_exclude_bed_shape.size() > 0) { Slic3r::Polygon convex_hull_2d = Slic3r::Geometry::convex_hull(std::move(pts)); - for (int i = 1; i < m_exclude_bed_shape.size(); i += 7) { - std::vector tem_exclude_bed_shap; - for (int j = 1; j < 6; j++) - tem_exclude_bed_shap.push_back(m_exclude_bed_shape[i + j]); - BoundingBoxf tem_bboxf = get_extents(tem_exclude_bed_shap); - auto tem_exclude_bboxf = BoundingBoxf3{to_3d(tem_bboxf.min, 0.), to_3d(tem_bboxf.max, m_max_print_height)}; - Slic3r::Polygon p = tem_exclude_bboxf.polygon(true); // instance convex hull is scaled, so we need to scale here - if (intersection({p}, {convex_hull_2d}).empty() == false) { - return false; - break; - } + //y29 + std::vector tem_exclude_bed_shap; + for (int i = 0; i < m_exclude_bed_shape.size(); i++) + tem_exclude_bed_shap.push_back(m_exclude_bed_shape[i]); + BoundingBoxf tem_bboxf = get_extents(tem_exclude_bed_shap); + auto tem_exclude_bboxf = BoundingBoxf3{ to_3d(tem_bboxf.min, 0.), to_3d(tem_bboxf.max, m_max_print_height) }; + Slic3r::Polygon p = tem_exclude_bboxf.polygon(true); // instance convex hull is scaled, so we need to scale here + if (intersection({p}, {convex_hull_2d}).empty() == false) { + return false; + break; } + //y29 } } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index cbeaf15..48d4a63 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -7042,12 +7042,11 @@ void Plater::export_gcode_3mf(bool prefer_removable, bool all_gcodes) if (!is_sliceable(s_print_statuses[s_multiple_beds.get_active_bed()])) return; - fs::path default_output_file; AppConfig& appconfig = *wxGetApp().app_config; wxString path = p->get_export_file(FT_GCODE_3MF); if (path.empty()) { return; } - fs::path output_path(path); + fs::path output_path(path.ToStdString()); bool is_success_ful = export_gcode_3mf(output_path, all_gcodes); if (is_success_ful) { @@ -7692,6 +7691,17 @@ void Plater::send_gcode() //m_time_p = upload_job.create_time + seconds_to_add; + //y29 + GUI::Box_info cur_box_info; + cur_box_info = get_cur_box_info(); + wxString enable_commond; + if(cur_box_info.box_count != 0) + enable_commond = "SAVE_VARIABLE VARIABLE=enable_box VALUE=1"; + else + enable_commond = "SAVE_VARIABLE VARIABLE=enable_box VALUE=0"; + + bool enable_box = upload_job.printhost->send_command_to_printer(enable_commond, enable_commond); + //y25 if (!activate_slot.empty() && upload_job.upload_data.post_action == PrintHostPostUploadAction::StartPrint) { for (int i = 0; i < activate_slot.size(); i++) {