Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Fix preference direction of smart hiding
Browse files Browse the repository at this point in the history
It should prefer inner corners. Did this angle change sign? Weird.

Contributes to issue CURA-8192.
  • Loading branch information
Ghostkeeper committed Jun 12, 2021
1 parent 5eb532b commit aa69bb2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pathOrderOptimizer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Copyright (c) 2020 Ultimaker B.V.
//Copyright (c) 2021 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.

#include <map>
Expand Down Expand Up @@ -199,15 +199,15 @@ int PathOrderOptimizer::getClosestPointInPolygon(Point prev_point, int poly_idx)
switch (config.corner_pref)
{
case EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER:
if (corner_angle > 1)
if (corner_angle > 1) //Is an inner corner.
{
// p1 lies on a concave curve so reduce the distance to favour it
// the more concave the curve, the more we reduce the distance
dist_score -= (corner_angle - 1) * corner_shift;
}
break;
case EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_OUTER:
if (corner_angle < 1)
if (corner_angle < 1) //Is an outer corner.
{
// p1 lies on a convex curve so reduce the distance to favour it
// the more convex the curve, the more we reduce the distance
Expand All @@ -222,7 +222,7 @@ int PathOrderOptimizer::getClosestPointInPolygon(Point prev_point, int poly_idx)
{
//More curve is better score (reduced distance), but slightly in favour of concave curves.
float dist_score_corner = fabs(corner_angle - 1) * corner_shift;
if (corner_angle < 1)
if (corner_angle > 1) //Is an inner corner.
{
dist_score_corner *= 2;
}
Expand Down

0 comments on commit aa69bb2

Please sign in to comment.