mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
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:
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user