fix some bug

This commit is contained in:
QIDI TECH
2025-09-03 11:27:59 +08:00
parent 947edbc7eb
commit 988f419802
2 changed files with 24 additions and 24 deletions

View File

@@ -7463,7 +7463,7 @@ inherits = *common*
printer_model = Q2 printer_model = Q2
autoemit_temperature_commands = 0 autoemit_temperature_commands = 0
auxiliary_fan = 1 auxiliary_fan = 1
bed_exclude_area = 0x0,0x16,11x16,11x0,0x0 bed_exclude_area = 0x0,0x0,0x0,0x16,11x16,11x0,0x0,0x0
bed_shape = 0x0,270x0,270x270,0x270 bed_shape = 0x0,270x0,270x270,0x270
before_layer_gcode = TIMELAPSE_TAKE_FRAME before_layer_gcode = TIMELAPSE_TAKE_FRAME
box_temperature_control = 1 box_temperature_control = 1
@@ -7524,7 +7524,7 @@ inherits = *common*
printer_model = X-Plus 4 printer_model = X-Plus 4
autoemit_temperature_commands = 0 autoemit_temperature_commands = 0
auxiliary_fan = 1 auxiliary_fan = 1
bed_exclude_area = 0x0,0x0,0x302,0x305,35x302,35x302,0x302,0x0,0x0,293x0,293x20,305x20,305x0,293x0,0x0 bed_exclude_area = 0x0,0x0,0x302,0x305,35x305,35x302,0x302,0x0,0x0,293x0,293x20,305x20,305x0,293x0,0x0
bed_shape = 0x0,305x0,305x305,0x305 bed_shape = 0x0,305x0,305x305,0x305
before_layer_gcode = TIMELAPSE_TAKE_FRAME before_layer_gcode = TIMELAPSE_TAKE_FRAME
box_temperature_control = 1 box_temperature_control = 1

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); const Vec3d bed_offset = s_multiple_beds.get_bed_translation(i);
if (m_exclude_bed_shape.size() > 0) { if (m_exclude_bed_shape.size() > 0) {
//y29 for (int i = 1; i < m_exclude_bed_shape.size(); i += 7) {
std::vector<Vec2d> tem_exclude_bed_shap; std::vector<Vec2d> tem_exclude_bed_shap;
for (int i = 0; i < m_exclude_bed_shape.size(); i++) for (int j = 1; j < 6; j++)
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() }); 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); 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) }; 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 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) { if (intersection({ p }, { hull }).empty() == false) {
return ObjectState::Colliding; return ObjectState::Colliding;
break; break;
}
} }
//y29
} }
else { else {
return ObjectState::Inside; return ObjectState::Inside;
@@ -441,18 +441,18 @@ bool BuildVolume::all_paths_inside(const GCodeProcessorResult& paths, const Boun
if ((build_volume.contains(paths_bbox))) { if ((build_volume.contains(paths_bbox))) {
if (m_exclude_bed_shape.size() > 0) { if (m_exclude_bed_shape.size() > 0) {
Slic3r::Polygon convex_hull_2d = Slic3r::Geometry::convex_hull(std::move(pts)); Slic3r::Polygon convex_hull_2d = Slic3r::Geometry::convex_hull(std::move(pts));
//y29 for (int i = 1; i < m_exclude_bed_shape.size(); i += 7) {
std::vector<Vec2d> tem_exclude_bed_shap; std::vector<Vec2d> tem_exclude_bed_shap;
for (int i = 0; i < m_exclude_bed_shape.size(); i++) for (int j = 1; j < 6; j++)
tem_exclude_bed_shap.push_back(m_exclude_bed_shape[i]); tem_exclude_bed_shap.push_back(m_exclude_bed_shape[i + j]);
BoundingBoxf tem_bboxf = get_extents(tem_exclude_bed_shap); 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) }; 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 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) { if (intersection({p}, {convex_hull_2d}).empty() == false) {
return false; return false;
break; break;
}
} }
//y29
} }
} }