Skip to content

Commit

Permalink
🐛 The direction of screw axes should align with their glide
Browse files Browse the repository at this point in the history
  • Loading branch information
Baharis committed Jan 22, 2025
1 parent 3d003ab commit ea7c587
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion hikari/symmetry/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ def orientation(self) -> Union[np.ndarray, None]:
return None
if o is None:
return o
o = o if sum(o) > 0 else -o
o = o if sum(o) >= 0 else -o
if self.typ is self.Type.rotoinversion: # same direction as glide
o = o if np.dot(o, self.glide) > 0 else -o
return o / np.sqrt(sum(o*o))

@property
Expand Down
2 changes: 1 addition & 1 deletion tests/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_sense(self):
self.assertEqual(self.sg40_a.sense, '')
self.assertEqual(self.sg40_21.sense, '')
self.assertEqual(self.sg40_n.sense, '')
self.assertEqual(self.sg147_m3.sense, '+')
self.assertEqual(self.sg147_m3.sense, '-')

def test_at(self):
self.assertEqual(self.sg40_a.at(p111).code, 'x+1/2,-y+2,z')
Expand Down

0 comments on commit ea7c587

Please sign in to comment.