FreeCAD

Форк
0
/
RotationPy.xml 
243 строки · 7.9 Кб
1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
3
    <PythonExport
4
          Father="PyObjectBase"
5
          Name="RotationPy"
6
          Twin="Rotation"
7
          TwinPointer="Rotation"
8
          Include="Base/Rotation.h"
9
          FatherInclude="Base/PyObjectBase.h"
10
          Namespace="Base"
11
          Constructor="true"
12
          Delete="true"
13
          NumberProtocol="true"
14
          RichCompare="true"
15
          FatherNamespace="Base">
16
        <Documentation>
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.
20

21
A Rotation using a quaternion.
22

23
The following constructors are supported:
24

25
Rotation()
26
Empty constructor.
27

28
Rotation(rotation)
29
Copy constructor.
30

31
Rotation(Axis, Radian)
32
Rotation(Axis, Degree)
33
Define from an axis and an angle (in radians or degrees according to the keyword).
34
Axis : Base.Vector
35
Radian : float
36
Degree : float
37

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
42

43
Rotation(angle1, angle2, angle3)
44
Define from three floats (Euler angles) as yaw-pitch-roll in XY'Z'' convention.
45
angle1 : float
46
angle2 : float
47
angle3 : float
48

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.
52
seq : str
53
angle1 : float
54
angle2 : float
55
angle3 : float
56

57
Rotation(x, y, z, w)
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.
60
x : float
61
y : float
62
z : float
63
w : float
64

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).
70
dir1 : Base.Vector
71
dir2 : Base.Vector
72
dir3 : Base.Vector
73
seq : str
74

75
Rotation(matrix)
76
Define from a matrix rotation in the 4D representation.
77
matrix : Base.Matrix
78

79
Rotation(*coef)
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>
83
        </Documentation>
84
        <Methode Name="invert">
85
            <Documentation>
86
                <UserDocu>invert() -> None
87

88
Sets the rotation to its inverse.</UserDocu>
89
            </Documentation>
90
        </Methode>
91
        <Methode Name="inverted">
92
            <Documentation>
93
                <UserDocu>inverted() -> Base.Rotation
94

95
Returns the inverse of the rotation.</UserDocu>
96
            </Documentation>
97
        </Methode>
98
        <Methode Name="isSame">
99
            <Documentation>
100
                <UserDocu>isSame(rotation, tol=0) -> bool
101

102
Checks if `rotation` perform the same transformation as this rotation.
103

104
rotation : Base.Rotation
105
tol : float
106
    Tolerance used to compare both rotations.
107
    If tol is negative or zero, no tolerance is used.</UserDocu>
108
            </Documentation>
109
        </Methode>
110
        <Methode Name="multiply" Const="true">
111
            <Documentation>
112
                <UserDocu>multiply(rotation) -> Base.Rotation
113

114
Right multiply this rotation with another rotation.
115

116
rotation : Base.Rotation
117
    Rotation by which to multiply this rotation.</UserDocu>
118
            </Documentation>
119
        </Methode>
120
                <Methode Name="multVec" Const="true">
121
            <Documentation>
122
                <UserDocu>multVec(vector) -> Base.Vector
123

124
Compute the transformed vector using the rotation.
125

126
vector : Base.Vector
127
    Vector to be transformed.</UserDocu>
128
            </Documentation>
129
        </Methode>
130
        <Methode Name="slerp" Const="true">
131
            <Documentation>
132
                <UserDocu>slerp(rotation2, t) -> Base.Rotation
133

134
Spherical Linear Interpolation (SLERP) of this rotation and `rotation2`.
135

136
t : float
137
    Parameter of the path. t=0 returns this rotation, t=1 returns `rotation2`.</UserDocu>
138
            </Documentation>
139
        </Methode>
140
        <Methode Name="setYawPitchRoll">
141
            <Documentation>
142
                <UserDocu>setYawPitchRoll(angle1, angle2, angle3) -> None
143

144
Set the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.
145

146
angle1 : float
147
    Angle around yaw axis in degrees.
148
angle2 : float
149
    Angle around pitch axis in degrees.
150
angle3 : float
151
    Angle around roll axis in degrees.</UserDocu>
152
            </Documentation>
153
        </Methode>
154
        <Methode Name="getYawPitchRoll" Const="true">
155
            <Documentation>
156
                <UserDocu>getYawPitchRoll() -> tuple
157

158
Get the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.
159
The angles are given in degrees.</UserDocu>
160
            </Documentation>
161
        </Methode>
162
        <Methode Name="setEulerAngles">
163
            <Documentation>
164
                <UserDocu>setEulerAngles(seq, angle1, angle2, angle3) -> None
165

166
Set the Euler angles in a given sequence for this rotation.
167
The angles must be given in degrees.
168

169
seq : str
170
    Euler sequence name. All possible values given by toEulerAngles().
171
angle1 : float
172
angle2 : float
173
angle3 : float </UserDocu>
174
            </Documentation>
175
        </Methode>
176
        <Methode Name="toEulerAngles" Const="true">
177
            <Documentation>
178
                <UserDocu>toEulerAngles(seq) -> list
179

180
Get the Euler angles in a given sequence for this rotation.
181

182
seq : str
183
    Euler sequence name. If not given, the function returns
184
    all possible values of `seq`. Optional.</UserDocu>
185
            </Documentation>
186
        </Methode>
187
        <Methode Name="toMatrix" Const="true">
188
            <Documentation>
189
                <UserDocu>toMatrix() -> Base.Matrix
190

191
Convert the rotation to a 4D matrix representation.</UserDocu>
192
            </Documentation>
193
        </Methode>
194
        <Methode Name="isNull" Const="true">
195
            <Documentation>
196
                <UserDocu>isNull() -> bool
197

198
Returns True if all values in the quaternion representation are zero.</UserDocu>
199
            </Documentation>
200
        </Methode>
201
        <Methode Name="isIdentity" Const="true">
202
            <Documentation>
203
                <UserDocu>isIdentity(tol=0) -> bool
204

205
Returns True if the rotation equals the 4D identity matrix.
206
tol : float
207
    Tolerance used to check for identity.
208
    If tol is negative or zero, no tolerance is used.</UserDocu>
209
            </Documentation>
210
        </Methode>
211
        <Attribute Name="Q" ReadOnly="false">
212
            <Documentation>
213
                <UserDocu>The rotation elements (as quaternion).</UserDocu>
214
            </Documentation>
215
            <Parameter Name="Q" Type="Tuple" />
216
        </Attribute>
217
        <Attribute Name="Axis" ReadOnly="false">
218
            <Documentation>
219
                <UserDocu>The rotation axis of the quaternion.</UserDocu>
220
            </Documentation>
221
            <Parameter Name="Axis" Type="Object" />
222
        </Attribute>
223
        <Attribute Name="RawAxis" ReadOnly="true">
224
            <Documentation>
225
                <UserDocu>The rotation axis without normalization.</UserDocu>
226
            </Documentation>
227
            <Parameter Name="RawAxis" Type="Object" />
228
        </Attribute>
229
        <Attribute Name="Angle" ReadOnly="false">
230
            <Documentation>
231
                <UserDocu>The rotation angle of the quaternion.</UserDocu>
232
            </Documentation>
233
            <Parameter Name="Angle" Type="Float" />
234
        </Attribute>
235
        <ClassDeclarations>
236
            public:
237
            RotationPy(const Rotation &amp; mat, PyTypeObject *T = &amp;Type)
238
            :PyObjectBase(new Rotation(mat),T){}
239
            Rotation value() const
240
            { return *(getRotationPtr()); }
241
        </ClassDeclarations>
242
    </PythonExport>
243
</GenerateModel>
244

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.