Skip to content

Commit 2995041

Browse files
committed
FIX remove re-assignying new_xDirection and fix projection to use tthe best candidate and not vectors[1]]
1 parent 1fad289 commit 2995041

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gh/diffCheck/diffCheck/df_poses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def select_vectors(vectors, previous_xDirection, previous_yDirection):
145145
new_yDirection = sorted_vectors_by_perpendicularity[0] - compute_dot_product(sorted_vectors_by_perpendicularity[0], new_xDirection) * new_xDirection
146146
new_yDirection.Unitize()
147147
else:
148-
new_xDirection = vectors[0]
148+
149149
sorted_vectors = sorted(vectors[1:], key=lambda v: compute_dot_product(v, new_xDirection)**2)
150-
new_yDirection = sorted_vectors[0] - compute_dot_product(vectors[1], new_xDirection) * new_xDirection
150+
new_yDirection = sorted_vectors[0] - compute_dot_product(sorted_vectors[0], new_xDirection) * new_xDirection
151151
new_yDirection.Unitize()
152152
return new_xDirection, new_yDirection

0 commit comments

Comments
 (0)