summaryrefslogtreecommitdiff
path: root/lib/stitches
diff options
context:
space:
mode:
authorGeorge Steel <george.steel@gmail.com>2023-01-29 17:59:38 -0500
committerGeorge Steel <george.steel@gmail.com>2023-01-29 17:59:38 -0500
commit581ecd486999045625995db031e2dc7d55bbe907 (patch)
tree4802f9a67a1b7851b7250a8188b8d7751058006c /lib/stitches
parent68848365b7398d9ef3dfb1f1dc10a3567da5dd69 (diff)
fix comment
Diffstat (limited to 'lib/stitches')
-rw-r--r--lib/stitches/running_stitch.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/stitches/running_stitch.py b/lib/stitches/running_stitch.py
index f3ca8a29..c1c2d99c 100644
--- a/lib/stitches/running_stitch.py
+++ b/lib/stitches/running_stitch.py
@@ -227,9 +227,9 @@ def path_to_curves(points: typing.List[Point], min_len: float):
aabb = (a * a) * (b * b)
abab = (a * b) * abs(a * b)
- # Test if the turn angle from vectors a to b is more than 45 degrees
- # Uses the property of inner products that abab = ± aabb * cos(angle(a,b))**2
- if aabb > 0 and abab < 0.5 * aabb:
+ # Test if the turn angle from vectors a to b is more than 45 degrees.
+ # Optimized version of checking if cos(angle(a,b)) <= sqrt(0.5) and is defined
+ if aabb > 0 and abab <= 0.5 * aabb:
if seg_len >= min_len:
curves.append(points[last: i + 1])
last = i