rouding should affect color calculation
avoid NaN in math.power(x,0.5). math.power(-0.0,0.5) is ok
This commit is contained in:
parent
78a2941436
commit
ecc51e34d3
|
@ -701,15 +701,15 @@ class Symmetry:
|
||||||
|
|
||||||
v = np.array(vector,dtype=float)
|
v = np.array(vector,dtype=float)
|
||||||
if proper: # check both improper ...
|
if proper: # check both improper ...
|
||||||
theComponents = np.dot(basis['improper'],v)
|
theComponents = np.around(np.dot(basis['improper'],v),12)
|
||||||
inSST = np.all(np.around(theComponents,12) >= 0.0)
|
inSST = np.all(theComponents >= 0.0)
|
||||||
if not inSST: # ... and proper SST
|
if not inSST: # ... and proper SST
|
||||||
theComponents = np.dot(basis['proper'],v)
|
theComponents = np.around(np.dot(basis['proper'],v),12)
|
||||||
inSST = np.all(np.around(theComponents,12) >= 0.0)
|
inSST = np.all(theComponents >= 0.0)
|
||||||
else:
|
else:
|
||||||
v[2] = abs(v[2]) # z component projects identical
|
v[2] = abs(v[2]) # z component projects identical
|
||||||
theComponents = np.dot(basis['improper'],v) # for positive and negative values
|
theComponents = np.around(np.dot(basis['improper'],v),12) # for positive and negative values
|
||||||
inSST = np.all(np.around(theComponents,12) >= 0.0)
|
inSST = np.all(theComponents >= 0.0)
|
||||||
|
|
||||||
if color: # have to return color array
|
if color: # have to return color array
|
||||||
if inSST:
|
if inSST:
|
||||||
|
|
Loading…
Reference in New Issue