Skip to content

Commit

Permalink
making all four corners of the grid sharp instead of round (#6993)
Browse files Browse the repository at this point in the history
# Simple visual change 

Currently, the grid has 3 round corners and 1 sharp corner. It seems
like bambu lab hard coded this specifically to fit their bed model. As a
non-bambu user, I dont like how the corners look.
![Screenshot 2024-10-02
152326](https://github.com/user-attachments/assets/ba905ed1-3557-488e-adb2-ea1ea93bb1cc)
![Screenshot 2024-10-02
152435](https://github.com/user-attachments/assets/7a2ec002-87c3-46ab-b5ff-8174c20890e3)

Another point I'd like to bring up is that rounded corners do not match
the boundary detection box.


## Tests
Tested locally on windows and macos.
  • Loading branch information
SoftFever authored Oct 7, 2024
2 parents 9fbab14 + d52e2cc commit 7422c79
Showing 1 changed file with 2 additions and 52 deletions.
54 changes: 2 additions & 52 deletions src/slic3r/GUI/PartPlate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2541,59 +2541,9 @@ void PartPlate::generate_print_polygon(ExPolygon &print_polygon)
}
};

int points_count = 8;
if (m_shape.size() == 4)
{
//rectangle case
for (int i = 0; i < 4; i++)
{
const Vec2d& p = m_shape[i];
Vec2d center;
double start_angle, stop_angle, radius_x, radius_y, radius;
switch (i) {
case 0:
radius = 5.f;
center(0) = p(0) + radius;
center(1) = p(1) + radius;
start_angle = PI;
stop_angle = 1.5 * PI;
compute_points(center, radius, start_angle, stop_angle, points_count);
break;
case 1:
print_polygon.contour.append({ scale_(p(0)), scale_(p(1)) });
break;
case 2:
radius_x = (int)(p(0)) % 10;
radius_y = (int)(p(1)) % 10;
radius = (radius_x > radius_y)?radius_y: radius_x;
if (radius < 5.0)
radius = 5.f;
center(0) = p(0) - radius;
center(1) = p(1) - radius;
start_angle = 0;
stop_angle = 0.5 * PI;
compute_points(center, radius, start_angle, stop_angle, points_count);
break;
case 3:
radius_x = (int)(p(0)) % 10;
radius_y = (int)(p(1)) % 10;
radius = (radius_x > radius_y)?radius_y: radius_x;
if (radius < 5.0)
radius = 5.f;
center(0) = p(0) + radius;
center(1) = p(1) - radius;
start_angle = 0.5 * PI;
stop_angle = PI;
compute_points(center, radius, start_angle, stop_angle, points_count);
break;
}
}
}
else {
for (const Vec2d& p : m_shape) {
print_polygon.contour.append({ scale_(p(0)), scale_(p(1)) });
for (const Vec2d& p : m_shape) {
print_polygon.contour.append({scale_(p(0)), scale_(p(1))});
}
}
}

void PartPlate::generate_exclude_polygon(ExPolygon &exclude_polygon)
Expand Down

0 comments on commit 7422c79

Please sign in to comment.