avoid floating point comparison and simply play it safe
This commit is contained in:
parent
0497b58629
commit
890a6cf42f
|
@ -147,7 +147,6 @@ for name in filenames:
|
||||||
D[neg] *= -1. # ... flip value ...
|
D[neg] *= -1. # ... flip value ...
|
||||||
V[:,neg] *= -1. # ... and vector
|
V[:,neg] *= -1. # ... and vector
|
||||||
for i in [0,1,2]:
|
for i in [0,1,2]:
|
||||||
if np.dot(V[:,i],V[:,(i+1)%3]) != 0.0: # check each vector for orthogonality
|
|
||||||
V[:,(i+1)%3] = np.cross(V[:,(i+2)%3],V[:,i]) # correct next vector
|
V[:,(i+1)%3] = np.cross(V[:,(i+2)%3],V[:,i]) # correct next vector
|
||||||
V[:,(i+1)%3] /= np.linalg.norm(V[:,(i+1)%3]) # and renormalize (hyperphobic?)
|
V[:,(i+1)%3] /= np.linalg.norm(V[:,(i+1)%3]) # and renormalize (hyperphobic?)
|
||||||
for theStrain in strains:
|
for theStrain in strains:
|
||||||
|
|
Loading…
Reference in New Issue