fake-bpy-module 20240417__py3-none-any.whl → 20240418__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fake-bpy-module might be problematic. Click here for more details.
- _bpy_internal/__init__.pyi +4 -0
- _bpy_internal/freedesktop/__init__.pyi +88 -0
- _bpy_internal/freedesktop/py.typed +0 -0
- _bpy_internal/py.typed +0 -0
- aud/__init__.pyi +121 -48
- bgl/__init__.pyi +2443 -1265
- bl_math/__init__.pyi +19 -3
- blf/__init__.pyi +63 -13
- bmesh/__init__.pyi +13 -0
- bmesh/geometry/__init__.pyi +5 -0
- bmesh/ops/__init__.pyi +157 -68
- bmesh/types/__init__.pyi +109 -62
- bmesh/utils/__init__.pyi +11 -2
- bpy/__init__.pyi +7 -0
- bpy/app/__init__.pyi +13 -0
- bpy/app/handlers/__init__.pyi +41 -0
- bpy/app/icons/__init__.pyi +4 -2
- bpy/app/timers/__init__.pyi +38 -2
- bpy/app/translations/__init__.pyi +58 -0
- bpy/msgbus/__init__.pyi +46 -0
- bpy/ops/__init__.pyi +151 -0
- bpy/ops/action/__init__.pyi +76 -76
- bpy/ops/anim/__init__.pyi +104 -104
- bpy/ops/armature/__init__.pyi +96 -96
- bpy/ops/asset/__init__.pyi +32 -32
- bpy/ops/boid/__init__.pyi +16 -16
- bpy/ops/brush/__init__.pyi +18 -18
- bpy/ops/buttons/__init__.pyi +12 -12
- bpy/ops/cachefile/__init__.pyi +10 -10
- bpy/ops/camera/__init__.pyi +4 -4
- bpy/ops/clip/__init__.pyi +184 -184
- bpy/ops/cloth/__init__.pyi +2 -2
- bpy/ops/collection/__init__.pyi +18 -18
- bpy/ops/console/__init__.pyi +42 -42
- bpy/ops/constraint/__init__.pyi +36 -36
- bpy/ops/curve/__init__.pyi +102 -102
- bpy/ops/curves/__init__.pyi +54 -54
- bpy/ops/cycles/__init__.pyi +6 -6
- bpy/ops/dpaint/__init__.pyi +10 -10
- bpy/ops/ed/__init__.pyi +24 -24
- bpy/ops/export_anim/__init__.pyi +2 -2
- bpy/ops/export_mesh/__init__.pyi +2 -2
- bpy/ops/export_scene/__init__.pyi +7 -7
- bpy/ops/file/__init__.pyi +80 -80
- bpy/ops/fluid/__init__.pyi +28 -28
- bpy/ops/font/__init__.pyi +46 -46
- bpy/ops/geometry/__init__.pyi +20 -20
- bpy/ops/gizmogroup/__init__.pyi +4 -4
- bpy/ops/gpencil/__init__.pyi +300 -300
- bpy/ops/graph/__init__.pyi +130 -130
- bpy/ops/grease_pencil/__init__.pyi +112 -112
- bpy/ops/image/__init__.pyi +92 -92
- bpy/ops/import_anim/__init__.pyi +2 -2
- bpy/ops/import_curve/__init__.pyi +2 -2
- bpy/ops/import_mesh/__init__.pyi +2 -2
- bpy/ops/import_scene/__init__.pyi +6 -6
- bpy/ops/info/__init__.pyi +14 -14
- bpy/ops/lattice/__init__.pyi +16 -16
- bpy/ops/marker/__init__.pyi +22 -22
- bpy/ops/mask/__init__.pyi +78 -78
- bpy/ops/material/__init__.pyi +6 -6
- bpy/ops/mball/__init__.pyi +16 -16
- bpy/ops/mesh/__init__.pyi +326 -326
- bpy/ops/nla/__init__.pyi +79 -79
- bpy/ops/node/__init__.pyi +202 -202
- bpy/ops/object/__init__.pyi +488 -500
- bpy/ops/outliner/__init__.pyi +138 -138
- bpy/ops/paint/__init__.pyi +104 -104
- bpy/ops/paintcurve/__init__.pyi +16 -16
- bpy/ops/palette/__init__.pyi +14 -14
- bpy/ops/particle/__init__.pyi +72 -72
- bpy/ops/pose/__init__.pyi +78 -78
- bpy/ops/poselib/__init__.pyi +18 -18
- bpy/ops/preferences/__init__.pyi +76 -76
- bpy/ops/ptcache/__init__.pyi +14 -14
- bpy/ops/render/__init__.pyi +24 -24
- bpy/ops/rigidbody/__init__.pyi +26 -26
- bpy/ops/scene/__init__.pyi +78 -78
- bpy/ops/screen/__init__.pyi +78 -78
- bpy/ops/script/__init__.pyi +6 -6
- bpy/ops/sculpt/__init__.pyi +62 -62
- bpy/ops/sculpt_curves/__init__.pyi +8 -8
- bpy/ops/sequencer/__init__.pyi +170 -170
- bpy/ops/sound/__init__.pyi +14 -14
- bpy/ops/spreadsheet/__init__.pyi +8 -8
- bpy/ops/surface/__init__.pyi +12 -12
- bpy/ops/text/__init__.pyi +86 -86
- bpy/ops/text_editor/__init__.pyi +2 -2
- bpy/ops/texture/__init__.pyi +8 -8
- bpy/ops/transform/__init__.pyi +54 -54
- bpy/ops/ui/__init__.pyi +64 -64
- bpy/ops/uilist/__init__.pyi +6 -6
- bpy/ops/uv/__init__.pyi +98 -98
- bpy/ops/view2d/__init__.pyi +28 -28
- bpy/ops/view3d/__init__.pyi +134 -134
- bpy/ops/wm/__init__.pyi +224 -224
- bpy/ops/workspace/__init__.pyi +14 -14
- bpy/ops/world/__init__.pyi +2 -2
- bpy/path/__init__.pyi +6 -0
- bpy/props/__init__.pyi +141 -29
- bpy/types/__init__.pyi +101490 -5018
- bpy/utils/__init__.pyi +18 -3
- bpy/utils/previews/__init__.pyi +15 -0
- bpy/utils/units/__init__.pyi +11 -3
- bpy_extras/__init__.pyi +19 -0
- bpy_extras/asset_utils/__init__.pyi +5 -0
- {fake_bpy_module-20240417.dist-info → fake_bpy_module-20240418.dist-info}/METADATA +1 -1
- {fake_bpy_module-20240417.dist-info → fake_bpy_module-20240418.dist-info}/RECORD +137 -133
- {fake_bpy_module-20240417.dist-info → fake_bpy_module-20240418.dist-info}/top_level.txt +1 -0
- freestyle/__init__.pyi +18 -0
- freestyle/chainingiterators/__init__.pyi +20 -5
- freestyle/functions/__init__.pyi +151 -155
- freestyle/predicates/__init__.pyi +53 -46
- freestyle/shaders/__init__.pyi +91 -32
- freestyle/types/__init__.pyi +362 -120
- freestyle/utils/ContextFunctions/__init__.pyi +32 -7
- freestyle/utils/__init__.pyi +13 -1
- gpu/__init__.pyi +225 -0
- gpu/capabilities/__init__.pyi +37 -15
- gpu/matrix/__init__.pyi +7 -1
- gpu/platform/__init__.pyi +5 -0
- gpu/select/__init__.pyi +5 -0
- gpu/shader/__init__.pyi +77 -0
- gpu/state/__init__.pyi +15 -4
- gpu/texture/__init__.pyi +5 -0
- gpu/types/__init__.pyi +91 -33
- gpu_extras/__init__.pyi +15 -0
- gpu_extras/presets/__init__.pyi +16 -4
- imbuf/__init__.pyi +13 -0
- imbuf/types/__init__.pyi +20 -5
- mathutils/__init__.pyi +349 -227
- mathutils/bvhtree/__init__.pyi +21 -8
- mathutils/geometry/__init__.pyi +23 -9
- mathutils/interpolate/__init__.pyi +5 -0
- mathutils/kdtree/__init__.pyi +19 -5
- mathutils/noise/__init__.pyi +87 -41
- {fake_bpy_module-20240417.dist-info → fake_bpy_module-20240418.dist-info}/WHEEL +0 -0
mathutils/__init__.pyi
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module provides access to math operations.
|
|
3
|
+
|
|
4
|
+
[NOTE]
|
|
5
|
+
Classes, methods and attributes that accept vectors also accept other numeric sequences,
|
|
6
|
+
such as tuples, lists.
|
|
7
|
+
|
|
8
|
+
The mathutils module provides the following classes:
|
|
9
|
+
|
|
10
|
+
* Color,
|
|
11
|
+
* Euler,
|
|
12
|
+
* Matrix,
|
|
13
|
+
* Quaternion,
|
|
14
|
+
* Vector,
|
|
15
|
+
|
|
16
|
+
mathutils.geometry.rst
|
|
17
|
+
mathutils.bvhtree.rst
|
|
18
|
+
mathutils.kdtree.rst
|
|
19
|
+
mathutils.interpolate.rst
|
|
20
|
+
mathutils.noise.rst
|
|
21
|
+
|
|
22
|
+
:maxdepth: 1
|
|
23
|
+
:caption: Submodules
|
|
24
|
+
|
|
25
|
+
```../examples/mathutils.py```
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
|
|
1
29
|
import typing
|
|
2
30
|
from . import bvhtree
|
|
3
31
|
from . import geometry
|
|
@@ -10,14 +38,23 @@ GenericType = typing.TypeVar("GenericType")
|
|
|
10
38
|
class Color:
|
|
11
39
|
"""This object gives access to Colors in Blender.Most colors returned by Blender APIs are in scene linear color space, as defined by the OpenColorIO configuration. The notable exception is user interface theming colors, which are in sRGB color space."""
|
|
12
40
|
|
|
13
|
-
b:
|
|
14
|
-
""" Blue color channel.
|
|
41
|
+
b: float
|
|
42
|
+
""" Blue color channel.
|
|
15
43
|
|
|
16
|
-
|
|
17
|
-
"""
|
|
44
|
+
:type: float
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
g: float
|
|
48
|
+
""" Green color channel.
|
|
49
|
+
|
|
50
|
+
:type: float
|
|
51
|
+
"""
|
|
18
52
|
|
|
19
|
-
h:
|
|
20
|
-
""" HSV Hue component in [0, 1].
|
|
53
|
+
h: float
|
|
54
|
+
""" HSV Hue component in [0, 1].
|
|
55
|
+
|
|
56
|
+
:type: float
|
|
57
|
+
"""
|
|
21
58
|
|
|
22
59
|
hsv: typing.Union[typing.Sequence[float], Vector]
|
|
23
60
|
""" HSV Values in [0, 1].
|
|
@@ -46,16 +83,25 @@ class Color:
|
|
|
46
83
|
owner: typing.Any
|
|
47
84
|
""" The item this is wrapping or None (read-only)."""
|
|
48
85
|
|
|
49
|
-
r:
|
|
50
|
-
""" Red color channel.
|
|
86
|
+
r: float
|
|
87
|
+
""" Red color channel.
|
|
51
88
|
|
|
52
|
-
|
|
53
|
-
"""
|
|
89
|
+
:type: float
|
|
90
|
+
"""
|
|
54
91
|
|
|
55
|
-
|
|
56
|
-
""" HSV
|
|
92
|
+
s: float
|
|
93
|
+
""" HSV Saturation component in [0, 1].
|
|
57
94
|
|
|
58
|
-
|
|
95
|
+
:type: float
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
v: float
|
|
99
|
+
""" HSV Value component in [0, 1].
|
|
100
|
+
|
|
101
|
+
:type: float
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
def copy(self) -> Color:
|
|
59
105
|
"""Returns a copy of this color.
|
|
60
106
|
|
|
61
107
|
:return: A copy of the color.
|
|
@@ -63,14 +109,14 @@ class Color:
|
|
|
63
109
|
"""
|
|
64
110
|
...
|
|
65
111
|
|
|
66
|
-
def freeze(self)
|
|
112
|
+
def freeze(self):
|
|
67
113
|
"""Make this object immutable.After this the object can be hashed, used in dictionaries & sets.
|
|
68
114
|
|
|
69
115
|
:return: An instance of this object.
|
|
70
116
|
"""
|
|
71
117
|
...
|
|
72
118
|
|
|
73
|
-
def from_aces_to_scene_linear(self):
|
|
119
|
+
def from_aces_to_scene_linear(self) -> Color:
|
|
74
120
|
"""Convert from ACES2065-1 linear to scene linear color space.
|
|
75
121
|
|
|
76
122
|
:return: A color in scene linear color space.
|
|
@@ -141,9 +187,7 @@ class Color:
|
|
|
141
187
|
"""
|
|
142
188
|
...
|
|
143
189
|
|
|
144
|
-
def __add__(
|
|
145
|
-
self, other: typing.Union[typing.Sequence[float], Color]
|
|
146
|
-
) -> typing.Union[typing.Sequence[float], Color]:
|
|
190
|
+
def __add__(self, other: typing.Union[typing.Sequence[float], Color]) -> Color:
|
|
147
191
|
"""
|
|
148
192
|
|
|
149
193
|
:param other:
|
|
@@ -153,9 +197,7 @@ class Color:
|
|
|
153
197
|
"""
|
|
154
198
|
...
|
|
155
199
|
|
|
156
|
-
def __sub__(
|
|
157
|
-
self, other: typing.Union[typing.Sequence[float], Color]
|
|
158
|
-
) -> typing.Union[typing.Sequence[float], Color]:
|
|
200
|
+
def __sub__(self, other: typing.Union[typing.Sequence[float], Color]) -> Color:
|
|
159
201
|
"""
|
|
160
202
|
|
|
161
203
|
:param other:
|
|
@@ -165,27 +207,27 @@ class Color:
|
|
|
165
207
|
"""
|
|
166
208
|
...
|
|
167
209
|
|
|
168
|
-
def __mul__(self, other):
|
|
210
|
+
def __mul__(self, other: typing.Union[int, float]) -> Color:
|
|
169
211
|
"""
|
|
170
212
|
|
|
171
213
|
:param other:
|
|
214
|
+
:type other: typing.Union[int, float]
|
|
172
215
|
:return:
|
|
173
216
|
:rtype: Color
|
|
174
217
|
"""
|
|
175
218
|
...
|
|
176
219
|
|
|
177
|
-
def __truediv__(self, other):
|
|
220
|
+
def __truediv__(self, other: typing.Union[int, float]) -> Color:
|
|
178
221
|
"""
|
|
179
222
|
|
|
180
223
|
:param other:
|
|
224
|
+
:type other: typing.Union[int, float]
|
|
181
225
|
:return:
|
|
182
226
|
:rtype: Color
|
|
183
227
|
"""
|
|
184
228
|
...
|
|
185
229
|
|
|
186
|
-
def __radd__(
|
|
187
|
-
self, other: typing.Union[typing.Sequence[float], Color]
|
|
188
|
-
) -> typing.Union[typing.Sequence[float], Color]:
|
|
230
|
+
def __radd__(self, other: typing.Union[typing.Sequence[float], Color]) -> Color:
|
|
189
231
|
"""
|
|
190
232
|
|
|
191
233
|
:param other:
|
|
@@ -195,9 +237,7 @@ class Color:
|
|
|
195
237
|
"""
|
|
196
238
|
...
|
|
197
239
|
|
|
198
|
-
def __rsub__(
|
|
199
|
-
self, other: typing.Union[typing.Sequence[float], Color]
|
|
200
|
-
) -> typing.Union[typing.Sequence[float], Color]:
|
|
240
|
+
def __rsub__(self, other: typing.Union[typing.Sequence[float], Color]) -> Color:
|
|
201
241
|
"""
|
|
202
242
|
|
|
203
243
|
:param other:
|
|
@@ -207,27 +247,27 @@ class Color:
|
|
|
207
247
|
"""
|
|
208
248
|
...
|
|
209
249
|
|
|
210
|
-
def __rmul__(self, other):
|
|
250
|
+
def __rmul__(self, other: typing.Union[int, float]) -> Color:
|
|
211
251
|
"""
|
|
212
252
|
|
|
213
253
|
:param other:
|
|
254
|
+
:type other: typing.Union[int, float]
|
|
214
255
|
:return:
|
|
215
256
|
:rtype: Color
|
|
216
257
|
"""
|
|
217
258
|
...
|
|
218
259
|
|
|
219
|
-
def __rtruediv__(self, other):
|
|
260
|
+
def __rtruediv__(self, other: typing.Union[int, float]) -> Color:
|
|
220
261
|
"""
|
|
221
262
|
|
|
222
263
|
:param other:
|
|
264
|
+
:type other: typing.Union[int, float]
|
|
223
265
|
:return:
|
|
224
266
|
:rtype: Color
|
|
225
267
|
"""
|
|
226
268
|
...
|
|
227
269
|
|
|
228
|
-
def __iadd__(
|
|
229
|
-
self, other: typing.Union[typing.Sequence[float], Color]
|
|
230
|
-
) -> typing.Union[typing.Sequence[float], Color]:
|
|
270
|
+
def __iadd__(self, other: typing.Union[typing.Sequence[float], Color]) -> Color:
|
|
231
271
|
"""
|
|
232
272
|
|
|
233
273
|
:param other:
|
|
@@ -237,9 +277,7 @@ class Color:
|
|
|
237
277
|
"""
|
|
238
278
|
...
|
|
239
279
|
|
|
240
|
-
def __isub__(
|
|
241
|
-
self, other: typing.Union[typing.Sequence[float], Color]
|
|
242
|
-
) -> typing.Union[typing.Sequence[float], Color]:
|
|
280
|
+
def __isub__(self, other: typing.Union[typing.Sequence[float], Color]) -> Color:
|
|
243
281
|
"""
|
|
244
282
|
|
|
245
283
|
:param other:
|
|
@@ -249,19 +287,21 @@ class Color:
|
|
|
249
287
|
"""
|
|
250
288
|
...
|
|
251
289
|
|
|
252
|
-
def __imul__(self, other):
|
|
290
|
+
def __imul__(self, other: typing.Union[int, float]) -> Color:
|
|
253
291
|
"""
|
|
254
292
|
|
|
255
293
|
:param other:
|
|
294
|
+
:type other: typing.Union[int, float]
|
|
256
295
|
:return:
|
|
257
296
|
:rtype: Color
|
|
258
297
|
"""
|
|
259
298
|
...
|
|
260
299
|
|
|
261
|
-
def __itruediv__(self, other):
|
|
300
|
+
def __itruediv__(self, other: typing.Union[int, float]) -> Color:
|
|
262
301
|
"""
|
|
263
302
|
|
|
264
303
|
:param other:
|
|
304
|
+
:type other: typing.Union[int, float]
|
|
265
305
|
:return:
|
|
266
306
|
:rtype: Color
|
|
267
307
|
"""
|
|
@@ -294,16 +334,25 @@ class Euler:
|
|
|
294
334
|
owner: typing.Any
|
|
295
335
|
""" The item this is wrapping or None (read-only)."""
|
|
296
336
|
|
|
297
|
-
x:
|
|
298
|
-
""" Euler axis angle in radians.
|
|
337
|
+
x: float
|
|
338
|
+
""" Euler axis angle in radians.
|
|
299
339
|
|
|
300
|
-
|
|
301
|
-
"""
|
|
340
|
+
:type: float
|
|
341
|
+
"""
|
|
342
|
+
|
|
343
|
+
y: float
|
|
344
|
+
""" Euler axis angle in radians.
|
|
345
|
+
|
|
346
|
+
:type: float
|
|
347
|
+
"""
|
|
302
348
|
|
|
303
|
-
z:
|
|
304
|
-
""" Euler axis angle in radians.
|
|
349
|
+
z: float
|
|
350
|
+
""" Euler axis angle in radians.
|
|
305
351
|
|
|
306
|
-
|
|
352
|
+
:type: float
|
|
353
|
+
"""
|
|
354
|
+
|
|
355
|
+
def copy(self) -> Euler:
|
|
307
356
|
"""Returns a copy of this euler.
|
|
308
357
|
|
|
309
358
|
:return: A copy of the euler.
|
|
@@ -311,7 +360,7 @@ class Euler:
|
|
|
311
360
|
"""
|
|
312
361
|
...
|
|
313
362
|
|
|
314
|
-
def freeze(self)
|
|
363
|
+
def freeze(self):
|
|
315
364
|
"""Make this object immutable.After this the object can be hashed, used in dictionaries & sets.
|
|
316
365
|
|
|
317
366
|
:return: An instance of this object.
|
|
@@ -344,17 +393,18 @@ class Euler:
|
|
|
344
393
|
"""
|
|
345
394
|
...
|
|
346
395
|
|
|
347
|
-
def rotate_axis(self, axis: str, angle):
|
|
396
|
+
def rotate_axis(self, axis: str, angle: float):
|
|
348
397
|
"""Rotates the euler a certain amount and returning a unique euler rotation
|
|
349
398
|
(no 720 degree pitches).
|
|
350
399
|
|
|
351
400
|
:param axis: single character in ['X, 'Y', 'Z'].
|
|
352
401
|
:type axis: str
|
|
353
402
|
:param angle: angle in radians.
|
|
403
|
+
:type angle: float
|
|
354
404
|
"""
|
|
355
405
|
...
|
|
356
406
|
|
|
357
|
-
def to_matrix(self):
|
|
407
|
+
def to_matrix(self) -> Matrix:
|
|
358
408
|
"""Return a matrix representation of the euler.
|
|
359
409
|
|
|
360
410
|
:return: A 3x3 rotation matrix representation of the euler.
|
|
@@ -362,7 +412,7 @@ class Euler:
|
|
|
362
412
|
"""
|
|
363
413
|
...
|
|
364
414
|
|
|
365
|
-
def to_quaternion(self) ->
|
|
415
|
+
def to_quaternion(self) -> Quaternion:
|
|
366
416
|
"""Return a quaternion representation of the euler.
|
|
367
417
|
|
|
368
418
|
:return: Quaternion representation of the euler.
|
|
@@ -432,8 +482,11 @@ class Matrix:
|
|
|
432
482
|
:type: bool
|
|
433
483
|
"""
|
|
434
484
|
|
|
435
|
-
median_scale:
|
|
436
|
-
""" The average scale applied to each axis (read-only).
|
|
485
|
+
median_scale: float
|
|
486
|
+
""" The average scale applied to each axis (read-only).
|
|
487
|
+
|
|
488
|
+
:type: float
|
|
489
|
+
"""
|
|
437
490
|
|
|
438
491
|
owner: typing.Any
|
|
439
492
|
""" The item this is wrapping or None (read-only)."""
|
|
@@ -448,9 +501,7 @@ class Matrix:
|
|
|
448
501
|
"""
|
|
449
502
|
|
|
450
503
|
@classmethod
|
|
451
|
-
def Diagonal(
|
|
452
|
-
cls, vector: typing.Union[typing.Sequence[float], Vector]
|
|
453
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
504
|
+
def Diagonal(cls, vector: typing.Union[typing.Sequence[float], Vector]) -> Matrix:
|
|
454
505
|
"""Create a diagonal (scaling) matrix using the values from the vector.
|
|
455
506
|
|
|
456
507
|
:param vector: The vector of values for the diagonal.
|
|
@@ -461,10 +512,11 @@ class Matrix:
|
|
|
461
512
|
...
|
|
462
513
|
|
|
463
514
|
@classmethod
|
|
464
|
-
def Identity(cls, size):
|
|
515
|
+
def Identity(cls, size: int) -> Matrix:
|
|
465
516
|
"""Create an identity matrix.
|
|
466
517
|
|
|
467
518
|
:param size: The size of the identity matrix to construct [2, 4].
|
|
519
|
+
:type size: int
|
|
468
520
|
:return: A new identity matrix.
|
|
469
521
|
:rtype: Matrix
|
|
470
522
|
"""
|
|
@@ -492,8 +544,8 @@ class Matrix:
|
|
|
492
544
|
|
|
493
545
|
@classmethod
|
|
494
546
|
def OrthoProjection(
|
|
495
|
-
cls, axis: typing.Union[str, typing.Sequence[float], Vector], size
|
|
496
|
-
):
|
|
547
|
+
cls, axis: typing.Union[str, typing.Sequence[float], Vector], size: int
|
|
548
|
+
) -> Matrix:
|
|
497
549
|
"""Create a matrix to represent an orthographic projection.
|
|
498
550
|
|
|
499
551
|
:param axis: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],
|
|
@@ -501,6 +553,7 @@ class Matrix:
|
|
|
501
553
|
Or a vector for an arbitrary axis
|
|
502
554
|
:type axis: typing.Union[str, typing.Sequence[float], Vector]
|
|
503
555
|
:param size: The size of the projection matrix to construct [2, 4].
|
|
556
|
+
:type size: int
|
|
504
557
|
:return: A new projection matrix.
|
|
505
558
|
:rtype: Matrix
|
|
506
559
|
"""
|
|
@@ -508,12 +561,17 @@ class Matrix:
|
|
|
508
561
|
|
|
509
562
|
@classmethod
|
|
510
563
|
def Rotation(
|
|
511
|
-
cls,
|
|
512
|
-
|
|
564
|
+
cls,
|
|
565
|
+
angle: float,
|
|
566
|
+
size: int,
|
|
567
|
+
axis: typing.Union[str, typing.Sequence[float], Vector],
|
|
568
|
+
) -> Matrix:
|
|
513
569
|
"""Create a matrix representing a rotation.
|
|
514
570
|
|
|
515
571
|
:param angle: The angle of rotation desired, in radians.
|
|
572
|
+
:type angle: float
|
|
516
573
|
:param size: The size of the rotation matrix to construct [2, 4].
|
|
574
|
+
:type size: int
|
|
517
575
|
:param axis: a string in ['X', 'Y', 'Z'] or a 3D Vector Object
|
|
518
576
|
(optional when size is 2).
|
|
519
577
|
:type axis: typing.Union[str, typing.Sequence[float], Vector]
|
|
@@ -524,12 +582,17 @@ class Matrix:
|
|
|
524
582
|
|
|
525
583
|
@classmethod
|
|
526
584
|
def Scale(
|
|
527
|
-
cls,
|
|
528
|
-
|
|
585
|
+
cls,
|
|
586
|
+
factor: float,
|
|
587
|
+
size: int,
|
|
588
|
+
axis: typing.Union[typing.Sequence[float], Vector],
|
|
589
|
+
) -> Matrix:
|
|
529
590
|
"""Create a matrix representing a scaling.
|
|
530
591
|
|
|
531
592
|
:param factor: The factor of scaling to apply.
|
|
593
|
+
:type factor: float
|
|
532
594
|
:param size: The size of the scale matrix to construct [2, 4].
|
|
595
|
+
:type size: int
|
|
533
596
|
:param axis: Direction to influence scale. (optional).
|
|
534
597
|
:type axis: typing.Union[typing.Sequence[float], Vector]
|
|
535
598
|
:return: A new scale matrix.
|
|
@@ -538,15 +601,17 @@ class Matrix:
|
|
|
538
601
|
...
|
|
539
602
|
|
|
540
603
|
@classmethod
|
|
541
|
-
def Shear(cls, plane: str, size, factor):
|
|
604
|
+
def Shear(cls, plane: str, size: int, factor: float) -> Matrix:
|
|
542
605
|
"""Create a matrix to represent an shear transformation.
|
|
543
606
|
|
|
544
607
|
:param plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],
|
|
545
608
|
where a single axis is for a 2D matrix only.
|
|
546
609
|
:type plane: str
|
|
547
610
|
:param size: The size of the shear matrix to construct [2, 4].
|
|
611
|
+
:type size: int
|
|
548
612
|
:param factor: The factor of shear to apply. For a 3 or 4 size matrix
|
|
549
613
|
pass a pair of floats corresponding with the plane axis.
|
|
614
|
+
:type factor: float
|
|
550
615
|
:return: A new shear matrix.
|
|
551
616
|
:rtype: Matrix
|
|
552
617
|
"""
|
|
@@ -555,7 +620,7 @@ class Matrix:
|
|
|
555
620
|
@classmethod
|
|
556
621
|
def Translation(
|
|
557
622
|
cls, vector: typing.Union[typing.Sequence[float], Vector]
|
|
558
|
-
) ->
|
|
623
|
+
) -> Matrix:
|
|
559
624
|
"""Create a matrix representing a translation.
|
|
560
625
|
|
|
561
626
|
:param vector: The translation vector.
|
|
@@ -585,7 +650,7 @@ class Matrix:
|
|
|
585
650
|
"""
|
|
586
651
|
...
|
|
587
652
|
|
|
588
|
-
def decompose(self) ->
|
|
653
|
+
def decompose(self) -> Quaternion:
|
|
589
654
|
"""Return the translation, rotation, and scale components of this matrix.
|
|
590
655
|
|
|
591
656
|
:return: tuple of translation, rotation, and scale
|
|
@@ -593,10 +658,11 @@ class Matrix:
|
|
|
593
658
|
"""
|
|
594
659
|
...
|
|
595
660
|
|
|
596
|
-
def determinant(self) ->
|
|
661
|
+
def determinant(self) -> float:
|
|
597
662
|
"""Return the determinant of a matrix.`Determinant <https://en.wikipedia.org/wiki/Determinant>`__ on Wikipedia.
|
|
598
663
|
|
|
599
664
|
:return: Return the determinant of a matrix.
|
|
665
|
+
:rtype: float
|
|
600
666
|
"""
|
|
601
667
|
...
|
|
602
668
|
|
|
@@ -628,7 +694,7 @@ class Matrix:
|
|
|
628
694
|
"""
|
|
629
695
|
...
|
|
630
696
|
|
|
631
|
-
def inverted(self, fallback: typing.Any = None) ->
|
|
697
|
+
def inverted(self, fallback: typing.Any = None) -> Matrix:
|
|
632
698
|
"""Return an inverted copy of the matrix.
|
|
633
699
|
|
|
634
700
|
:param fallback: return this when the inverse can't be calculated
|
|
@@ -649,12 +715,15 @@ class Matrix:
|
|
|
649
715
|
"""
|
|
650
716
|
...
|
|
651
717
|
|
|
652
|
-
def lerp(
|
|
718
|
+
def lerp(
|
|
719
|
+
self, other: typing.Union[typing.Sequence[float], Matrix], factor: float
|
|
720
|
+
) -> Matrix:
|
|
653
721
|
"""Returns the interpolation of two matrices. Uses polar decomposition, see "Matrix Animation and Polar Decomposition", Shoemake and Duff, 1992.
|
|
654
722
|
|
|
655
723
|
:param other: value to interpolate with.
|
|
656
724
|
:type other: typing.Union[typing.Sequence[float], Matrix]
|
|
657
725
|
:param factor: The interpolation value in [0.0, 1.0].
|
|
726
|
+
:type factor: float
|
|
658
727
|
:return: The interpolated matrix.
|
|
659
728
|
:rtype: Matrix
|
|
660
729
|
"""
|
|
@@ -694,16 +763,7 @@ class Matrix:
|
|
|
694
763
|
"""
|
|
695
764
|
...
|
|
696
765
|
|
|
697
|
-
def to_2x2(
|
|
698
|
-
self,
|
|
699
|
-
) -> typing.Union[
|
|
700
|
-
typing.Sequence[float],
|
|
701
|
-
Euler,
|
|
702
|
-
typing.Sequence[float],
|
|
703
|
-
Quaternion,
|
|
704
|
-
typing.Sequence[float],
|
|
705
|
-
Matrix,
|
|
706
|
-
]:
|
|
766
|
+
def to_2x2(self) -> Matrix:
|
|
707
767
|
"""Return a 2x2 copy of this matrix.
|
|
708
768
|
|
|
709
769
|
:return: a new matrix.
|
|
@@ -729,7 +789,7 @@ class Matrix:
|
|
|
729
789
|
|
|
730
790
|
def to_euler(
|
|
731
791
|
self, order: str, euler_compat: typing.Union[typing.Sequence[float], Euler]
|
|
732
|
-
) ->
|
|
792
|
+
) -> Euler:
|
|
733
793
|
"""Return an Euler representation of the rotation matrix
|
|
734
794
|
(3x3 or 4x4 matrix only).
|
|
735
795
|
|
|
@@ -745,7 +805,7 @@ class Matrix:
|
|
|
745
805
|
"""
|
|
746
806
|
...
|
|
747
807
|
|
|
748
|
-
def to_quaternion(self) ->
|
|
808
|
+
def to_quaternion(self) -> Quaternion:
|
|
749
809
|
"""Return a quaternion representation of the rotation matrix.
|
|
750
810
|
|
|
751
811
|
:return: Quaternion representation of the rotation matrix.
|
|
@@ -753,7 +813,7 @@ class Matrix:
|
|
|
753
813
|
"""
|
|
754
814
|
...
|
|
755
815
|
|
|
756
|
-
def to_scale(self) ->
|
|
816
|
+
def to_scale(self) -> Vector:
|
|
757
817
|
"""Return the scale part of a 3x3 or 4x4 matrix.
|
|
758
818
|
|
|
759
819
|
:return: Return the scale of a matrix.
|
|
@@ -773,7 +833,7 @@ class Matrix:
|
|
|
773
833
|
"""Set the matrix to its transpose.`Transpose <https://en.wikipedia.org/wiki/Transpose>`__ on Wikipedia."""
|
|
774
834
|
...
|
|
775
835
|
|
|
776
|
-
def transposed(self) ->
|
|
836
|
+
def transposed(self) -> Matrix:
|
|
777
837
|
"""Return a new, transposed matrix.
|
|
778
838
|
|
|
779
839
|
:return: a transposed matrix
|
|
@@ -800,22 +860,25 @@ class Matrix:
|
|
|
800
860
|
"""
|
|
801
861
|
...
|
|
802
862
|
|
|
803
|
-
def __getitem__(self, key):
|
|
863
|
+
def __getitem__(self, key: int) -> Vector:
|
|
804
864
|
"""
|
|
805
865
|
|
|
806
866
|
:param key:
|
|
867
|
+
:type key: int
|
|
807
868
|
:return:
|
|
808
869
|
:rtype: Vector
|
|
809
870
|
"""
|
|
810
871
|
...
|
|
811
872
|
|
|
812
|
-
def __len__(self):
|
|
813
|
-
"""
|
|
873
|
+
def __len__(self) -> int:
|
|
874
|
+
"""
|
|
875
|
+
|
|
876
|
+
:return:
|
|
877
|
+
:rtype: int
|
|
878
|
+
"""
|
|
814
879
|
...
|
|
815
880
|
|
|
816
|
-
def __add__(
|
|
817
|
-
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
818
|
-
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
881
|
+
def __add__(self, other: typing.Union[typing.Sequence[float], Matrix]) -> Matrix:
|
|
819
882
|
"""
|
|
820
883
|
|
|
821
884
|
:param other:
|
|
@@ -825,9 +888,7 @@ class Matrix:
|
|
|
825
888
|
"""
|
|
826
889
|
...
|
|
827
890
|
|
|
828
|
-
def __sub__(
|
|
829
|
-
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
830
|
-
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
891
|
+
def __sub__(self, other: typing.Union[typing.Sequence[float], Matrix]) -> Matrix:
|
|
831
892
|
"""
|
|
832
893
|
|
|
833
894
|
:param other:
|
|
@@ -837,10 +898,11 @@ class Matrix:
|
|
|
837
898
|
"""
|
|
838
899
|
...
|
|
839
900
|
|
|
840
|
-
def __mul__(self, other):
|
|
901
|
+
def __mul__(self, other: typing.Union[int, float]) -> Matrix:
|
|
841
902
|
"""
|
|
842
903
|
|
|
843
904
|
:param other:
|
|
905
|
+
:type other: typing.Union[int, float]
|
|
844
906
|
:return:
|
|
845
907
|
:rtype: Matrix
|
|
846
908
|
"""
|
|
@@ -851,7 +913,7 @@ class Matrix:
|
|
|
851
913
|
other: typing.Union[
|
|
852
914
|
typing.Sequence[float], Matrix, typing.Sequence[float], Vector
|
|
853
915
|
],
|
|
854
|
-
) -> typing.Union[
|
|
916
|
+
) -> typing.Union[Matrix, Vector]:
|
|
855
917
|
"""
|
|
856
918
|
|
|
857
919
|
:param other:
|
|
@@ -861,9 +923,7 @@ class Matrix:
|
|
|
861
923
|
"""
|
|
862
924
|
...
|
|
863
925
|
|
|
864
|
-
def __radd__(
|
|
865
|
-
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
866
|
-
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
926
|
+
def __radd__(self, other: typing.Union[typing.Sequence[float], Matrix]) -> Matrix:
|
|
867
927
|
"""
|
|
868
928
|
|
|
869
929
|
:param other:
|
|
@@ -873,9 +933,7 @@ class Matrix:
|
|
|
873
933
|
"""
|
|
874
934
|
...
|
|
875
935
|
|
|
876
|
-
def __rsub__(
|
|
877
|
-
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
878
|
-
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
936
|
+
def __rsub__(self, other: typing.Union[typing.Sequence[float], Matrix]) -> Matrix:
|
|
879
937
|
"""
|
|
880
938
|
|
|
881
939
|
:param other:
|
|
@@ -885,10 +943,11 @@ class Matrix:
|
|
|
885
943
|
"""
|
|
886
944
|
...
|
|
887
945
|
|
|
888
|
-
def __rmul__(self, other):
|
|
946
|
+
def __rmul__(self, other: typing.Union[int, float]) -> Matrix:
|
|
889
947
|
"""
|
|
890
948
|
|
|
891
949
|
:param other:
|
|
950
|
+
:type other: typing.Union[int, float]
|
|
892
951
|
:return:
|
|
893
952
|
:rtype: Matrix
|
|
894
953
|
"""
|
|
@@ -896,7 +955,7 @@ class Matrix:
|
|
|
896
955
|
|
|
897
956
|
def __rmatmul__(
|
|
898
957
|
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
899
|
-
) ->
|
|
958
|
+
) -> Matrix:
|
|
900
959
|
"""
|
|
901
960
|
|
|
902
961
|
:param other:
|
|
@@ -906,10 +965,11 @@ class Matrix:
|
|
|
906
965
|
"""
|
|
907
966
|
...
|
|
908
967
|
|
|
909
|
-
def __imul__(self, other):
|
|
968
|
+
def __imul__(self, other: typing.Union[int, float]) -> Matrix:
|
|
910
969
|
"""
|
|
911
970
|
|
|
912
971
|
:param other:
|
|
972
|
+
:type other: typing.Union[int, float]
|
|
913
973
|
:return:
|
|
914
974
|
:rtype: Matrix
|
|
915
975
|
"""
|
|
@@ -917,7 +977,7 @@ class Matrix:
|
|
|
917
977
|
|
|
918
978
|
def __imatmul__(
|
|
919
979
|
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
920
|
-
) ->
|
|
980
|
+
) -> Matrix:
|
|
921
981
|
"""
|
|
922
982
|
|
|
923
983
|
:param other:
|
|
@@ -930,8 +990,11 @@ class Matrix:
|
|
|
930
990
|
class Quaternion:
|
|
931
991
|
"""This object gives access to Quaternions in Blender.The constructor takes arguments in various forms:"""
|
|
932
992
|
|
|
933
|
-
angle:
|
|
934
|
-
""" Angle of the quaternion.
|
|
993
|
+
angle: float
|
|
994
|
+
""" Angle of the quaternion.
|
|
995
|
+
|
|
996
|
+
:type: float
|
|
997
|
+
"""
|
|
935
998
|
|
|
936
999
|
axis: typing.Union[typing.Sequence[float], Vector]
|
|
937
1000
|
""" Quaternion axis as a vector.
|
|
@@ -957,29 +1020,44 @@ class Quaternion:
|
|
|
957
1020
|
:type: bool
|
|
958
1021
|
"""
|
|
959
1022
|
|
|
960
|
-
magnitude:
|
|
961
|
-
""" Size of the quaternion (read-only).
|
|
1023
|
+
magnitude: float
|
|
1024
|
+
""" Size of the quaternion (read-only).
|
|
1025
|
+
|
|
1026
|
+
:type: float
|
|
1027
|
+
"""
|
|
962
1028
|
|
|
963
1029
|
owner: typing.Any
|
|
964
1030
|
""" The item this is wrapping or None (read-only)."""
|
|
965
1031
|
|
|
966
|
-
w:
|
|
967
|
-
""" Quaternion axis value.
|
|
1032
|
+
w: float
|
|
1033
|
+
""" Quaternion axis value.
|
|
968
1034
|
|
|
969
|
-
|
|
970
|
-
"""
|
|
1035
|
+
:type: float
|
|
1036
|
+
"""
|
|
971
1037
|
|
|
972
|
-
|
|
973
|
-
""" Quaternion axis value.
|
|
1038
|
+
x: float
|
|
1039
|
+
""" Quaternion axis value.
|
|
974
1040
|
|
|
975
|
-
|
|
976
|
-
"""
|
|
1041
|
+
:type: float
|
|
1042
|
+
"""
|
|
1043
|
+
|
|
1044
|
+
y: float
|
|
1045
|
+
""" Quaternion axis value.
|
|
1046
|
+
|
|
1047
|
+
:type: float
|
|
1048
|
+
"""
|
|
1049
|
+
|
|
1050
|
+
z: float
|
|
1051
|
+
""" Quaternion axis value.
|
|
1052
|
+
|
|
1053
|
+
:type: float
|
|
1054
|
+
"""
|
|
977
1055
|
|
|
978
1056
|
def conjugate(self):
|
|
979
1057
|
"""Set the quaternion to its conjugate (negate x, y, z)."""
|
|
980
1058
|
...
|
|
981
1059
|
|
|
982
|
-
def conjugated(self):
|
|
1060
|
+
def conjugated(self) -> Quaternion:
|
|
983
1061
|
"""Return a new conjugated quaternion.
|
|
984
1062
|
|
|
985
1063
|
:return: a new quaternion.
|
|
@@ -997,7 +1075,7 @@ class Quaternion:
|
|
|
997
1075
|
|
|
998
1076
|
def cross(
|
|
999
1077
|
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1000
|
-
) ->
|
|
1078
|
+
) -> Quaternion:
|
|
1001
1079
|
"""Return the cross product of this quaternion and another.
|
|
1002
1080
|
|
|
1003
1081
|
:param other: The other quaternion to perform the cross product with.
|
|
@@ -1007,14 +1085,13 @@ class Quaternion:
|
|
|
1007
1085
|
"""
|
|
1008
1086
|
...
|
|
1009
1087
|
|
|
1010
|
-
def dot(
|
|
1011
|
-
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1012
|
-
) -> typing.Union[typing.Sequence[float], Quaternion]:
|
|
1088
|
+
def dot(self, other: typing.Union[typing.Sequence[float], Quaternion]) -> float:
|
|
1013
1089
|
"""Return the dot product of this quaternion and another.
|
|
1014
1090
|
|
|
1015
1091
|
:param other: The other quaternion to perform the dot product with.
|
|
1016
1092
|
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1017
1093
|
:return: The dot product.
|
|
1094
|
+
:rtype: float
|
|
1018
1095
|
"""
|
|
1019
1096
|
...
|
|
1020
1097
|
|
|
@@ -1033,7 +1110,7 @@ class Quaternion:
|
|
|
1033
1110
|
"""Set the quaternion to its inverse."""
|
|
1034
1111
|
...
|
|
1035
1112
|
|
|
1036
|
-
def inverted(self):
|
|
1113
|
+
def inverted(self) -> Quaternion:
|
|
1037
1114
|
"""Return a new, inverted quaternion.
|
|
1038
1115
|
|
|
1039
1116
|
:return: the inverted value.
|
|
@@ -1057,7 +1134,7 @@ class Quaternion:
|
|
|
1057
1134
|
"""Normalize the quaternion."""
|
|
1058
1135
|
...
|
|
1059
1136
|
|
|
1060
|
-
def normalized(self):
|
|
1137
|
+
def normalized(self) -> Quaternion:
|
|
1061
1138
|
"""Return a new normalized quaternion.
|
|
1062
1139
|
|
|
1063
1140
|
:return: a normalized copy.
|
|
@@ -1085,7 +1162,7 @@ class Quaternion:
|
|
|
1085
1162
|
|
|
1086
1163
|
def rotation_difference(
|
|
1087
1164
|
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1088
|
-
) ->
|
|
1165
|
+
) -> Quaternion:
|
|
1089
1166
|
"""Returns a quaternion representing the rotational difference.
|
|
1090
1167
|
|
|
1091
1168
|
:param other: second quaternion.
|
|
@@ -1095,28 +1172,31 @@ class Quaternion:
|
|
|
1095
1172
|
"""
|
|
1096
1173
|
...
|
|
1097
1174
|
|
|
1098
|
-
def slerp(
|
|
1175
|
+
def slerp(
|
|
1176
|
+
self, other: typing.Union[typing.Sequence[float], Quaternion], factor: float
|
|
1177
|
+
) -> Quaternion:
|
|
1099
1178
|
"""Returns the interpolation of two quaternions.
|
|
1100
1179
|
|
|
1101
1180
|
:param other: value to interpolate with.
|
|
1102
1181
|
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1103
1182
|
:param factor: The interpolation value in [0.0, 1.0].
|
|
1183
|
+
:type factor: float
|
|
1104
1184
|
:return: The interpolated rotation.
|
|
1105
1185
|
:rtype: Quaternion
|
|
1106
1186
|
"""
|
|
1107
1187
|
...
|
|
1108
1188
|
|
|
1109
|
-
def to_axis_angle(self) ->
|
|
1189
|
+
def to_axis_angle(self) -> typing.Tuple[Vector, float]:
|
|
1110
1190
|
"""Return the axis, angle representation of the quaternion.
|
|
1111
1191
|
|
|
1112
1192
|
:return: axis, angle.
|
|
1113
|
-
:rtype: typing.Tuple[Vector]
|
|
1193
|
+
:rtype: typing.Tuple[Vector, float]
|
|
1114
1194
|
"""
|
|
1115
1195
|
...
|
|
1116
1196
|
|
|
1117
1197
|
def to_euler(
|
|
1118
1198
|
self, order: str, euler_compat: typing.Union[typing.Sequence[float], Euler]
|
|
1119
|
-
) ->
|
|
1199
|
+
) -> Euler:
|
|
1120
1200
|
"""Return Euler representation of the quaternion.
|
|
1121
1201
|
|
|
1122
1202
|
:param order: Optional rotation order argument in
|
|
@@ -1131,7 +1211,7 @@ class Quaternion:
|
|
|
1131
1211
|
"""
|
|
1132
1212
|
...
|
|
1133
1213
|
|
|
1134
|
-
def to_exponential_map(self)
|
|
1214
|
+
def to_exponential_map(self):
|
|
1135
1215
|
"""Return the exponential map representation of the quaternion.This representation consist of the rotation axis multiplied by the rotation angle.
|
|
1136
1216
|
Such a representation is useful for interpolation between multiple orientations.To convert back to a quaternion, pass it to the `Quaternion` constructor.
|
|
1137
1217
|
|
|
@@ -1139,7 +1219,7 @@ class Quaternion:
|
|
|
1139
1219
|
"""
|
|
1140
1220
|
...
|
|
1141
1221
|
|
|
1142
|
-
def to_matrix(self):
|
|
1222
|
+
def to_matrix(self) -> Matrix:
|
|
1143
1223
|
"""Return a matrix representation of the quaternion.
|
|
1144
1224
|
|
|
1145
1225
|
:return: A 3x3 rotation matrix representation of the quaternion.
|
|
@@ -1147,13 +1227,13 @@ class Quaternion:
|
|
|
1147
1227
|
"""
|
|
1148
1228
|
...
|
|
1149
1229
|
|
|
1150
|
-
def to_swing_twist(self, axis):
|
|
1230
|
+
def to_swing_twist(self, axis) -> typing.Tuple[Quaternion, float]:
|
|
1151
1231
|
"""Split the rotation into a swing quaternion with the specified
|
|
1152
1232
|
axis fixed at zero, and the remaining twist rotation angle.
|
|
1153
1233
|
|
|
1154
1234
|
:param axis: twist axis as a string in ['X', 'Y', 'Z']
|
|
1155
1235
|
:return: swing, twist angle.
|
|
1156
|
-
:rtype: typing.Tuple[Quaternion]
|
|
1236
|
+
:rtype: typing.Tuple[Quaternion, float]
|
|
1157
1237
|
"""
|
|
1158
1238
|
...
|
|
1159
1239
|
|
|
@@ -1164,28 +1244,39 @@ class Quaternion:
|
|
|
1164
1244
|
"""
|
|
1165
1245
|
...
|
|
1166
1246
|
|
|
1167
|
-
def __len__(self):
|
|
1168
|
-
"""
|
|
1247
|
+
def __len__(self) -> int:
|
|
1248
|
+
"""
|
|
1249
|
+
|
|
1250
|
+
:return:
|
|
1251
|
+
:rtype: int
|
|
1252
|
+
"""
|
|
1169
1253
|
...
|
|
1170
1254
|
|
|
1171
|
-
def __getitem__(self, key):
|
|
1255
|
+
def __getitem__(self, key: int) -> float:
|
|
1172
1256
|
"""
|
|
1173
1257
|
|
|
1174
1258
|
:param key:
|
|
1259
|
+
:type key: int
|
|
1260
|
+
:return:
|
|
1261
|
+
:rtype: float
|
|
1175
1262
|
"""
|
|
1176
1263
|
...
|
|
1177
1264
|
|
|
1178
|
-
def __setitem__(self, key, value):
|
|
1265
|
+
def __setitem__(self, key: int, value: float) -> float:
|
|
1179
1266
|
"""
|
|
1180
1267
|
|
|
1181
1268
|
:param key:
|
|
1269
|
+
:type key: int
|
|
1182
1270
|
:param value:
|
|
1271
|
+
:type value: float
|
|
1272
|
+
:return:
|
|
1273
|
+
:rtype: float
|
|
1183
1274
|
"""
|
|
1184
1275
|
...
|
|
1185
1276
|
|
|
1186
1277
|
def __add__(
|
|
1187
1278
|
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1188
|
-
) ->
|
|
1279
|
+
) -> Quaternion:
|
|
1189
1280
|
"""
|
|
1190
1281
|
|
|
1191
1282
|
:param other:
|
|
@@ -1197,7 +1288,7 @@ class Quaternion:
|
|
|
1197
1288
|
|
|
1198
1289
|
def __sub__(
|
|
1199
1290
|
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1200
|
-
) ->
|
|
1291
|
+
) -> Quaternion:
|
|
1201
1292
|
"""
|
|
1202
1293
|
|
|
1203
1294
|
:param other:
|
|
@@ -1208,12 +1299,12 @@ class Quaternion:
|
|
|
1208
1299
|
...
|
|
1209
1300
|
|
|
1210
1301
|
def __mul__(
|
|
1211
|
-
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1212
|
-
) ->
|
|
1302
|
+
self, other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1303
|
+
) -> Quaternion:
|
|
1213
1304
|
"""
|
|
1214
1305
|
|
|
1215
1306
|
:param other:
|
|
1216
|
-
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1307
|
+
:type other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1217
1308
|
:return:
|
|
1218
1309
|
:rtype: Quaternion
|
|
1219
1310
|
"""
|
|
@@ -1224,9 +1315,7 @@ class Quaternion:
|
|
|
1224
1315
|
other: typing.Union[
|
|
1225
1316
|
typing.Sequence[float], Vector, typing.Sequence[float], Quaternion
|
|
1226
1317
|
],
|
|
1227
|
-
) -> typing.Union[
|
|
1228
|
-
typing.Sequence[float], Vector, typing.Sequence[float], Quaternion
|
|
1229
|
-
]:
|
|
1318
|
+
) -> typing.Union[Vector, Quaternion]:
|
|
1230
1319
|
"""
|
|
1231
1320
|
|
|
1232
1321
|
:param other:
|
|
@@ -1238,7 +1327,7 @@ class Quaternion:
|
|
|
1238
1327
|
|
|
1239
1328
|
def __radd__(
|
|
1240
1329
|
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1241
|
-
) ->
|
|
1330
|
+
) -> Quaternion:
|
|
1242
1331
|
"""
|
|
1243
1332
|
|
|
1244
1333
|
:param other:
|
|
@@ -1250,7 +1339,7 @@ class Quaternion:
|
|
|
1250
1339
|
|
|
1251
1340
|
def __rsub__(
|
|
1252
1341
|
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1253
|
-
) ->
|
|
1342
|
+
) -> Quaternion:
|
|
1254
1343
|
"""
|
|
1255
1344
|
|
|
1256
1345
|
:param other:
|
|
@@ -1261,12 +1350,12 @@ class Quaternion:
|
|
|
1261
1350
|
...
|
|
1262
1351
|
|
|
1263
1352
|
def __rmul__(
|
|
1264
|
-
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1265
|
-
) ->
|
|
1353
|
+
self, other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1354
|
+
) -> Quaternion:
|
|
1266
1355
|
"""
|
|
1267
1356
|
|
|
1268
1357
|
:param other:
|
|
1269
|
-
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1358
|
+
:type other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1270
1359
|
:return:
|
|
1271
1360
|
:rtype: Quaternion
|
|
1272
1361
|
"""
|
|
@@ -1274,7 +1363,7 @@ class Quaternion:
|
|
|
1274
1363
|
|
|
1275
1364
|
def __rmatmul__(
|
|
1276
1365
|
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
1277
|
-
) ->
|
|
1366
|
+
) -> Vector:
|
|
1278
1367
|
"""
|
|
1279
1368
|
|
|
1280
1369
|
:param other:
|
|
@@ -1285,12 +1374,12 @@ class Quaternion:
|
|
|
1285
1374
|
...
|
|
1286
1375
|
|
|
1287
1376
|
def __imul__(
|
|
1288
|
-
self, other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1289
|
-
) ->
|
|
1377
|
+
self, other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1378
|
+
) -> Quaternion:
|
|
1290
1379
|
"""
|
|
1291
1380
|
|
|
1292
1381
|
:param other:
|
|
1293
|
-
:type other: typing.Union[typing.Sequence[float], Quaternion]
|
|
1382
|
+
:type other: typing.Union[int, float, typing.Sequence[float], Quaternion]
|
|
1294
1383
|
:return:
|
|
1295
1384
|
:rtype: Quaternion
|
|
1296
1385
|
"""
|
|
@@ -1298,7 +1387,7 @@ class Quaternion:
|
|
|
1298
1387
|
|
|
1299
1388
|
def __imatmul__(
|
|
1300
1389
|
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
1301
|
-
) ->
|
|
1390
|
+
) -> Vector:
|
|
1302
1391
|
"""
|
|
1303
1392
|
|
|
1304
1393
|
:param other:
|
|
@@ -1329,20 +1418,32 @@ class Vector:
|
|
|
1329
1418
|
:type: bool
|
|
1330
1419
|
"""
|
|
1331
1420
|
|
|
1332
|
-
length:
|
|
1333
|
-
""" Vector Length.
|
|
1421
|
+
length: float
|
|
1422
|
+
""" Vector Length.
|
|
1423
|
+
|
|
1424
|
+
:type: float
|
|
1425
|
+
"""
|
|
1426
|
+
|
|
1427
|
+
length_squared: float
|
|
1428
|
+
""" Vector length squared (v.dot(v)).
|
|
1334
1429
|
|
|
1335
|
-
|
|
1336
|
-
"""
|
|
1430
|
+
:type: float
|
|
1431
|
+
"""
|
|
1337
1432
|
|
|
1338
|
-
magnitude:
|
|
1339
|
-
""" Vector Length.
|
|
1433
|
+
magnitude: float
|
|
1434
|
+
""" Vector Length.
|
|
1435
|
+
|
|
1436
|
+
:type: float
|
|
1437
|
+
"""
|
|
1340
1438
|
|
|
1341
1439
|
owner: typing.Any
|
|
1342
1440
|
""" The item this is wrapping or None (read-only)."""
|
|
1343
1441
|
|
|
1344
|
-
w:
|
|
1345
|
-
""" Vector W axis (4D Vectors only).
|
|
1442
|
+
w: float
|
|
1443
|
+
""" Vector W axis (4D Vectors only).
|
|
1444
|
+
|
|
1445
|
+
:type: float
|
|
1446
|
+
"""
|
|
1346
1447
|
|
|
1347
1448
|
ww: typing.Any
|
|
1348
1449
|
""" Undocumented, consider contributing."""
|
|
@@ -1596,8 +1697,11 @@ class Vector:
|
|
|
1596
1697
|
wzzz: typing.Any
|
|
1597
1698
|
""" Undocumented, consider contributing."""
|
|
1598
1699
|
|
|
1599
|
-
x:
|
|
1600
|
-
""" Vector X axis.
|
|
1700
|
+
x: float
|
|
1701
|
+
""" Vector X axis.
|
|
1702
|
+
|
|
1703
|
+
:type: float
|
|
1704
|
+
"""
|
|
1601
1705
|
|
|
1602
1706
|
xw: typing.Any
|
|
1603
1707
|
""" Undocumented, consider contributing."""
|
|
@@ -1851,8 +1955,11 @@ class Vector:
|
|
|
1851
1955
|
xzzz: typing.Any
|
|
1852
1956
|
""" Undocumented, consider contributing."""
|
|
1853
1957
|
|
|
1854
|
-
y:
|
|
1855
|
-
""" Vector Y axis.
|
|
1958
|
+
y: float
|
|
1959
|
+
""" Vector Y axis.
|
|
1960
|
+
|
|
1961
|
+
:type: float
|
|
1962
|
+
"""
|
|
1856
1963
|
|
|
1857
1964
|
yw: typing.Any
|
|
1858
1965
|
""" Undocumented, consider contributing."""
|
|
@@ -2106,8 +2213,11 @@ class Vector:
|
|
|
2106
2213
|
yzzz: typing.Any
|
|
2107
2214
|
""" Undocumented, consider contributing."""
|
|
2108
2215
|
|
|
2109
|
-
z:
|
|
2110
|
-
""" Vector Z axis (3D Vectors only).
|
|
2216
|
+
z: float
|
|
2217
|
+
""" Vector Z axis (3D Vectors only).
|
|
2218
|
+
|
|
2219
|
+
:type: float
|
|
2220
|
+
"""
|
|
2111
2221
|
|
|
2112
2222
|
zw: typing.Any
|
|
2113
2223
|
""" Undocumented, consider contributing."""
|
|
@@ -2362,40 +2472,49 @@ class Vector:
|
|
|
2362
2472
|
""" Undocumented, consider contributing."""
|
|
2363
2473
|
|
|
2364
2474
|
@classmethod
|
|
2365
|
-
def Fill(cls, size, fill=0.0):
|
|
2475
|
+
def Fill(cls, size: int, fill: float = 0.0):
|
|
2366
2476
|
"""Create a vector of length size with all values set to fill.
|
|
2367
2477
|
|
|
2368
2478
|
:param size: The length of the vector to be created.
|
|
2479
|
+
:type size: int
|
|
2369
2480
|
:param fill: The value used to fill the vector.
|
|
2481
|
+
:type fill: float
|
|
2370
2482
|
"""
|
|
2371
2483
|
...
|
|
2372
2484
|
|
|
2373
2485
|
@classmethod
|
|
2374
|
-
def Linspace(cls, start, stop, size):
|
|
2486
|
+
def Linspace(cls, start: int, stop: int, size: int):
|
|
2375
2487
|
"""Create a vector of the specified size which is filled with linearly spaced values between start and stop values.
|
|
2376
2488
|
|
|
2377
2489
|
:param start: The start of the range used to fill the vector.
|
|
2490
|
+
:type start: int
|
|
2378
2491
|
:param stop: The end of the range used to fill the vector.
|
|
2492
|
+
:type stop: int
|
|
2379
2493
|
:param size: The size of the vector to be created.
|
|
2494
|
+
:type size: int
|
|
2380
2495
|
"""
|
|
2381
2496
|
...
|
|
2382
2497
|
|
|
2383
2498
|
@classmethod
|
|
2384
|
-
def Range(cls, start, stop, step=1):
|
|
2499
|
+
def Range(cls, start: int, stop: int, step: int = 1):
|
|
2385
2500
|
"""Create a filled with a range of values.
|
|
2386
2501
|
|
|
2387
2502
|
:param start: The start of the range used to fill the vector.
|
|
2503
|
+
:type start: int
|
|
2388
2504
|
:param stop: The end of the range used to fill the vector.
|
|
2505
|
+
:type stop: int
|
|
2389
2506
|
:param step: The step between successive values in the vector.
|
|
2507
|
+
:type step: int
|
|
2390
2508
|
"""
|
|
2391
2509
|
...
|
|
2392
2510
|
|
|
2393
2511
|
@classmethod
|
|
2394
|
-
def Repeat(cls, vector, size):
|
|
2512
|
+
def Repeat(cls, vector, size: int):
|
|
2395
2513
|
"""Create a vector by repeating the values in vector until the required size is reached.
|
|
2396
2514
|
|
|
2397
2515
|
:param vector:
|
|
2398
2516
|
:param size: The size of the vector to be created.
|
|
2517
|
+
:type size: int
|
|
2399
2518
|
"""
|
|
2400
2519
|
...
|
|
2401
2520
|
|
|
@@ -2403,7 +2522,7 @@ class Vector:
|
|
|
2403
2522
|
self,
|
|
2404
2523
|
other: typing.Union[typing.Sequence[float], Vector],
|
|
2405
2524
|
fallback: typing.Any = None,
|
|
2406
|
-
) ->
|
|
2525
|
+
) -> float:
|
|
2407
2526
|
"""Return the angle between two vectors.
|
|
2408
2527
|
|
|
2409
2528
|
:param other: another vector to compare the angle with
|
|
@@ -2412,12 +2531,13 @@ class Vector:
|
|
|
2412
2531
|
(instead of raising a `ValueError`).
|
|
2413
2532
|
:type fallback: typing.Any
|
|
2414
2533
|
:return: angle in radians or fallback when given
|
|
2534
|
+
:rtype: float
|
|
2415
2535
|
"""
|
|
2416
2536
|
...
|
|
2417
2537
|
|
|
2418
2538
|
def angle_signed(
|
|
2419
2539
|
self, other: typing.Union[typing.Sequence[float], Vector], fallback: typing.Any
|
|
2420
|
-
) ->
|
|
2540
|
+
) -> float:
|
|
2421
2541
|
"""Return the signed angle between two 2D vectors (clockwise is positive).
|
|
2422
2542
|
|
|
2423
2543
|
:param other: another vector to compare the angle with
|
|
@@ -2426,10 +2546,11 @@ class Vector:
|
|
|
2426
2546
|
(instead of raising a `ValueError`).
|
|
2427
2547
|
:type fallback: typing.Any
|
|
2428
2548
|
:return: angle in radians or fallback when given
|
|
2549
|
+
:rtype: float
|
|
2429
2550
|
"""
|
|
2430
2551
|
...
|
|
2431
2552
|
|
|
2432
|
-
def copy(self):
|
|
2553
|
+
def copy(self) -> Vector:
|
|
2433
2554
|
"""Returns a copy of this vector.
|
|
2434
2555
|
|
|
2435
2556
|
:return: A copy of the vector.
|
|
@@ -2437,9 +2558,7 @@ class Vector:
|
|
|
2437
2558
|
"""
|
|
2438
2559
|
...
|
|
2439
2560
|
|
|
2440
|
-
def cross(
|
|
2441
|
-
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2442
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2561
|
+
def cross(self, other: typing.Union[typing.Sequence[float], Vector]) -> Vector:
|
|
2443
2562
|
"""Return the cross product of this vector and another.
|
|
2444
2563
|
|
|
2445
2564
|
:param other: The other vector to perform the cross product with.
|
|
@@ -2449,14 +2568,13 @@ class Vector:
|
|
|
2449
2568
|
"""
|
|
2450
2569
|
...
|
|
2451
2570
|
|
|
2452
|
-
def dot(
|
|
2453
|
-
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2454
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2571
|
+
def dot(self, other: typing.Union[typing.Sequence[float], Vector]) -> float:
|
|
2455
2572
|
"""Return the dot product of this vector and another.
|
|
2456
2573
|
|
|
2457
2574
|
:param other: The other vector to perform the dot product with.
|
|
2458
2575
|
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2459
2576
|
:return: The dot product.
|
|
2577
|
+
:rtype: float
|
|
2460
2578
|
"""
|
|
2461
2579
|
...
|
|
2462
2580
|
|
|
@@ -2467,12 +2585,15 @@ class Vector:
|
|
|
2467
2585
|
"""
|
|
2468
2586
|
...
|
|
2469
2587
|
|
|
2470
|
-
def lerp(
|
|
2588
|
+
def lerp(
|
|
2589
|
+
self, other: typing.Union[typing.Sequence[float], Vector], factor: float
|
|
2590
|
+
) -> Vector:
|
|
2471
2591
|
"""Returns the interpolation of two vectors.
|
|
2472
2592
|
|
|
2473
2593
|
:param other: value to interpolate with.
|
|
2474
2594
|
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2475
2595
|
:param factor: The interpolation value in [0.0, 1.0].
|
|
2596
|
+
:type factor: float
|
|
2476
2597
|
:return: The interpolated vector.
|
|
2477
2598
|
:rtype: Vector
|
|
2478
2599
|
"""
|
|
@@ -2502,9 +2623,7 @@ class Vector:
|
|
|
2502
2623
|
"""
|
|
2503
2624
|
...
|
|
2504
2625
|
|
|
2505
|
-
def project(
|
|
2506
|
-
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2507
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2626
|
+
def project(self, other: typing.Union[typing.Sequence[float], Vector]) -> Vector:
|
|
2508
2627
|
"""Return the projection of this vector onto the other.
|
|
2509
2628
|
|
|
2510
2629
|
:param other: second vector.
|
|
@@ -2514,9 +2633,7 @@ class Vector:
|
|
|
2514
2633
|
"""
|
|
2515
2634
|
...
|
|
2516
2635
|
|
|
2517
|
-
def reflect(
|
|
2518
|
-
self, mirror: typing.Union[typing.Sequence[float], Vector]
|
|
2519
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2636
|
+
def reflect(self, mirror: typing.Union[typing.Sequence[float], Vector]) -> Vector:
|
|
2520
2637
|
"""Return the reflection vector from the mirror argument.
|
|
2521
2638
|
|
|
2522
2639
|
:param mirror: This vector could be a normal from the reflecting surface.
|
|
@@ -2545,7 +2662,7 @@ class Vector:
|
|
|
2545
2662
|
"""Resize the vector to 4D (x, y, z, w)."""
|
|
2546
2663
|
...
|
|
2547
2664
|
|
|
2548
|
-
def resized(self, size=3):
|
|
2665
|
+
def resized(self, size=3) -> Vector:
|
|
2549
2666
|
"""Return a resized copy of the vector with size number of elements.
|
|
2550
2667
|
|
|
2551
2668
|
:param size:
|
|
@@ -2574,7 +2691,7 @@ class Vector:
|
|
|
2574
2691
|
|
|
2575
2692
|
def rotation_difference(
|
|
2576
2693
|
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2577
|
-
) ->
|
|
2694
|
+
) -> Quaternion:
|
|
2578
2695
|
"""Returns a quaternion representing the rotational difference between this
|
|
2579
2696
|
vector and another.
|
|
2580
2697
|
|
|
@@ -2588,14 +2705,15 @@ class Vector:
|
|
|
2588
2705
|
def slerp(
|
|
2589
2706
|
self,
|
|
2590
2707
|
other: typing.Union[typing.Sequence[float], Vector],
|
|
2591
|
-
factor,
|
|
2708
|
+
factor: float,
|
|
2592
2709
|
fallback: typing.Any = None,
|
|
2593
|
-
) ->
|
|
2710
|
+
) -> Vector:
|
|
2594
2711
|
"""Returns the interpolation of two non-zero vectors (spherical coordinates).
|
|
2595
2712
|
|
|
2596
2713
|
:param other: value to interpolate with.
|
|
2597
2714
|
:type other: typing.Union[typing.Sequence[float], Vector]
|
|
2598
2715
|
:param factor: The interpolation value typically in [0.0, 1.0].
|
|
2716
|
+
:type factor: float
|
|
2599
2717
|
:param fallback: return this when the vector can't be calculated (zero length vector or direct opposites),
|
|
2600
2718
|
(instead of raising a `ValueError`).
|
|
2601
2719
|
:type fallback: typing.Any
|
|
@@ -2628,7 +2746,7 @@ class Vector:
|
|
|
2628
2746
|
"""
|
|
2629
2747
|
...
|
|
2630
2748
|
|
|
2631
|
-
def to_track_quat(self, track: str, up: str) ->
|
|
2749
|
+
def to_track_quat(self, track: str, up: str) -> Quaternion:
|
|
2632
2750
|
"""Return a quaternion rotation from the vector and the track and up axis.
|
|
2633
2751
|
|
|
2634
2752
|
:param track: Track axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z'].
|
|
@@ -2640,10 +2758,11 @@ class Vector:
|
|
|
2640
2758
|
"""
|
|
2641
2759
|
...
|
|
2642
2760
|
|
|
2643
|
-
def to_tuple(self, precision
|
|
2761
|
+
def to_tuple(self, precision: int = -1) -> typing.Tuple:
|
|
2644
2762
|
"""Return this vector as a tuple with.
|
|
2645
2763
|
|
|
2646
2764
|
:param precision: The number to round the value to in [-1, 21].
|
|
2765
|
+
:type precision: int
|
|
2647
2766
|
:return: the values of the vector rounded by precision
|
|
2648
2767
|
:rtype: typing.Tuple
|
|
2649
2768
|
"""
|
|
@@ -2660,26 +2779,37 @@ class Vector:
|
|
|
2660
2779
|
"""
|
|
2661
2780
|
...
|
|
2662
2781
|
|
|
2663
|
-
def __len__(self):
|
|
2664
|
-
"""
|
|
2782
|
+
def __len__(self) -> int:
|
|
2783
|
+
"""
|
|
2784
|
+
|
|
2785
|
+
:return:
|
|
2786
|
+
:rtype: int
|
|
2787
|
+
"""
|
|
2665
2788
|
...
|
|
2666
2789
|
|
|
2667
|
-
def __getitem__(self, key):
|
|
2790
|
+
def __getitem__(self, key: int) -> float:
|
|
2668
2791
|
"""
|
|
2669
2792
|
|
|
2670
2793
|
:param key:
|
|
2794
|
+
:type key: int
|
|
2795
|
+
:return:
|
|
2796
|
+
:rtype: float
|
|
2671
2797
|
"""
|
|
2672
2798
|
...
|
|
2673
2799
|
|
|
2674
|
-
def __setitem__(self, key, value):
|
|
2800
|
+
def __setitem__(self, key: int, value: float) -> float:
|
|
2675
2801
|
"""
|
|
2676
2802
|
|
|
2677
2803
|
:param key:
|
|
2804
|
+
:type key: int
|
|
2678
2805
|
:param value:
|
|
2806
|
+
:type value: float
|
|
2807
|
+
:return:
|
|
2808
|
+
:rtype: float
|
|
2679
2809
|
"""
|
|
2680
2810
|
...
|
|
2681
2811
|
|
|
2682
|
-
def __neg__(self):
|
|
2812
|
+
def __neg__(self) -> Vector:
|
|
2683
2813
|
"""
|
|
2684
2814
|
|
|
2685
2815
|
:return:
|
|
@@ -2687,9 +2817,7 @@ class Vector:
|
|
|
2687
2817
|
"""
|
|
2688
2818
|
...
|
|
2689
2819
|
|
|
2690
|
-
def __add__(
|
|
2691
|
-
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2692
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2820
|
+
def __add__(self, other: typing.Union[typing.Sequence[float], Vector]) -> Vector:
|
|
2693
2821
|
"""
|
|
2694
2822
|
|
|
2695
2823
|
:param other:
|
|
@@ -2699,9 +2827,7 @@ class Vector:
|
|
|
2699
2827
|
"""
|
|
2700
2828
|
...
|
|
2701
2829
|
|
|
2702
|
-
def __sub__(
|
|
2703
|
-
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2704
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2830
|
+
def __sub__(self, other: typing.Union[typing.Sequence[float], Vector]) -> Vector:
|
|
2705
2831
|
"""
|
|
2706
2832
|
|
|
2707
2833
|
:param other:
|
|
@@ -2711,27 +2837,27 @@ class Vector:
|
|
|
2711
2837
|
"""
|
|
2712
2838
|
...
|
|
2713
2839
|
|
|
2714
|
-
def __mul__(self, other):
|
|
2840
|
+
def __mul__(self, other: typing.Union[int, float]) -> Vector:
|
|
2715
2841
|
"""
|
|
2716
2842
|
|
|
2717
2843
|
:param other:
|
|
2844
|
+
:type other: typing.Union[int, float]
|
|
2718
2845
|
:return:
|
|
2719
2846
|
:rtype: Vector
|
|
2720
2847
|
"""
|
|
2721
2848
|
...
|
|
2722
2849
|
|
|
2723
|
-
def __truediv__(self, other):
|
|
2850
|
+
def __truediv__(self, other: typing.Union[int, float]) -> Vector:
|
|
2724
2851
|
"""
|
|
2725
2852
|
|
|
2726
2853
|
:param other:
|
|
2854
|
+
:type other: typing.Union[int, float]
|
|
2727
2855
|
:return:
|
|
2728
2856
|
:rtype: Vector
|
|
2729
2857
|
"""
|
|
2730
2858
|
...
|
|
2731
2859
|
|
|
2732
|
-
def __matmul__(
|
|
2733
|
-
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
2734
|
-
) -> typing.Union[typing.Sequence[float], Matrix]:
|
|
2860
|
+
def __matmul__(self, other: typing.Union[typing.Sequence[float], Matrix]) -> Vector:
|
|
2735
2861
|
"""
|
|
2736
2862
|
|
|
2737
2863
|
:param other:
|
|
@@ -2741,9 +2867,7 @@ class Vector:
|
|
|
2741
2867
|
"""
|
|
2742
2868
|
...
|
|
2743
2869
|
|
|
2744
|
-
def __radd__(
|
|
2745
|
-
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2746
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2870
|
+
def __radd__(self, other: typing.Union[typing.Sequence[float], Vector]) -> Vector:
|
|
2747
2871
|
"""
|
|
2748
2872
|
|
|
2749
2873
|
:param other:
|
|
@@ -2753,9 +2877,7 @@ class Vector:
|
|
|
2753
2877
|
"""
|
|
2754
2878
|
...
|
|
2755
2879
|
|
|
2756
|
-
def __rsub__(
|
|
2757
|
-
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2758
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2880
|
+
def __rsub__(self, other: typing.Union[typing.Sequence[float], Vector]) -> Vector:
|
|
2759
2881
|
"""
|
|
2760
2882
|
|
|
2761
2883
|
:param other:
|
|
@@ -2765,19 +2887,21 @@ class Vector:
|
|
|
2765
2887
|
"""
|
|
2766
2888
|
...
|
|
2767
2889
|
|
|
2768
|
-
def __rmul__(self, other):
|
|
2890
|
+
def __rmul__(self, other: typing.Union[int, float]) -> Vector:
|
|
2769
2891
|
"""
|
|
2770
2892
|
|
|
2771
2893
|
:param other:
|
|
2894
|
+
:type other: typing.Union[int, float]
|
|
2772
2895
|
:return:
|
|
2773
2896
|
:rtype: Vector
|
|
2774
2897
|
"""
|
|
2775
2898
|
...
|
|
2776
2899
|
|
|
2777
|
-
def __rtruediv__(self, other):
|
|
2900
|
+
def __rtruediv__(self, other: typing.Union[int, float]) -> Vector:
|
|
2778
2901
|
"""
|
|
2779
2902
|
|
|
2780
2903
|
:param other:
|
|
2904
|
+
:type other: typing.Union[int, float]
|
|
2781
2905
|
:return:
|
|
2782
2906
|
:rtype: Vector
|
|
2783
2907
|
"""
|
|
@@ -2785,7 +2909,7 @@ class Vector:
|
|
|
2785
2909
|
|
|
2786
2910
|
def __rmatmul__(
|
|
2787
2911
|
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
2788
|
-
) ->
|
|
2912
|
+
) -> Vector:
|
|
2789
2913
|
"""
|
|
2790
2914
|
|
|
2791
2915
|
:param other:
|
|
@@ -2795,9 +2919,7 @@ class Vector:
|
|
|
2795
2919
|
"""
|
|
2796
2920
|
...
|
|
2797
2921
|
|
|
2798
|
-
def __iadd__(
|
|
2799
|
-
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2800
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2922
|
+
def __iadd__(self, other: typing.Union[typing.Sequence[float], Vector]) -> Vector:
|
|
2801
2923
|
"""
|
|
2802
2924
|
|
|
2803
2925
|
:param other:
|
|
@@ -2807,9 +2929,7 @@ class Vector:
|
|
|
2807
2929
|
"""
|
|
2808
2930
|
...
|
|
2809
2931
|
|
|
2810
|
-
def __isub__(
|
|
2811
|
-
self, other: typing.Union[typing.Sequence[float], Vector]
|
|
2812
|
-
) -> typing.Union[typing.Sequence[float], Vector]:
|
|
2932
|
+
def __isub__(self, other: typing.Union[typing.Sequence[float], Vector]) -> Vector:
|
|
2813
2933
|
"""
|
|
2814
2934
|
|
|
2815
2935
|
:param other:
|
|
@@ -2819,19 +2939,21 @@ class Vector:
|
|
|
2819
2939
|
"""
|
|
2820
2940
|
...
|
|
2821
2941
|
|
|
2822
|
-
def __imul__(self, other):
|
|
2942
|
+
def __imul__(self, other: typing.Union[int, float]) -> Vector:
|
|
2823
2943
|
"""
|
|
2824
2944
|
|
|
2825
2945
|
:param other:
|
|
2946
|
+
:type other: typing.Union[int, float]
|
|
2826
2947
|
:return:
|
|
2827
2948
|
:rtype: Vector
|
|
2828
2949
|
"""
|
|
2829
2950
|
...
|
|
2830
2951
|
|
|
2831
|
-
def __itruediv__(self, other):
|
|
2952
|
+
def __itruediv__(self, other: typing.Union[int, float]) -> Vector:
|
|
2832
2953
|
"""
|
|
2833
2954
|
|
|
2834
2955
|
:param other:
|
|
2956
|
+
:type other: typing.Union[int, float]
|
|
2835
2957
|
:return:
|
|
2836
2958
|
:rtype: Vector
|
|
2837
2959
|
"""
|
|
@@ -2839,7 +2961,7 @@ class Vector:
|
|
|
2839
2961
|
|
|
2840
2962
|
def __imatmul__(
|
|
2841
2963
|
self, other: typing.Union[typing.Sequence[float], Matrix]
|
|
2842
|
-
) ->
|
|
2964
|
+
) -> Vector:
|
|
2843
2965
|
"""
|
|
2844
2966
|
|
|
2845
2967
|
:param other:
|