mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-06 22:47:32 -06:00
parent
e9eb6f9d95
commit
0dd356a3a7
1 changed files with 39 additions and 32 deletions
|
@ -831,8 +831,8 @@ void PartPlate::render_exclude_area(bool force_default_color) {
|
||||||
if (force_default_color) //for thumbnail case
|
if (force_default_color) //for thumbnail case
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ColorRGBA select_color{ 0.765f, 0.7686f, 0.7686f, 1.0f };
|
ColorRGBA select_color{ .9f, .86f, .82f, .7f }; // ORCA
|
||||||
ColorRGBA unselect_color{ 0.9f, 0.9f, 0.9f, 1.0f };
|
ColorRGBA unselect_color{ .6f, .6f, .6f, .3f }; // ORCA
|
||||||
//ColorRGBA default_color{ 0.9f, 0.9f, 0.9f, 1.0f };
|
//ColorRGBA default_color{ 0.9f, 0.9f, 0.9f, 1.0f };
|
||||||
|
|
||||||
// draw exclude area
|
// draw exclude area
|
||||||
|
@ -2548,37 +2548,44 @@ void PartPlate::generate_exclude_polygon(ExPolygon &exclude_polygon)
|
||||||
int points_count = 8;
|
int points_count = 8;
|
||||||
if (m_exclude_area.size() == 4)
|
if (m_exclude_area.size() == 4)
|
||||||
{
|
{
|
||||||
//rectangle case
|
//rectangle case
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
const Vec2d& p = m_exclude_area[i];
|
const Vec2d& p = m_exclude_area[i];
|
||||||
Vec2d center;
|
Vec2d center;
|
||||||
double start_angle, stop_angle, radius;
|
double start_angle, stop_angle, radius;
|
||||||
switch (i) {
|
radius = 1.f; // ORCA use equal rounding for all corners
|
||||||
case 0:
|
switch (i) {
|
||||||
radius = 5.f;
|
case 0: // Left-Bottom
|
||||||
center(0) = p(0) + radius;
|
center(0) = p(0) + radius;
|
||||||
center(1) = p(1) + radius;
|
center(1) = p(1) + radius;
|
||||||
start_angle = PI;
|
start_angle = 1.0 * PI; //180
|
||||||
stop_angle = 1.5 * PI;
|
stop_angle = 1.5 * PI; //270
|
||||||
compute_exclude_points(center, radius, start_angle, stop_angle, points_count);
|
compute_exclude_points(center, radius, start_angle, stop_angle, points_count);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1: // Right-Bottom
|
||||||
exclude_polygon.contour.append({ scale_(p(0)), scale_(p(1)) });
|
center(0) = p(0) - radius;
|
||||||
break;
|
center(1) = p(1) + radius;
|
||||||
case 2:
|
start_angle = 1.5 * PI; //270
|
||||||
radius = 3.f;
|
stop_angle = 2.0 * PI; //360
|
||||||
center(0) = p(0) - radius;
|
compute_exclude_points(center, radius, start_angle, stop_angle, points_count);
|
||||||
center(1) = p(1) - radius;
|
break;
|
||||||
start_angle = 0;
|
case 2: // Right-Top
|
||||||
stop_angle = 0.5 * PI;
|
center(0) = p(0) - radius;
|
||||||
compute_exclude_points(center, radius, start_angle, stop_angle, points_count);
|
center(1) = p(1) - radius;
|
||||||
break;
|
start_angle = 0.0 * PI; //0
|
||||||
case 3:
|
stop_angle = 0.5 * PI; //90
|
||||||
exclude_polygon.contour.append({ scale_(p(0)), scale_(p(1)) });
|
compute_exclude_points(center, radius, start_angle, stop_angle, points_count);
|
||||||
break;
|
break;
|
||||||
}
|
case 3: // Left-Top
|
||||||
|
center(0) = p(0) + radius;
|
||||||
|
center(1) = p(1) - radius;
|
||||||
|
start_angle = 0.5 * PI; //90
|
||||||
|
stop_angle = 1.0 * PI; //180
|
||||||
|
compute_exclude_points(center, radius, start_angle, stop_angle, points_count);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (const Vec2d& p : m_exclude_area) {
|
for (const Vec2d& p : m_exclude_area) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue