diff --git a/python/chemiscope/structures/_shapes.py b/python/chemiscope/structures/_shapes.py index b52346ac6..a6bb21c09 100644 --- a/python/chemiscope/structures/_shapes.py +++ b/python/chemiscope/structures/_shapes.py @@ -95,6 +95,7 @@ def arrow_from_vector( ) return arrow + def ellipsoid_from_tensor(tensor, scale=1.0, force_positive=False): """ Returns an ellipsoid (semiaxes + quaternion) representation of @@ -144,9 +145,10 @@ def ellipsoid_from_tensor(tensor, scale=1.0, force_positive=False): # Form the rotation matrix from eigenvectors rotation = eigenvectors.T - + # converts to quaternion from scipy.spatial.transform import Rotation + quaternion = Rotation.from_matrix(rotation).as_quat() return dict(