From 2349ea063de77795953caf274d48579d550573be Mon Sep 17 00:00:00 2001 From: yw4z Date: Sun, 20 Apr 2025 13:20:25 +0300 Subject: [PATCH] Fix: Alignment issues for default shapes / gridlines of bed plates (#9360) * Update PartPlate.cpp * Update 3DBed.cpp * Update 3DBed.cpp * update * Update PartPlate.cpp * Update 3DBed.cpp * Update PartPlate.cpp * Update PartPlate.cpp * Update PartPlate.cpp --- .../Custom/orcaslicer_bed_texture.svg | 2 +- src/slic3r/GUI/3DBed.cpp | 4 +-- src/slic3r/GUI/PartPlate.cpp | 35 +++---------------- 3 files changed, 6 insertions(+), 35 deletions(-) diff --git a/resources/profiles/Custom/orcaslicer_bed_texture.svg b/resources/profiles/Custom/orcaslicer_bed_texture.svg index b7eddc79a2..cf5e77f9c5 100644 --- a/resources/profiles/Custom/orcaslicer_bed_texture.svg +++ b/resources/profiles/Custom/orcaslicer_bed_texture.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 67dd8d1a83..9f582c726e 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -648,11 +648,9 @@ void Bed3D::update_bed_triangles() (*model_offset_ptr)(1) = m_build_volume.bounding_volume2d().min.y() - bed_ext.min.y(); (*model_offset_ptr)(2) = -0.41 + GROUND_Z; - // ORCA fix for circular bed (without 3D model) beds rendered with shifted position - Vec2d point_shift = m_build_volume.type() == BuildVolume_Type::Circle ? Vec2d(0,0) : m_bed_shape[0]; std::vector origin_bed_shape; for (size_t i = 0; i < m_bed_shape.size(); i++) { - origin_bed_shape.push_back(m_bed_shape[i] - point_shift); + origin_bed_shape.push_back(m_bed_shape[i]); } std::vector new_bed_shape; // offset to correct origin for (auto point : origin_bed_shape) { diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 88008b7f52..3fdd70da25 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -476,35 +476,8 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox step = static_cast(grid_counts.minCoeff() + 1) * 10; } - if (0) { - for (coord_t x = pp_bbox.min(0); x <= pp_bbox.max(0); x += scale_(step)) { - Polyline line; - line.append(Point(x, pp_bbox.min(1))); - line.append(Point(x, pp_bbox.max(1))); - - if ( (count % 5) == 0 ) - axes_lines_bolder.push_back(line); - else - axes_lines.push_back(line); - count ++; - } - count = 0; - for (coord_t y = pp_bbox.min(1); y <= pp_bbox.max(1); y += scale_(step)) { - Polyline line; - line.append(Point(pp_bbox.min(0), y)); - line.append(Point(pp_bbox.max(0), y)); - axes_lines.push_back(line); - - if ( (count % 5) == 0 ) - axes_lines_bolder.push_back(line); - else - axes_lines.push_back(line); - count ++; - } - } - // ORCA draw grid lines relative to origin - for (coord_t x = m_origin.x(); x >= pp_bbox.min(0); x -= scale_(step)) { // Negative X axis + for (coord_t x = scale_(m_origin.x()); x >= pp_bbox.min(0); x -= scale_(step)) { // Negative X axis (count % 5 == 0 ? axes_lines_bolder : axes_lines).push_back(Polyline( Point(x, pp_bbox.min(1)), Point(x, pp_bbox.max(1)) @@ -512,7 +485,7 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox count ++; } count = 0; - for (coord_t x = m_origin.x(); x <= pp_bbox.max(0); x += scale_(step)) { // Positive X axis + for (coord_t x = scale_(m_origin.x()); x <= pp_bbox.max(0); x += scale_(step)) { // Positive X axis (count % 5 == 0 ? axes_lines_bolder : axes_lines).push_back(Polyline( Point(x, pp_bbox.min(1)), Point(x, pp_bbox.max(1)) @@ -520,7 +493,7 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox count ++; } count = 0; - for (coord_t y = m_origin.y(); y >= pp_bbox.min(1); y -= scale_(step)) { // Negative Y axis + for (coord_t y = scale_(m_origin.y()); y >= pp_bbox.min(1); y -= scale_(step)) { // Negative Y axis (count % 5 == 0 ? axes_lines_bolder : axes_lines).push_back(Polyline( Point(pp_bbox.min(0), y), Point(pp_bbox.max(0), y) @@ -528,7 +501,7 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox count ++; } count = 0; - for (coord_t y = m_origin.y(); y <= pp_bbox.max(1); y += scale_(step)) { // Positive Y axis + for (coord_t y = scale_(m_origin.y()); y <= pp_bbox.max(1); y += scale_(step)) { // Positive Y axis (count % 5 == 0 ? axes_lines_bolder : axes_lines).push_back(Polyline( Point(pp_bbox.min(0), y), Point(pp_bbox.max(0), y)