File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 66
77import numpy as np
88import numpy .typing as npt
9+ import scipy
910from scipy .spatial .transform import Rotation as ScipyRotation
1011
1112from ._typehints import FloatSequence , IntSequence , NumpyRngSeed
@@ -105,7 +106,11 @@ def __init__(self,
105106 self .quaternion : np .ndarray
106107
107108 if (isinstance (rotation ,ScipyRotation )):
108- self .quaternion = rotation .as_quat (canonical = True ,scalar_first = True )
109+ if np .lib .NumpyVersion (scipy .__version__ ) >= '1.14.0' :
110+ self .quaternion = rotation .as_quat (canonical = True ,scalar_first = True )
111+ else :
112+ quat = rotation .as_quat (canonical = True )
113+ self .quaternion = np .block ([quat [...,3 :4 ],quat [...,0 :3 ]])
109114 elif len (s := np .asarray (rotation ).shape ) > 0 and s [- 1 ] == 4 :
110115 self .quaternion = np .array (rotation ,dtype = float )
111116 else :
You can’t perform that action at this time.
0 commit comments