1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
8
Include="Base/Rotation.h"
9
FatherInclude="Base/PyObjectBase.h"
15
FatherNamespace="Base">
17
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
18
<DeveloperDocu>This is the Rotation export class</DeveloperDocu>
19
<UserDocu>Base.Rotation class.
21
A Rotation using a quaternion.
23
The following constructors are supported:
33
Define from an axis and an angle (in radians or degrees according to the keyword).
38
Rotation(vector_start, vector_end)
39
Define from two vectors (rotation from/to vector).
40
vector_start : Base.Vector
41
vector_end : Base.Vector
43
Rotation(angle1, angle2, angle3)
44
Define from three floats (Euler angles) as yaw-pitch-roll in XY'Z'' convention.
49
Rotation(seq, angle1, angle2, angle3)
50
Define from one string and three floats (Euler angles) as Euler rotation
51
of a given type. Call toEulerAngles() for supported sequence types.
58
Define from four floats (quaternion) where the quaternion is specified as:
59
q = xi+yj+zk+w, i.e. the last parameter is the real part.
65
Rotation(dir1, dir2, dir3, seq)
66
Define from three vectors that define rotated axes directions plus an optional
67
3-characher string of capital letters 'X', 'Y', 'Z' that sets the order of
68
importance of the axes (e.g., 'ZXY' means z direction is followed strictly,
69
x is used but corrected if necessary, y is ignored).
76
Define from a matrix rotation in the 4D representation.
80
Define from 16 or 9 elements which represent the rotation in the 4D matrix
81
representation or in the 3D matrix representation, respectively.
82
coef : sequence of float</UserDocu>
84
<Methode Name="invert">
86
<UserDocu>invert() -> None
88
Sets the rotation to its inverse.</UserDocu>
91
<Methode Name="inverted">
93
<UserDocu>inverted() -> Base.Rotation
95
Returns the inverse of the rotation.</UserDocu>
98
<Methode Name="isSame">
100
<UserDocu>isSame(rotation, tol=0) -> bool
102
Checks if `rotation` perform the same transformation as this rotation.
104
rotation : Base.Rotation
106
Tolerance used to compare both rotations.
107
If tol is negative or zero, no tolerance is used.</UserDocu>
110
<Methode Name="multiply" Const="true">
112
<UserDocu>multiply(rotation) -> Base.Rotation
114
Right multiply this rotation with another rotation.
116
rotation : Base.Rotation
117
Rotation by which to multiply this rotation.</UserDocu>
120
<Methode Name="multVec" Const="true">
122
<UserDocu>multVec(vector) -> Base.Vector
124
Compute the transformed vector using the rotation.
127
Vector to be transformed.</UserDocu>
130
<Methode Name="slerp" Const="true">
132
<UserDocu>slerp(rotation2, t) -> Base.Rotation
134
Spherical Linear Interpolation (SLERP) of this rotation and `rotation2`.
137
Parameter of the path. t=0 returns this rotation, t=1 returns `rotation2`.</UserDocu>
140
<Methode Name="setYawPitchRoll">
142
<UserDocu>setYawPitchRoll(angle1, angle2, angle3) -> None
144
Set the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.
147
Angle around yaw axis in degrees.
149
Angle around pitch axis in degrees.
151
Angle around roll axis in degrees.</UserDocu>
154
<Methode Name="getYawPitchRoll" Const="true">
156
<UserDocu>getYawPitchRoll() -> tuple
158
Get the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.
159
The angles are given in degrees.</UserDocu>
162
<Methode Name="setEulerAngles">
164
<UserDocu>setEulerAngles(seq, angle1, angle2, angle3) -> None
166
Set the Euler angles in a given sequence for this rotation.
167
The angles must be given in degrees.
170
Euler sequence name. All possible values given by toEulerAngles().
173
angle3 : float </UserDocu>
176
<Methode Name="toEulerAngles" Const="true">
178
<UserDocu>toEulerAngles(seq) -> list
180
Get the Euler angles in a given sequence for this rotation.
183
Euler sequence name. If not given, the function returns
184
all possible values of `seq`. Optional.</UserDocu>
187
<Methode Name="toMatrix" Const="true">
189
<UserDocu>toMatrix() -> Base.Matrix
191
Convert the rotation to a 4D matrix representation.</UserDocu>
194
<Methode Name="isNull" Const="true">
196
<UserDocu>isNull() -> bool
198
Returns True if all values in the quaternion representation are zero.</UserDocu>
201
<Methode Name="isIdentity" Const="true">
203
<UserDocu>isIdentity(tol=0) -> bool
205
Returns True if the rotation equals the 4D identity matrix.
207
Tolerance used to check for identity.
208
If tol is negative or zero, no tolerance is used.</UserDocu>
211
<Attribute Name="Q" ReadOnly="false">
213
<UserDocu>The rotation elements (as quaternion).</UserDocu>
215
<Parameter Name="Q" Type="Tuple" />
217
<Attribute Name="Axis" ReadOnly="false">
219
<UserDocu>The rotation axis of the quaternion.</UserDocu>
221
<Parameter Name="Axis" Type="Object" />
223
<Attribute Name="RawAxis" ReadOnly="true">
225
<UserDocu>The rotation axis without normalization.</UserDocu>
227
<Parameter Name="RawAxis" Type="Object" />
229
<Attribute Name="Angle" ReadOnly="false">
231
<UserDocu>The rotation angle of the quaternion.</UserDocu>
233
<Parameter Name="Angle" Type="Float" />
237
RotationPy(const Rotation & mat, PyTypeObject *T = &Type)
238
:PyObjectBase(new Rotation(mat),T){}
239
Rotation value() const
240
{ return *(getRotationPtr()); }