fix some bug

This commit is contained in:
QIDI TECH
2025-09-03 09:38:32 +08:00
parent 461688262b
commit 947edbc7eb
2 changed files with 34 additions and 24 deletions

View File

@@ -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<Vec2d> 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<Vec2d> 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<Vec2d> 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<Vec2d> 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
}
}

View File

@@ -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++) {