Skip to content

Commit

Permalink
Fixed some edge-cases with new angle calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Oct 9, 2023
1 parent c562a43 commit 00b7121
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions include/PathOrderOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -689,16 +689,12 @@ class PathOrderOptimizer
{
default:
case EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER:
if (corner_angle < 0) // Indeed a concave corner? Give it some advantage over other corners. More advantage for sharper corners.
{
score += corner_angle * corner_shift;
}
// Give advantage to concave corners. More advantage for sharper corners.
score += corner_angle * corner_shift;
break;
case EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_OUTER:
if (corner_angle > 0) // Indeed a convex corner?
{
score -= corner_angle * corner_shift;
}
// Give advantage to convex corners. More advantage for sharper corners.
score -= corner_angle * corner_shift;
break;
case EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_ANY:
score -= std::abs(corner_angle) * corner_shift; // Still give sharper corners more advantage.
Expand All @@ -717,7 +713,7 @@ class PathOrderOptimizer
}
}

constexpr float EPSILON = 25.0;
constexpr float EPSILON = 5.0;
if (std::abs(best_score - score) <= EPSILON)
{
// add breaker for two candidate starting location with similar score
Expand Down

0 comments on commit 00b7121

Please sign in to comment.