mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
making all four corners of the grid sharp instead of round
This commit is contained in:
parent
17492c1e5b
commit
d52e2cc1b2
1 changed files with 2 additions and 52 deletions
|
@ -2541,58 +2541,8 @@ 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)) });
|
||||
}
|
||||
print_polygon.contour.append({scale_(p(0)), scale_(p(1))});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue