Fix exclusion area shape and color (#8792)

* Update PartPlate.cpp
This commit is contained in:
yw4z 2025-05-04 18:12:04 +03:00 committed by GitHub
parent e9eb6f9d95
commit 0dd356a3a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
@ -2554,28 +2554,35 @@ void PartPlate::generate_exclude_polygon(ExPolygon &exclude_polygon)
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;
radius = 1.f; // ORCA use equal rounding for all corners
switch (i) { switch (i) {
case 0: case 0: // Left-Bottom
radius = 5.f;
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;
center(1) = p(1) + radius;
start_angle = 1.5 * PI; //270
stop_angle = 2.0 * PI; //360
compute_exclude_points(center, radius, start_angle, stop_angle, points_count);
break; break;
case 2: case 2: // Right-Top
radius = 3.f;
center(0) = p(0) - radius; center(0) = p(0) - radius;
center(1) = p(1) - radius; center(1) = p(1) - radius;
start_angle = 0; start_angle = 0.0 * PI; //0
stop_angle = 0.5 * PI; stop_angle = 0.5 * PI; //90
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 3: case 3: // Left-Top
exclude_polygon.contour.append({ scale_(p(0)), scale_(p(1)) }); 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; break;
} }
} }