Skip to content

Commit

Permalink
Fix the cdxml structure importer (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha authored Jun 16, 2023
1 parent 40fa11d commit 038e0a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nanoribbon/viewers/cdxml2gnr.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ def construct_cell(atoms, id1, id2):
vec = [np.array(pos[0]) - np.array(pos[1]), np.array(pos[2]) - np.array(pos[1])]
c_x = np.linalg.norm(vec[0])

angle = np.math.atan2(np.linalg.det([vec[0], vec[1]]), np.dot(vec[0], vec[1]))
angle = (
np.math.atan2(np.linalg.det([vec[0], vec[1]]), np.dot(vec[0], vec[1]))
* 180.0
/ np.pi
)
if np.abs(angle) > 0.01:
atoms.euler_rotate(
center=atoms[id1].position, phi=-angle, theta=0.0, psi=0.0
Expand Down

0 comments on commit 038e0a6

Please sign in to comment.