making all four corners of the grid sharp instead of round (#6993)

# 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.
This commit is contained in:
SoftFever 2024-10-07 16:37:56 +08:00 committed by GitHub
commit 7422c7957f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)