fake-bpy-module 20241228__py3-none-any.whl → 20241230__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.
- addon_utils/__init__.pyi +9 -5
- bl_ui/generic_ui_list/__init__.pyi +2 -2
- bmesh/types/__init__.pyi +52 -23
- bmesh/utils/__init__.pyi +4 -2
- bpy/__init__.pyi +1 -1
- bpy/app/translations/__init__.pyi +12 -12
- bpy/path/__init__.pyi +2 -1
- bpy/props/__init__.pyi +87 -63
- bpy/types/__init__.pyi +278 -275
- bpy/utils/__init__.pyi +6 -4
- bpy/utils/units/__init__.pyi +2 -2
- bpy_extras/anim_utils/__init__.pyi +10 -7
- bpy_extras/image_utils/__init__.pyi +4 -4
- bpy_extras/io_utils/__init__.pyi +6 -5
- bpy_extras/mesh_utils/__init__.pyi +9 -3
- bpy_extras/object_utils/__init__.pyi +6 -6
- bpy_extras/view3d_utils/__init__.pyi +4 -3
- {fake_bpy_module-20241228.dist-info → fake_bpy_module-20241230.dist-info}/METADATA +1 -1
- {fake_bpy_module-20241228.dist-info → fake_bpy_module-20241230.dist-info}/RECORD +35 -35
- freestyle/chainingiterators/__init__.pyi +4 -4
- freestyle/types/__init__.pyi +6 -6
- freestyle/utils/__init__.pyi +1 -1
- gpu/matrix/__init__.pyi +4 -2
- gpu/types/__init__.pyi +39 -12
- gpu_extras/batch/__init__.pyi +9 -2
- gpu_extras/presets/__init__.pyi +10 -2
- imbuf/__init__.pyi +2 -2
- mathutils/__init__.pyi +31 -12
- mathutils/bvhtree/__init__.pyi +15 -5
- mathutils/geometry/__init__.pyi +41 -22
- mathutils/interpolate/__init__.pyi +4 -1
- mathutils/kdtree/__init__.pyi +13 -5
- rna_info/__init__.pyi +2 -2
- {fake_bpy_module-20241228.dist-info → fake_bpy_module-20241230.dist-info}/WHEEL +0 -0
- {fake_bpy_module-20241228.dist-info → fake_bpy_module-20241230.dist-info}/top_level.txt +0 -0
gpu/types/__init__.pyi
CHANGED
|
@@ -87,11 +87,17 @@ class GPUFrameBuffer:
|
|
|
87
87
|
def bind(self):
|
|
88
88
|
"""Context manager to ensure balanced bind calls, even in the case of an error."""
|
|
89
89
|
|
|
90
|
-
def clear(
|
|
90
|
+
def clear(
|
|
91
|
+
self,
|
|
92
|
+
color: collections.abc.Sequence[float] | None = None,
|
|
93
|
+
depth: float | None = None,
|
|
94
|
+
stencil: int | None = None,
|
|
95
|
+
):
|
|
91
96
|
"""Fill color, depth and stencil textures with specific value.
|
|
92
97
|
Common values: color=(0.0, 0.0, 0.0, 1.0), depth=1.0, stencil=0.
|
|
93
98
|
|
|
94
99
|
:param color: Sequence of 3 or 4 floats representing (r, g, b, a).
|
|
100
|
+
:type color: collections.abc.Sequence[float] | None
|
|
95
101
|
:param depth: depth value.
|
|
96
102
|
:type depth: float | None
|
|
97
103
|
:param stencil: stencil value.
|
|
@@ -270,11 +276,11 @@ class GPUShader:
|
|
|
270
276
|
:rtype: int
|
|
271
277
|
"""
|
|
272
278
|
|
|
273
|
-
def attrs_info_get(self) -> tuple[tuple[str, str], int]:
|
|
279
|
+
def attrs_info_get(self) -> tuple[tuple[str, str | None], int]:
|
|
274
280
|
"""Information about the attributes used in the Shader.
|
|
275
281
|
|
|
276
282
|
:return: tuples containing information about the attributes in order (name, type)
|
|
277
|
-
:rtype: tuple[tuple[str, str], int]
|
|
283
|
+
:rtype: tuple[tuple[str, str | None], int]
|
|
278
284
|
"""
|
|
279
285
|
|
|
280
286
|
def bind(self):
|
|
@@ -313,22 +319,22 @@ class GPUShader:
|
|
|
313
319
|
:rtype: int
|
|
314
320
|
"""
|
|
315
321
|
|
|
316
|
-
def uniform_bool(self, name: str, value: bool):
|
|
322
|
+
def uniform_bool(self, name: str, value: bool | collections.abc.Sequence[bool]):
|
|
317
323
|
"""Specify the value of a uniform variable for the current program object.
|
|
318
324
|
|
|
319
325
|
:param name: Name of the uniform variable whose value is to be changed.
|
|
320
326
|
:type name: str
|
|
321
327
|
:param value: Value that will be used to update the specified uniform variable.
|
|
322
|
-
:type value: bool
|
|
328
|
+
:type value: bool | collections.abc.Sequence[bool]
|
|
323
329
|
"""
|
|
324
330
|
|
|
325
|
-
def uniform_float(self, name: str, value: float):
|
|
331
|
+
def uniform_float(self, name: str, value: collections.abc.Sequence[float] | float):
|
|
326
332
|
"""Specify the value of a uniform variable for the current program object.
|
|
327
333
|
|
|
328
334
|
:param name: Name of the uniform variable whose value is to be changed.
|
|
329
335
|
:type name: str
|
|
330
336
|
:param value: Value that will be used to update the specified uniform variable.
|
|
331
|
-
:type value: float
|
|
337
|
+
:type value: collections.abc.Sequence[float] | float
|
|
332
338
|
"""
|
|
333
339
|
|
|
334
340
|
def uniform_from_name(self, name: str) -> int:
|
|
@@ -340,12 +346,13 @@ class GPUShader:
|
|
|
340
346
|
:rtype: int
|
|
341
347
|
"""
|
|
342
348
|
|
|
343
|
-
def uniform_int(self, name: str, seq):
|
|
349
|
+
def uniform_int(self, name: str, seq: collections.abc.Sequence[int]):
|
|
344
350
|
"""Specify the value of a uniform variable for the current program object.
|
|
345
351
|
|
|
346
352
|
:param name: name of the uniform variable whose value is to be changed.
|
|
347
353
|
:type name: str
|
|
348
354
|
:param seq: Value that will be used to update the specified uniform variable.
|
|
355
|
+
:type seq: collections.abc.Sequence[int]
|
|
349
356
|
"""
|
|
350
357
|
|
|
351
358
|
def uniform_sampler(self, name: str, texture: GPUTexture):
|
|
@@ -357,12 +364,19 @@ class GPUShader:
|
|
|
357
364
|
:type texture: GPUTexture
|
|
358
365
|
"""
|
|
359
366
|
|
|
360
|
-
def uniform_vector_float(
|
|
367
|
+
def uniform_vector_float(
|
|
368
|
+
self,
|
|
369
|
+
location: int,
|
|
370
|
+
buffer: collections.abc.Sequence[float],
|
|
371
|
+
length: int,
|
|
372
|
+
count: int,
|
|
373
|
+
):
|
|
361
374
|
"""Set the buffer to fill the uniform.
|
|
362
375
|
|
|
363
376
|
:param location: Location of the uniform variable to be modified.
|
|
364
377
|
:type location: int
|
|
365
378
|
:param buffer: The data that should be set. Can support the buffer protocol.
|
|
379
|
+
:type buffer: collections.abc.Sequence[float]
|
|
366
380
|
:param length: Size of the uniform data type:
|
|
367
381
|
|
|
368
382
|
1: float
|
|
@@ -974,13 +988,18 @@ class GPUTexture:
|
|
|
974
988
|
:type: int
|
|
975
989
|
"""
|
|
976
990
|
|
|
977
|
-
def clear(
|
|
991
|
+
def clear(
|
|
992
|
+
self,
|
|
993
|
+
format: str = "FLOAT",
|
|
994
|
+
value: collections.abc.Sequence[float] = (0.0, 0.0, 0.0, 1.0),
|
|
995
|
+
):
|
|
978
996
|
"""Fill texture with specific value.
|
|
979
997
|
|
|
980
998
|
:param format: The format that describes the content of a single item.
|
|
981
999
|
Possible values are FLOAT, INT, UINT, UBYTE, UINT_24_8 and 10_11_11_REV.
|
|
982
1000
|
:type format: str
|
|
983
1001
|
:param value: Sequence each representing the value to fill. Sizes 1..4 are supported.
|
|
1002
|
+
:type value: collections.abc.Sequence[float]
|
|
984
1003
|
"""
|
|
985
1004
|
|
|
986
1005
|
def read(self):
|
|
@@ -998,13 +1017,21 @@ class GPUUniformBuf:
|
|
|
998
1017
|
class GPUVertBuf:
|
|
999
1018
|
"""Contains a VBO."""
|
|
1000
1019
|
|
|
1001
|
-
def attr_fill(
|
|
1020
|
+
def attr_fill(
|
|
1021
|
+
self,
|
|
1022
|
+
id: int | str,
|
|
1023
|
+
data: Buffer
|
|
1024
|
+
| collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
1025
|
+
| collections.abc.Sequence[collections.abc.Sequence[int]]
|
|
1026
|
+
| collections.abc.Sequence[float]
|
|
1027
|
+
| collections.abc.Sequence[int],
|
|
1028
|
+
):
|
|
1002
1029
|
"""Insert data into the buffer for a single attribute.
|
|
1003
1030
|
|
|
1004
1031
|
:param id: Either the name or the id of the attribute.
|
|
1005
1032
|
:type id: int | str
|
|
1006
1033
|
:param data: Buffer or sequence of data that should be stored in the buffer
|
|
1007
|
-
:type data: Buffer
|
|
1034
|
+
:type data: Buffer | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[collections.abc.Sequence[int]] | collections.abc.Sequence[float] | collections.abc.Sequence[int]
|
|
1008
1035
|
"""
|
|
1009
1036
|
|
|
1010
1037
|
class GPUVertFormat:
|
gpu_extras/batch/__init__.pyi
CHANGED
|
@@ -7,7 +7,14 @@ import gpu.types
|
|
|
7
7
|
def batch_for_shader(
|
|
8
8
|
shader: gpu.types.GPUShader,
|
|
9
9
|
type: str,
|
|
10
|
-
content: dict[
|
|
10
|
+
content: dict[
|
|
11
|
+
str,
|
|
12
|
+
bgl.Buffer
|
|
13
|
+
| collections.abc.Sequence[float]
|
|
14
|
+
| collections.abc.Sequence[int]
|
|
15
|
+
| collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
16
|
+
| collections.abc.Sequence[collections.abc.Sequence[int]],
|
|
17
|
+
],
|
|
11
18
|
*,
|
|
12
19
|
indices=None,
|
|
13
20
|
) -> gpu.types.GPUBatch:
|
|
@@ -19,7 +26,7 @@ def batch_for_shader(
|
|
|
19
26
|
:type type: str
|
|
20
27
|
:param content: Maps the name of the shader attribute with the data to fill the vertex buffer.
|
|
21
28
|
For the dictionary values see documentation for `gpu.types.GPUVertBuf.attr_fill` data argument.
|
|
22
|
-
:type content: dict[str, bgl.Buffer]
|
|
29
|
+
:type content: dict[str, bgl.Buffer | collections.abc.Sequence[float] | collections.abc.Sequence[int] | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[collections.abc.Sequence[int]]]
|
|
23
30
|
:return: compatible batch
|
|
24
31
|
:rtype: gpu.types.GPUBatch
|
|
25
32
|
"""
|
gpu_extras/presets/__init__.pyi
CHANGED
|
@@ -4,18 +4,26 @@ import typing_extensions
|
|
|
4
4
|
import gpu.types
|
|
5
5
|
import mathutils
|
|
6
6
|
|
|
7
|
-
def draw_circle_2d(
|
|
7
|
+
def draw_circle_2d(
|
|
8
|
+
position: collections.abc.Sequence[float],
|
|
9
|
+
color: collections.abc.Sequence[float],
|
|
10
|
+
radius: float,
|
|
11
|
+
*,
|
|
12
|
+
segments: None | int | None = None,
|
|
13
|
+
):
|
|
8
14
|
"""Draw a circle.
|
|
9
15
|
|
|
10
16
|
:param position: 2D position where the circle will be drawn.
|
|
17
|
+
:type position: collections.abc.Sequence[float]
|
|
11
18
|
:param color: Color of the circle (RGBA).
|
|
12
19
|
To use transparency blend must be set to ALPHA, see: `gpu.state.blend_set`.
|
|
20
|
+
:type color: collections.abc.Sequence[float]
|
|
13
21
|
:param radius: Radius of the circle.
|
|
14
22
|
:type radius: float
|
|
15
23
|
:param segments: How many segments will be used to draw the circle.
|
|
16
24
|
Higher values give better results but the drawing will take longer.
|
|
17
25
|
If None or not specified, an automatic value will be calculated.
|
|
18
|
-
:type segments: int | None
|
|
26
|
+
:type segments: None | int | None
|
|
19
27
|
"""
|
|
20
28
|
|
|
21
29
|
def draw_texture_2d(
|
imbuf/__init__.pyi
CHANGED
|
@@ -36,11 +36,11 @@ def new(size: tuple[int, int]) -> imbuf.types.ImBuf:
|
|
|
36
36
|
:rtype: imbuf.types.ImBuf
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
|
-
def write(image: imbuf.types.ImBuf, filepath: bytes | str = image.filepath):
|
|
39
|
+
def write(image: imbuf.types.ImBuf, filepath: None | bytes | str = image.filepath):
|
|
40
40
|
"""Write an image.
|
|
41
41
|
|
|
42
42
|
:param image: the image to write.
|
|
43
43
|
:type image: imbuf.types.ImBuf
|
|
44
44
|
:param filepath: Optional filepath of the image (fallback to the images file path).
|
|
45
|
-
:type filepath: bytes | str
|
|
45
|
+
:type filepath: None | bytes | str
|
|
46
46
|
"""
|
mathutils/__init__.pyi
CHANGED
|
@@ -171,10 +171,11 @@ class Color:
|
|
|
171
171
|
:rtype: typing_extensions.Self
|
|
172
172
|
"""
|
|
173
173
|
|
|
174
|
-
def __init__(self, rgb=(0.0, 0.0, 0.0)):
|
|
174
|
+
def __init__(self, rgb: collections.abc.Sequence[float] = (0.0, 0.0, 0.0)):
|
|
175
175
|
"""
|
|
176
176
|
|
|
177
177
|
:param rgb:
|
|
178
|
+
:type rgb: collections.abc.Sequence[float]
|
|
178
179
|
"""
|
|
179
180
|
|
|
180
181
|
def __get__(self, instance, owner) -> typing_extensions.Self:
|
|
@@ -463,11 +464,17 @@ class Euler:
|
|
|
463
464
|
def zero(self):
|
|
464
465
|
"""Set all values to zero."""
|
|
465
466
|
|
|
466
|
-
def __init__(
|
|
467
|
+
def __init__(
|
|
468
|
+
self,
|
|
469
|
+
angles: collections.abc.Sequence[float] = (0.0, 0.0, 0.0),
|
|
470
|
+
order: str = "XYZ",
|
|
471
|
+
):
|
|
467
472
|
"""
|
|
468
473
|
|
|
469
474
|
:param angles:
|
|
475
|
+
:type angles: collections.abc.Sequence[float]
|
|
470
476
|
:param order:
|
|
477
|
+
:type order: str
|
|
471
478
|
"""
|
|
472
479
|
|
|
473
480
|
def __get__(self, instance, owner) -> typing_extensions.Self:
|
|
@@ -622,23 +629,24 @@ class Matrix:
|
|
|
622
629
|
@classmethod
|
|
623
630
|
def LocRotScale(
|
|
624
631
|
cls,
|
|
625
|
-
location: Vector | collections.abc.Sequence[float],
|
|
632
|
+
location: None | Vector | collections.abc.Sequence[float],
|
|
626
633
|
rotation: Euler
|
|
634
|
+
| None
|
|
627
635
|
| Quaternion
|
|
628
636
|
| collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
629
637
|
| collections.abc.Sequence[float]
|
|
630
638
|
| typing_extensions.Self,
|
|
631
|
-
scale: Vector | collections.abc.Sequence[float],
|
|
639
|
+
scale: None | Vector | collections.abc.Sequence[float],
|
|
632
640
|
) -> typing_extensions.Self:
|
|
633
641
|
"""Create a matrix combining translation, rotation and scale,
|
|
634
642
|
acting as the inverse of the decompose() method.Any of the inputs may be replaced with None if not needed.
|
|
635
643
|
|
|
636
644
|
:param location: The translation component.
|
|
637
|
-
:type location: Vector | collections.abc.Sequence[float]
|
|
645
|
+
:type location: None | Vector | collections.abc.Sequence[float]
|
|
638
646
|
:param rotation: The rotation component as a 3x3 matrix, quaternion, euler or None for no rotation.
|
|
639
|
-
:type rotation: Euler | Quaternion | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[float] | typing_extensions.Self
|
|
647
|
+
:type rotation: Euler | None | Quaternion | collections.abc.Sequence[collections.abc.Sequence[float]] | collections.abc.Sequence[float] | typing_extensions.Self
|
|
640
648
|
:param scale: The scale component.
|
|
641
|
-
:type scale: Vector | collections.abc.Sequence[float]
|
|
649
|
+
:type scale: None | Vector | collections.abc.Sequence[float]
|
|
642
650
|
:return: Combined transformation as a 4x4 matrix.
|
|
643
651
|
:rtype: typing_extensions.Self
|
|
644
652
|
"""
|
|
@@ -699,7 +707,9 @@ class Matrix:
|
|
|
699
707
|
"""
|
|
700
708
|
|
|
701
709
|
@classmethod
|
|
702
|
-
def Shear(
|
|
710
|
+
def Shear(
|
|
711
|
+
cls, plane: str, size: int, factor: collections.abc.Sequence[float] | float
|
|
712
|
+
) -> typing_extensions.Self:
|
|
703
713
|
"""Create a matrix to represent an shear transformation.
|
|
704
714
|
|
|
705
715
|
:param plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],
|
|
@@ -708,7 +718,7 @@ class Matrix:
|
|
|
708
718
|
:param size: The size of the shear matrix to construct [2, 4].
|
|
709
719
|
:type size: int
|
|
710
720
|
:param factor: The factor of shear to apply. For a 2 size matrix use a single float. For a 3 or 4 size matrix pass a pair of floats corresponding with the plane axis.
|
|
711
|
-
:type factor: float
|
|
721
|
+
:type factor: collections.abc.Sequence[float] | float
|
|
712
722
|
:return: A new shear matrix.
|
|
713
723
|
:rtype: typing_extensions.Self
|
|
714
724
|
"""
|
|
@@ -926,7 +936,7 @@ class Matrix:
|
|
|
926
936
|
|
|
927
937
|
def __init__(
|
|
928
938
|
self,
|
|
929
|
-
rows=(
|
|
939
|
+
rows: collections.abc.Sequence[collections.abc.Sequence[float]] = (
|
|
930
940
|
(1.0, 0.0, 0.0, 0.0),
|
|
931
941
|
(0.0, 1.0, 0.0, 0.0),
|
|
932
942
|
(0.0, 0.0, 1.0, 0.0),
|
|
@@ -936,6 +946,7 @@ class Matrix:
|
|
|
936
946
|
"""
|
|
937
947
|
|
|
938
948
|
:param rows:
|
|
949
|
+
:type rows: collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
939
950
|
"""
|
|
940
951
|
|
|
941
952
|
def __get__(self, instance, owner) -> typing_extensions.Self:
|
|
@@ -1348,10 +1359,17 @@ class Quaternion:
|
|
|
1348
1359
|
:rtype: tuple[Quaternion, float]
|
|
1349
1360
|
"""
|
|
1350
1361
|
|
|
1351
|
-
def __init__(
|
|
1362
|
+
def __init__(
|
|
1363
|
+
self,
|
|
1364
|
+
seq: Vector | collections.abc.Sequence[float] = (1.0, 0.0, 0.0, 0.0),
|
|
1365
|
+
angle: float = 0.0,
|
|
1366
|
+
):
|
|
1352
1367
|
"""
|
|
1353
1368
|
|
|
1354
1369
|
:param seq:
|
|
1370
|
+
:type seq: Vector | collections.abc.Sequence[float]
|
|
1371
|
+
:param angle:
|
|
1372
|
+
:type angle: float
|
|
1355
1373
|
"""
|
|
1356
1374
|
|
|
1357
1375
|
def __get__(self, instance, owner) -> typing_extensions.Self:
|
|
@@ -3884,10 +3902,11 @@ class Vector:
|
|
|
3884
3902
|
def zero(self):
|
|
3885
3903
|
"""Set all values to zero."""
|
|
3886
3904
|
|
|
3887
|
-
def __init__(self, seq=(0.0, 0.0, 0.0)):
|
|
3905
|
+
def __init__(self, seq: collections.abc.Sequence[float] = (0.0, 0.0, 0.0)):
|
|
3888
3906
|
"""
|
|
3889
3907
|
|
|
3890
3908
|
:param seq:
|
|
3909
|
+
:type seq: collections.abc.Sequence[float]
|
|
3891
3910
|
"""
|
|
3892
3911
|
|
|
3893
3912
|
def __get__(self, instance, owner) -> typing_extensions.Self:
|
mathutils/bvhtree/__init__.pyi
CHANGED
|
@@ -48,12 +48,18 @@ class BVHTree:
|
|
|
48
48
|
|
|
49
49
|
@classmethod
|
|
50
50
|
def FromPolygons(
|
|
51
|
-
cls,
|
|
51
|
+
cls,
|
|
52
|
+
vertices: collections.abc.Sequence[collections.abc.Sequence[float]],
|
|
53
|
+
polygons: collections.abc.Sequence[collections.abc.Sequence[int]],
|
|
54
|
+
all_triangles: bool = False,
|
|
55
|
+
epsilon: float = 0.0,
|
|
52
56
|
):
|
|
53
57
|
"""BVH tree constructed geometry passed in as arguments.
|
|
54
58
|
|
|
55
59
|
:param vertices: float triplets each representing (x, y, z)
|
|
60
|
+
:type vertices: collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
56
61
|
:param polygons: Sequence of polygons, each containing indices to the vertices argument.
|
|
62
|
+
:type polygons: collections.abc.Sequence[collections.abc.Sequence[int]]
|
|
57
63
|
:param all_triangles: Use when all polygons are triangles for more efficient conversion.
|
|
58
64
|
:type all_triangles: bool
|
|
59
65
|
:param epsilon: Increase the threshold for detecting overlap and raycast hits.
|
|
@@ -62,7 +68,9 @@ class BVHTree:
|
|
|
62
68
|
|
|
63
69
|
def find_nearest(
|
|
64
70
|
self, origin, distance: float = 1.84467e19
|
|
65
|
-
) -> tuple[
|
|
71
|
+
) -> tuple[
|
|
72
|
+
mathutils.Vector | None, mathutils.Vector | None, int | None, float | None
|
|
73
|
+
]:
|
|
66
74
|
"""Find the nearest element (typically face index) to a point.
|
|
67
75
|
|
|
68
76
|
:param origin:
|
|
@@ -70,7 +78,7 @@ class BVHTree:
|
|
|
70
78
|
:type distance: float
|
|
71
79
|
:return: Returns a tuple: (position, normal, index, distance),
|
|
72
80
|
Values will all be None if no hit is found.
|
|
73
|
-
:rtype: tuple[mathutils.Vector, mathutils.Vector, int, float]
|
|
81
|
+
:rtype: tuple[mathutils.Vector | None, mathutils.Vector | None, int | None, float | None]
|
|
74
82
|
"""
|
|
75
83
|
|
|
76
84
|
def find_nearest_range(
|
|
@@ -99,7 +107,9 @@ class BVHTree:
|
|
|
99
107
|
origin: collections.abc.Sequence[float] | mathutils.Vector,
|
|
100
108
|
direction: collections.abc.Sequence[float] | mathutils.Vector,
|
|
101
109
|
distance: float = sys.float_info.max,
|
|
102
|
-
) -> tuple[
|
|
110
|
+
) -> tuple[
|
|
111
|
+
mathutils.Vector | None, mathutils.Vector | None, int | None, float | None
|
|
112
|
+
]:
|
|
103
113
|
"""Cast a ray onto the mesh.
|
|
104
114
|
|
|
105
115
|
:param origin: Start location of the ray in object space.
|
|
@@ -110,7 +120,7 @@ class BVHTree:
|
|
|
110
120
|
:type distance: float
|
|
111
121
|
:return: Returns a tuple: (position, normal, index, distance),
|
|
112
122
|
Values will all be None if no hit is found.
|
|
113
|
-
:rtype: tuple[mathutils.Vector, mathutils.Vector, int, float]
|
|
123
|
+
:rtype: tuple[mathutils.Vector | None, mathutils.Vector | None, int | None, float | None]
|
|
114
124
|
"""
|
|
115
125
|
|
|
116
126
|
def __init__(self, size):
|
mathutils/geometry/__init__.pyi
CHANGED
|
@@ -53,10 +53,13 @@ def barycentric_transform(
|
|
|
53
53
|
:rtype: mathutils.Vector
|
|
54
54
|
"""
|
|
55
55
|
|
|
56
|
-
def box_fit_2d(
|
|
56
|
+
def box_fit_2d(
|
|
57
|
+
points: collections.abc.Sequence[collections.abc.Sequence[float]],
|
|
58
|
+
) -> float:
|
|
57
59
|
"""Returns an angle that best fits the points to an axis aligned rectangle
|
|
58
60
|
|
|
59
61
|
:param points: Sequence of 2D points.
|
|
62
|
+
:type points: collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
60
63
|
:return: angle
|
|
61
64
|
:rtype: float
|
|
62
65
|
"""
|
|
@@ -92,16 +95,26 @@ def closest_point_on_tri(
|
|
|
92
95
|
:rtype: mathutils.Vector
|
|
93
96
|
"""
|
|
94
97
|
|
|
95
|
-
def convex_hull_2d(
|
|
98
|
+
def convex_hull_2d(
|
|
99
|
+
points: collections.abc.Sequence[collections.abc.Sequence[float]],
|
|
100
|
+
) -> list[int]:
|
|
96
101
|
"""Returns a list of indices into the list given
|
|
97
102
|
|
|
98
103
|
:param points: Sequence of 2D points.
|
|
104
|
+
:type points: collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
99
105
|
:return: a list of indices
|
|
100
106
|
:rtype: list[int]
|
|
101
107
|
"""
|
|
102
108
|
|
|
103
109
|
def delaunay_2d_cdt(
|
|
104
|
-
vert_coords
|
|
110
|
+
vert_coords: collections.abc.Sequence[
|
|
111
|
+
collections.abc.Sequence[float] | mathutils.Vector
|
|
112
|
+
],
|
|
113
|
+
edges: collections.abc.Sequence[collections.abc.Sequence[int, int]],
|
|
114
|
+
faces: collections.abc.Sequence[collections.abc.Sequence[int]],
|
|
115
|
+
output_type: int,
|
|
116
|
+
epsilon: float,
|
|
117
|
+
need_ids=True,
|
|
105
118
|
) -> tuple[
|
|
106
119
|
list[mathutils.Vector],
|
|
107
120
|
list[tuple[int, int]],
|
|
@@ -124,8 +137,11 @@ def delaunay_2d_cdt(
|
|
|
124
137
|
of the orig arrays, which may save some time.
|
|
125
138
|
|
|
126
139
|
:param vert_coords: Vertex coordinates (2d)
|
|
140
|
+
:type vert_coords: collections.abc.Sequence[collections.abc.Sequence[float] | mathutils.Vector]
|
|
127
141
|
:param edges: Edges, as pairs of indices in vert_coords
|
|
142
|
+
:type edges: collections.abc.Sequence[collections.abc.Sequence[int, int]]
|
|
128
143
|
:param faces: Faces, each sublist is a face, as indices in vert_coords (CCW oriented)
|
|
144
|
+
:type faces: collections.abc.Sequence[collections.abc.Sequence[int]]
|
|
129
145
|
:param output_type: What output looks like. 0 => triangles with convex hull. 1 => triangles inside constraints. 2 => the input constraints, intersected. 3 => like 2 but detect holes and omit them from output. 4 => like 2 but with extra edges to make valid BMesh faces. 5 => like 4 but detect holes and omit them from output.
|
|
130
146
|
:type output_type: int
|
|
131
147
|
:param epsilon: For nearness tests; should not be zero
|
|
@@ -179,7 +195,7 @@ def intersect_line_line(
|
|
|
179
195
|
v2: collections.abc.Sequence[float] | mathutils.Vector,
|
|
180
196
|
v3: collections.abc.Sequence[float] | mathutils.Vector,
|
|
181
197
|
v4: collections.abc.Sequence[float] | mathutils.Vector,
|
|
182
|
-
) -> tuple[mathutils.Vector, mathutils.Vector]:
|
|
198
|
+
) -> None | tuple[mathutils.Vector, mathutils.Vector]:
|
|
183
199
|
"""Returns a tuple with the points on each line respectively closest to the other.
|
|
184
200
|
|
|
185
201
|
:param v1: First point of the first line
|
|
@@ -191,7 +207,7 @@ def intersect_line_line(
|
|
|
191
207
|
:param v4: Second point of the second line
|
|
192
208
|
:type v4: collections.abc.Sequence[float] | mathutils.Vector
|
|
193
209
|
:return: The intersection on each line or None when the lines are co-linear.
|
|
194
|
-
:rtype: tuple[mathutils.Vector, mathutils.Vector]
|
|
210
|
+
:rtype: None | tuple[mathutils.Vector, mathutils.Vector]
|
|
195
211
|
"""
|
|
196
212
|
|
|
197
213
|
def intersect_line_line_2d(
|
|
@@ -199,7 +215,7 @@ def intersect_line_line_2d(
|
|
|
199
215
|
lineA_p2: collections.abc.Sequence[float] | mathutils.Vector,
|
|
200
216
|
lineB_p1: collections.abc.Sequence[float] | mathutils.Vector,
|
|
201
217
|
lineB_p2: collections.abc.Sequence[float] | mathutils.Vector,
|
|
202
|
-
) -> mathutils.Vector:
|
|
218
|
+
) -> None | mathutils.Vector:
|
|
203
219
|
"""Takes 2 segments (defined by 4 vectors) and returns a vector for their point of intersection or None.
|
|
204
220
|
|
|
205
221
|
:param lineA_p1: First point of the first line
|
|
@@ -211,7 +227,7 @@ def intersect_line_line_2d(
|
|
|
211
227
|
:param lineB_p2: Second point of the second line
|
|
212
228
|
:type lineB_p2: collections.abc.Sequence[float] | mathutils.Vector
|
|
213
229
|
:return: The point of intersection or None when not found
|
|
214
|
-
:rtype: mathutils.Vector
|
|
230
|
+
:rtype: None | mathutils.Vector
|
|
215
231
|
"""
|
|
216
232
|
|
|
217
233
|
def intersect_line_plane(
|
|
@@ -220,7 +236,7 @@ def intersect_line_plane(
|
|
|
220
236
|
plane_co: collections.abc.Sequence[float] | mathutils.Vector,
|
|
221
237
|
plane_no: collections.abc.Sequence[float] | mathutils.Vector,
|
|
222
238
|
no_flip=False,
|
|
223
|
-
) -> mathutils.Vector:
|
|
239
|
+
) -> None | mathutils.Vector:
|
|
224
240
|
"""Calculate the intersection between a line (as 2 vectors) and a plane.
|
|
225
241
|
Returns a vector for the intersection or None.
|
|
226
242
|
|
|
@@ -233,7 +249,7 @@ def intersect_line_plane(
|
|
|
233
249
|
:param plane_no: The direction the plane is facing
|
|
234
250
|
:type plane_no: collections.abc.Sequence[float] | mathutils.Vector
|
|
235
251
|
:return: The point of intersection or None when not found
|
|
236
|
-
:rtype: mathutils.Vector
|
|
252
|
+
:rtype: None | mathutils.Vector
|
|
237
253
|
"""
|
|
238
254
|
|
|
239
255
|
def intersect_line_sphere(
|
|
@@ -242,7 +258,7 @@ def intersect_line_sphere(
|
|
|
242
258
|
sphere_co: collections.abc.Sequence[float] | mathutils.Vector,
|
|
243
259
|
sphere_radius: float,
|
|
244
260
|
clip=True,
|
|
245
|
-
) -> tuple[mathutils.Vector, mathutils.Vector]:
|
|
261
|
+
) -> tuple[mathutils.Vector | None, mathutils.Vector | None]:
|
|
246
262
|
"""Takes a line (as 2 points) and a sphere (as a point and a radius) and
|
|
247
263
|
returns the intersection
|
|
248
264
|
|
|
@@ -255,7 +271,7 @@ def intersect_line_sphere(
|
|
|
255
271
|
:param sphere_radius: Radius of the sphere
|
|
256
272
|
:type sphere_radius: float
|
|
257
273
|
:return: The intersection points as a pair of vectors or None when there is no intersection
|
|
258
|
-
:rtype: tuple[mathutils.Vector, mathutils.Vector]
|
|
274
|
+
:rtype: tuple[mathutils.Vector | None, mathutils.Vector | None]
|
|
259
275
|
"""
|
|
260
276
|
|
|
261
277
|
def intersect_line_sphere_2d(
|
|
@@ -264,7 +280,7 @@ def intersect_line_sphere_2d(
|
|
|
264
280
|
sphere_co: collections.abc.Sequence[float] | mathutils.Vector,
|
|
265
281
|
sphere_radius: float,
|
|
266
282
|
clip=True,
|
|
267
|
-
) -> tuple[mathutils.Vector, mathutils.Vector]:
|
|
283
|
+
) -> tuple[mathutils.Vector | None, mathutils.Vector | None]:
|
|
268
284
|
"""Takes a line (as 2 points) and a sphere (as a point and a radius) and
|
|
269
285
|
returns the intersection
|
|
270
286
|
|
|
@@ -277,7 +293,7 @@ def intersect_line_sphere_2d(
|
|
|
277
293
|
:param sphere_radius: Radius of the sphere
|
|
278
294
|
:type sphere_radius: float
|
|
279
295
|
:return: The intersection points as a pair of vectors or None when there is no intersection
|
|
280
|
-
:rtype: tuple[mathutils.Vector, mathutils.Vector]
|
|
296
|
+
:rtype: tuple[mathutils.Vector | None, mathutils.Vector | None]
|
|
281
297
|
"""
|
|
282
298
|
|
|
283
299
|
def intersect_plane_plane(
|
|
@@ -285,7 +301,7 @@ def intersect_plane_plane(
|
|
|
285
301
|
plane_a_no: collections.abc.Sequence[float] | mathutils.Vector,
|
|
286
302
|
plane_b_co: collections.abc.Sequence[float] | mathutils.Vector,
|
|
287
303
|
plane_b_no: collections.abc.Sequence[float] | mathutils.Vector,
|
|
288
|
-
) -> tuple | tuple[mathutils.Vector, mathutils.Vector]:
|
|
304
|
+
) -> tuple[None, None] | tuple[mathutils.Vector, mathutils.Vector]:
|
|
289
305
|
"""Return the intersection between two planes
|
|
290
306
|
|
|
291
307
|
:param plane_a_co: Point on the first plane
|
|
@@ -297,7 +313,7 @@ def intersect_plane_plane(
|
|
|
297
313
|
:param plane_b_no: Normal of the second plane
|
|
298
314
|
:type plane_b_no: collections.abc.Sequence[float] | mathutils.Vector
|
|
299
315
|
:return: The line of the intersection represented as a point and a vector or None if the intersection can't be calculated
|
|
300
|
-
:rtype: tuple | tuple[mathutils.Vector, mathutils.Vector]
|
|
316
|
+
:rtype: tuple[None, None] | tuple[mathutils.Vector, mathutils.Vector]
|
|
301
317
|
"""
|
|
302
318
|
|
|
303
319
|
def intersect_point_line(
|
|
@@ -343,7 +359,7 @@ def intersect_point_tri(
|
|
|
343
359
|
tri_p1: collections.abc.Sequence[float] | mathutils.Vector,
|
|
344
360
|
tri_p2: collections.abc.Sequence[float] | mathutils.Vector,
|
|
345
361
|
tri_p3: collections.abc.Sequence[float] | mathutils.Vector,
|
|
346
|
-
) -> mathutils.Vector:
|
|
362
|
+
) -> None | mathutils.Vector:
|
|
347
363
|
"""Takes 4 vectors: one is the point and the next 3 define the triangle. Projects the point onto the triangle plane and checks if it is within the triangle.
|
|
348
364
|
|
|
349
365
|
:param pt: Point
|
|
@@ -355,7 +371,7 @@ def intersect_point_tri(
|
|
|
355
371
|
:param tri_p3: Third point of the triangle
|
|
356
372
|
:type tri_p3: collections.abc.Sequence[float] | mathutils.Vector
|
|
357
373
|
:return: Point on the triangles plane or None if its outside the triangle
|
|
358
|
-
:rtype: mathutils.Vector
|
|
374
|
+
:rtype: None | mathutils.Vector
|
|
359
375
|
"""
|
|
360
376
|
|
|
361
377
|
def intersect_point_tri_2d(
|
|
@@ -384,7 +400,7 @@ def intersect_ray_tri(
|
|
|
384
400
|
ray: collections.abc.Sequence[float] | mathutils.Vector,
|
|
385
401
|
orig: collections.abc.Sequence[float] | mathutils.Vector,
|
|
386
402
|
clip: bool = True,
|
|
387
|
-
) -> mathutils.Vector:
|
|
403
|
+
) -> None | mathutils.Vector:
|
|
388
404
|
"""Returns the intersection between a ray and a triangle, if possible, returns None otherwise.
|
|
389
405
|
|
|
390
406
|
:param v1: Point1
|
|
@@ -400,7 +416,7 @@ def intersect_ray_tri(
|
|
|
400
416
|
:param clip: When False, don't restrict the intersection to the area of the triangle, use the infinite plane defined by the triangle.
|
|
401
417
|
:type clip: bool
|
|
402
418
|
:return: The point of intersection or None if no intersection is found
|
|
403
|
-
:rtype: mathutils.Vector
|
|
419
|
+
:rtype: None | mathutils.Vector
|
|
404
420
|
"""
|
|
405
421
|
|
|
406
422
|
def intersect_sphere_sphere_2d(
|
|
@@ -408,7 +424,7 @@ def intersect_sphere_sphere_2d(
|
|
|
408
424
|
radius_a: float,
|
|
409
425
|
p_b: collections.abc.Sequence[float] | mathutils.Vector,
|
|
410
426
|
radius_b: float,
|
|
411
|
-
) -> tuple | tuple[mathutils.Vector, mathutils.Vector]:
|
|
427
|
+
) -> tuple[None, None] | tuple[mathutils.Vector, mathutils.Vector]:
|
|
412
428
|
"""Returns 2 points on between intersecting circles.
|
|
413
429
|
|
|
414
430
|
:param p_a: Center of the first circle
|
|
@@ -420,7 +436,7 @@ def intersect_sphere_sphere_2d(
|
|
|
420
436
|
:param radius_b: Radius of the second circle
|
|
421
437
|
:type radius_b: float
|
|
422
438
|
:return: 2 points on between intersecting circles or None when there is no intersection.
|
|
423
|
-
:rtype: tuple | tuple[mathutils.Vector, mathutils.Vector]
|
|
439
|
+
:rtype: tuple[None, None] | tuple[mathutils.Vector, mathutils.Vector]
|
|
424
440
|
"""
|
|
425
441
|
|
|
426
442
|
def intersect_tri_tri_2d(tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3) -> bool:
|
|
@@ -429,10 +445,13 @@ def intersect_tri_tri_2d(tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3) -> bool
|
|
|
429
445
|
:rtype: bool
|
|
430
446
|
"""
|
|
431
447
|
|
|
432
|
-
def normal(
|
|
448
|
+
def normal(
|
|
449
|
+
vectors: collections.abc.Sequence[collections.abc.Sequence[float]],
|
|
450
|
+
) -> mathutils.Vector:
|
|
433
451
|
"""Returns the normal of a 3D polygon.
|
|
434
452
|
|
|
435
453
|
:param vectors: 3 or more vectors to calculate normals.
|
|
454
|
+
:type vectors: collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
436
455
|
:rtype: mathutils.Vector
|
|
437
456
|
"""
|
|
438
457
|
|
|
@@ -7,10 +7,13 @@ import typing
|
|
|
7
7
|
import collections.abc
|
|
8
8
|
import typing_extensions
|
|
9
9
|
|
|
10
|
-
def poly_3d_calc(
|
|
10
|
+
def poly_3d_calc(
|
|
11
|
+
veclist: collections.abc.Sequence[collections.abc.Sequence[float]], pt
|
|
12
|
+
) -> list[float]:
|
|
11
13
|
"""Calculate barycentric weights for a point on a polygon.
|
|
12
14
|
|
|
13
15
|
:param veclist: Sequence of 3D positions.
|
|
16
|
+
:type veclist: collections.abc.Sequence[collections.abc.Sequence[float]]
|
|
14
17
|
:param pt: 2D or 3D position. :type pt: Sequence[float] :return: list of per-vector weights.
|
|
15
18
|
:rtype: list[float]
|
|
16
19
|
"""
|