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
This commit is contained in:
yw4z 2025-04-20 13:20:25 +03:00 committed by GitHub
parent c456d38b5c
commit 2349ea063d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 35 deletions

View file

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="180.622mm" height="180.622mm" viewBox="0 0 511.999 511.999"><rect width="512" height="512" style="fill:none"/><rect x="350.289" y="441.257" width="52.463" height="52.463" rx="6.278" style="fill:#e9e9e9"/><path d="M361.634,482.534a16.145,16.145,0,0,0,11.38,4.746A16.349,16.349,0,0,0,384.6,459.44Z" style="fill:#292826"/><path d="M384.6,459.44l-22.967,23.094.05.048a180.781,180.781,0,0,0,26.622-17.326,16.335,16.335,0,0,0-3.7-5.816" style="fill:#009789"/><path d="M380.111,447.7a16.349,16.349,0,0,0-11.52,27.841l22.967-23.094a16.142,16.142,0,0,0-11.447-4.747" style="fill:#292826"/><path d="M380.111,447.7a16.1,16.1,0,0,0-8.477,2.4,18.633,18.633,0,0,0-4.844-.611,18.937,18.937,0,0,0-7.769,1.741.519.519,0,0,0,.106.977,11.075,11.075,0,0,1,6.614,4.211,16.446,16.446,0,0,0-1.181,12.332,16.293,16.293,0,0,1,1.639-2.858c1.491-2.05,3.068-3.116,5.4-4.692,1.716-1.161,4.1-2.523,10.951-5.338a23.354,23.354,0,0,0,5.017-2.313c1.145-.681,2.017-1.324,2.293-2.329.019-.071.037-.141.053-.21a16.111,16.111,0,0,0-9.8-3.309" style="fill:#262523"/><path d="M382.824,453.185c.6,1.053-.6,2.865-2.663,4.047s-4.225,1.286-4.821.232.6-2.865,2.663-4.047,4.225-1.286,4.821-.232" style="fill:#fff"/><path d="M443.7,472.8a1.209,1.209,0,0,0-1.207,1.207v12.064a1.207,1.207,0,0,0,2.413,0V474.01a1.207,1.207,0,0,0-1.2-1.21Z" style="fill:#e9e9e9"/><path d="M475.35,472.8h-2.883a7.239,7.239,0,0,0,0,14.477h2.883a1.207,1.207,0,0,0,0-2.413h-2.883a4.826,4.826,0,0,1-.139-9.651c.046,0,.093,0,.139,0h2.883a1.207,1.207,0,0,0,0-2.413Z" style="fill:#e9e9e9"/><path d="M475.35,478.835h-3.507a1.207,1.207,0,0,0-.07,2.413c.024,0,.047,0,.07,0h3.507a1.207,1.207,0,0,0,0-2.413Z" style="fill:#e9e9e9"/><path d="M419.593,487.28h-5.844a1.2,1.2,0,0,1,0-2.4h5.844a1.82,1.82,0,0,0,0-3.64h-2.824a4.219,4.219,0,0,1-.014-8.438h4.791a1.2,1.2,0,0,1,0,2.4h-4.777a1.82,1.82,0,0,0,0,3.64h2.824a4.219,4.219,0,0,1,0,8.438Z" style="fill:#e9e9e9"/><path d="M459.072,484.07a4.826,4.826,0,1,1,0-8.06,1.209,1.209,0,0,0,1.526-.144h0a1.2,1.2,0,0,0,.015-1.7,1.243,1.243,0,0,0-.176-.148,7.238,7.238,0,1,0-.046,12.072,1.215,1.215,0,0,0,.208-1.875h0A1.206,1.206,0,0,0,459.072,484.07Z" style="fill:#e9e9e9"/><path d="M437.006,484.867h-3.487a3.019,3.019,0,0,1-3.016-3.016v-7.842a1.207,1.207,0,0,0-2.413,0v7.842a5.435,5.435,0,0,0,5.429,5.429h3.487a1.207,1.207,0,0,0,0-2.413Z" style="fill:#e9e9e9"/><path d="M489.278,475.216h-1.207A4.829,4.829,0,0,0,483.248,480v6.074a1.207,1.207,0,0,1-2.413,0V480a7.246,7.246,0,0,1,7.236-7.2h1.207a1.207,1.207,0,0,1,0,2.413Z" style="fill:#e9e9e9"/><path d="M422.248,450.681a6.713,6.713,0,1,1-6.713,6.713,6.713,6.713,0,0,1,6.713-6.713m0-2.985a9.7,9.7,0,1,0,9.7,9.7,9.7,9.7,0,0,0-9.7-9.7Z" style="fill:#009789"/><path d="M488.992,447.7a1.492,1.492,0,0,0-1.493,1.491h0v1.217a9.7,9.7,0,1,0,0,13.977V465.6a1.493,1.493,0,0,0,2.985,0V449.188A1.492,1.492,0,0,0,488.992,447.7Zm-8.206,16.411A6.713,6.713,0,1,1,487.5,457.4a6.714,6.714,0,0,1-6.713,6.713Z" style="fill:#009789"/><path d="M447.412,447.7H445.92a9.7,9.7,0,0,0-9.7,9.7h0v8.2a1.493,1.493,0,0,0,2.985,0v-8.2a6.72,6.72,0,0,1,6.713-6.713h1.492a1.493,1.493,0,0,0,.078-2.985h-.078Z" style="fill:#009789"/><path d="M465.293,462.929a6.713,6.713,0,1,1-.022-11.086,1.512,1.512,0,0,0,1.931-.153h0a1.5,1.5,0,0,0-.008-2.121,1.462,1.462,0,0,0-.229-.187,9.7,9.7,0,1,0,.019,16.01,1.5,1.5,0,0,0,.4-2.084,1.544,1.544,0,0,0-.179-.216h0A1.493,1.493,0,0,0,465.293,462.929Z" style="fill:#009789"/><path d="M511.153,502.649a8.5,8.5,0,0,1-8.5,8.5H492.582V512H512V492.582h-.847Z" style="fill:#009789"/><path d="M9.351,511.153a8.5,8.5,0,0,1-8.5-8.5V492.582H0V512H19.418v-.847Z" style="fill:#009789"/><path d="M.847,9.351a8.5,8.5,0,0,1,8.5-8.5H19.418V0H0V19.418H.847Z" style="fill:#009789"/><path d="M502.649.847a8.5,8.5,0,0,1,8.5,8.5V19.418H512V0H492.582V.847Z" style="fill:#009789"/></svg>
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="180.62mm" height="180.62mm" viewBox="0 0 512 512"><rect x="0" y="0" width="512" height="512" style="fill:none;"/><rect x="185.9" y="441.26" width="52.46" height="52.46" rx="6.28" ry="6.28" style="fill:#e9e9e9;"/><path d="M197.25,482.53c3.02,3.03,7.11,4.73,11.38,4.75,9.03-.02,16.33-7.36,16.31-16.39-.01-4.29-1.71-8.4-4.72-11.45l-22.97,23.09Z" style="fill:#292826;"/><path d="M220.21,459.44l-22.97,23.09.05.05c9.37-4.98,18.27-10.78,26.62-17.33-.81-2.18-2.07-4.16-3.7-5.82" style="fill:#009789;"/><path d="M215.72,447.7c-9.03.06-16.3,7.43-16.24,16.46.03,4.27,1.72,8.35,4.72,11.38l22.97-23.09c-3.03-3.04-7.15-4.75-11.45-4.75" style="fill:#292826;"/><path d="M215.72,447.7c-2.99,0-5.93.83-8.48,2.4-1.58-.42-3.21-.62-4.84-.61-2.68.02-5.33.62-7.77,1.74-.26.12-.37.43-.25.69.07.15.2.25.36.29,2.64.55,5,2.05,6.61,4.21-1.99,3.8-2.41,8.22-1.18,12.33.45-1.01,1-1.96,1.64-2.86,1.49-2.05,3.07-3.12,5.4-4.69,1.72-1.16,4.1-2.52,10.95-5.34,1.76-.57,3.44-1.35,5.02-2.31,1.14-.68,2.02-1.32,2.29-2.33.02-.07.04-.14.05-.21-2.81-2.15-6.26-3.31-9.8-3.31" style="fill:#262523;"/><path d="M218.44,453.18c.6,1.05-.6,2.86-2.66,4.05s-4.23,1.29-4.82.23.6-2.86,2.66-4.05,4.23-1.29,4.82-.23" style="fill:#fff;"/><path d="M279.31,472.8c-.67,0-1.21.54-1.21,1.21v12.06c.02.67.58,1.19,1.24,1.17.64-.02,1.15-.53,1.17-1.17v-12.06c0-.67-.54-1.21-1.2-1.21h0Z" style="fill:#e9e9e9;"/><path d="M310.96,472.8h-2.88c-4,.05-7.2,3.33-7.15,7.32.05,3.93,3.22,7.11,7.15,7.15h2.88c.67-.02,1.19-.58,1.17-1.24-.02-.64-.53-1.15-1.17-1.17h-2.88c-2.67.04-4.86-2.09-4.89-4.76-.04-2.67,2.09-4.86,4.76-4.89.05,0,.09,0,.14,0h2.88c.67-.02,1.19-.58,1.17-1.24-.02-.64-.53-1.15-1.17-1.17Z" style="fill:#e9e9e9;"/><path d="M310.96,478.83h-3.51c-.67-.02-1.22.51-1.24,1.17s.51,1.22,1.17,1.24c.02,0,.05,0,.07,0h3.51c.67-.02,1.19-.58,1.17-1.24-.02-.64-.53-1.15-1.17-1.17Z" style="fill:#e9e9e9;"/><path d="M255.21,487.28h-5.84c-.66,0-1.2-.54-1.2-1.2,0-.66.54-1.2,1.2-1.2h5.84c1.01,0,1.82-.81,1.82-1.82s-.81-1.82-1.82-1.82h-2.82c-2.33,0-4.22-1.88-4.23-4.21s1.88-4.22,4.21-4.23h4.79c.66,0,1.2.54,1.2,1.2,0,.66-.54,1.2-1.2,1.2h-4.78c-1.01,0-1.82.81-1.82,1.82s.81,1.82,1.82,1.82h2.82c2.33,0,4.22,1.9,4.21,4.23,0,2.32-1.89,4.21-4.21,4.21Z" style="fill:#e9e9e9;"/><path d="M294.69,484.07c-2.23,1.47-5.22.85-6.69-1.37-1.47-2.23-.85-5.22,1.37-6.69,1.61-1.06,3.7-1.06,5.31,0,.48.32,1.12.26,1.53-.14h0c.47-.46.48-1.22.02-1.7-.05-.05-.11-.1-.18-.15-3.33-2.22-7.82-1.32-10.04,2-2.22,3.33-1.32,7.82,2,10.04,2.42,1.61,5.56,1.62,7.99.03.56-.36.73-1.11.37-1.68-.05-.07-.1-.14-.16-.2h0c-.41-.41-1.05-.47-1.53-.15Z" style="fill:#e9e9e9;"/><path d="M272.62,484.87h-3.49c-1.67,0-3.01-1.35-3.02-3.02v-7.84c-.02-.67-.58-1.19-1.24-1.17-.64.02-1.15.53-1.17,1.17v7.84c0,3,2.43,5.43,5.43,5.43h3.49c.67-.02,1.19-.58,1.17-1.24-.02-.64-.53-1.15-1.17-1.17Z" style="fill:#e9e9e9;"/><path d="M324.89,475.22h-1.21c-2.65,0-4.8,2.14-4.82,4.78v6.07c-.02.67-.58,1.19-1.24,1.17-.64-.02-1.15-.53-1.17-1.17v-6.07c.03-3.98,3.26-7.19,7.24-7.2h1.21c.67.02,1.19.58,1.17,1.24-.02.64-.53,1.15-1.17,1.17h0Z" style="fill:#e9e9e9;"/><path d="M257.86,450.68c3.71,0,6.71,3.01,6.71,6.71s-3.01,6.71-6.71,6.71-6.71-3.01-6.71-6.71c0-3.71,3.01-6.71,6.71-6.71M257.86,447.7c-5.36,0-9.7,4.34-9.7,9.7s4.34,9.7,9.7,9.7,9.7-4.34,9.7-9.7-4.34-9.7-9.7-9.7h0Z" style="fill:#009789;"/><path d="M324.61,447.7c-.82,0-1.49.67-1.49,1.49h0v1.22c-3.86-3.72-10-3.6-13.72.26-3.72,3.86-3.6,10,.26,13.72,3.76,3.62,9.7,3.62,13.45,0v1.21c.02.82.71,1.48,1.53,1.45.79-.02,1.43-.66,1.45-1.45v-16.41c0-.82-.67-1.49-1.49-1.49ZM316.4,464.11c-3.71,0-6.71-3.01-6.71-6.71s3.01-6.71,6.71-6.71,6.71,3.01,6.71,6.71c0,3.7-3.01,6.7-6.71,6.71h0Z" style="fill:#009789;"/><path d="M283.03,447.7h-1.49c-5.36,0-9.7,4.34-9.7,9.7h0v8.2c.02.82.71,1.48,1.53,1.45.79-.02,1.43-.66,1.45-1.45v-8.2c0-3.71,3.01-6.71,6.71-6.71h1.49c.82.02,1.51-.63,1.53-1.45.02-.82-.63-1.51-1.45-1.53-.03,0-.05,0-.08,0h0Z" style="fill:#009789;"/><path d="M300.91,462.93c-3.06,2.1-7.24,1.32-9.33-1.74-2.1-3.06-1.32-7.24,1.74-9.33,2.28-1.56,5.29-1.57,7.57-.02.6.42,1.41.36,1.93-.15h0c.58-.59.58-1.54,0-2.12-.07-.07-.15-.13-.23-.19-4.42-3.02-10.46-1.88-13.48,2.54-3.02,4.42-1.88,10.46,2.54,13.48,3.31,2.26,7.66,2.25,10.96-.01.68-.47.86-1.4.4-2.08-.05-.08-.11-.15-.18-.22h0c-.51-.51-1.32-.58-1.91-.16Z" style="fill:#009789;"/><path d="M511.15,502.65c0,4.7-3.81,8.5-8.5,8.5h-10.07v.85h19.42v-19.42h-.85v10.07Z" style="fill:#009789;"/><path d="M9.35,511.15c-4.7,0-8.5-3.81-8.5-8.5v-10.07h-.85v19.42h19.42v-.85h-10.07Z" style="fill:#009789;"/><path d="M.85,9.35C.85,4.65,4.65.85,9.35.85h10.07V0H0v19.42h.85v-10.07Z" style="fill:#009789;"/><path d="M502.65.85c4.7,0,8.5,3.81,8.5,8.5v10.07h.85V0h-19.42v.85h10.07Z" style="fill:#009789;"/></svg>

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Before After
Before After

View file

@ -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<Vec2d> 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<Vec2d> new_bed_shape; // offset to correct origin
for (auto point : origin_bed_shape) {

View file

@ -476,35 +476,8 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox
step = static_cast<int>(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)