fake-bpy-module 20241207__py3-none-any.whl → 20241208__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.

Files changed (39) hide show
  1. addon_utils/__init__.pyi +2 -1
  2. bl_console_utils/autocomplete/complete_calltip/__init__.pyi +5 -2
  3. bl_console_utils/autocomplete/complete_import/__init__.pyi +6 -3
  4. bl_console_utils/autocomplete/complete_namespace/__init__.pyi +2 -1
  5. bl_console_utils/autocomplete/intellisense/__init__.pyi +8 -2
  6. blf/__init__.pyi +2 -1
  7. bmesh/ops/__init__.pyi +110 -53
  8. bmesh/types/__init__.pyi +18 -10
  9. bmesh/utils/__init__.pyi +14 -4
  10. bpy/app/icons/__init__.pyi +4 -1
  11. bpy/app/translations/__init__.pyi +4 -1
  12. bpy/msgbus/__init__.pyi +8 -5
  13. bpy/path/__init__.pyi +4 -2
  14. bpy/types/__init__.pyi +68 -32
  15. bpy/utils/__init__.pyi +18 -9
  16. bpy_extras/bmesh_utils/__init__.pyi +2 -1
  17. bpy_extras/io_utils/__init__.pyi +7 -2
  18. bpy_extras/mesh_utils/__init__.pyi +19 -7
  19. bpy_extras/view3d_utils/__init__.pyi +2 -2
  20. {fake_bpy_module-20241207.dist-info → fake_bpy_module-20241208.dist-info}/METADATA +1 -1
  21. {fake_bpy_module-20241207.dist-info → fake_bpy_module-20241208.dist-info}/RECORD +39 -39
  22. freestyle/functions/__init__.pyi +16 -4
  23. freestyle/types/__init__.pyi +60 -23
  24. freestyle/utils/ContextFunctions/__init__.pyi +2 -2
  25. gpu/capabilities/__init__.pyi +2 -1
  26. gpu/state/__init__.pyi +2 -2
  27. gpu/types/__init__.pyi +2 -2
  28. gpu_extras/batch/__init__.pyi +6 -3
  29. idprop/types/__init__.pyi +4 -3
  30. imbuf/__init__.pyi +2 -1
  31. imbuf/types/__init__.pyi +5 -2
  32. mathutils/__init__.pyi +25 -14
  33. mathutils/bvhtree/__init__.pyi +8 -7
  34. mathutils/geometry/__init__.pyi +38 -17
  35. mathutils/interpolate/__init__.pyi +2 -1
  36. mathutils/kdtree/__init__.pyi +11 -6
  37. mathutils/noise/__init__.pyi +2 -1
  38. {fake_bpy_module-20241207.dist-info → fake_bpy_module-20241208.dist-info}/WHEEL +0 -0
  39. {fake_bpy_module-20241207.dist-info → fake_bpy_module-20241208.dist-info}/top_level.txt +0 -0
idprop/types/__init__.pyi CHANGED
@@ -29,22 +29,23 @@ class IDPropertyGroup:
29
29
  def keys(self):
30
30
  """Return the keys associated with this group as a list of strings."""
31
31
 
32
- def pop(self, key: str, default):
32
+ def pop(self, key: str, default: typing.Any):
33
33
  """Remove an item from the group, returning a Python representation.
34
34
 
35
35
  :param key: Name of item to remove.
36
36
  :type key: str
37
37
  :param default: Value to return when key isn't found, otherwise raise an exception.
38
+ :type default: typing.Any
38
39
  """
39
40
 
40
41
  def to_dict(self):
41
42
  """Return a purely Python version of the group."""
42
43
 
43
- def update(self, other: typing_extensions.Self):
44
+ def update(self, other: dict[str, typing.Any] | typing_extensions.Self):
44
45
  """Update key, values.
45
46
 
46
47
  :param other: Updates the values in the group with this.
47
- :type other: typing_extensions.Self
48
+ :type other: dict[str, typing.Any] | typing_extensions.Self
48
49
  """
49
50
 
50
51
  def values(self):
imbuf/__init__.pyi CHANGED
@@ -27,10 +27,11 @@ def load(filepath: bytes | str) -> imbuf.types.ImBuf:
27
27
  :rtype: imbuf.types.ImBuf
28
28
  """
29
29
 
30
- def new(size) -> imbuf.types.ImBuf:
30
+ def new(size: tuple[int, int]) -> imbuf.types.ImBuf:
31
31
  """Load a new image.
32
32
 
33
33
  :param size: The size of the image in pixels.
34
+ :type size: tuple[int, int]
34
35
  :return: the newly loaded image.
35
36
  :rtype: imbuf.types.ImBuf
36
37
  """
imbuf/types/__init__.pyi CHANGED
@@ -43,20 +43,23 @@ class ImBuf:
43
43
  :rtype: typing_extensions.Self
44
44
  """
45
45
 
46
- def crop(self, min, max):
46
+ def crop(self, min: tuple[int, int], max: tuple[int, int]):
47
47
  """Crop the image.
48
48
 
49
49
  :param min: X, Y minimum.
50
+ :type min: tuple[int, int]
50
51
  :param max: X, Y maximum.
52
+ :type max: tuple[int, int]
51
53
  """
52
54
 
53
55
  def free(self):
54
56
  """Clear image data immediately (causing an error on re-use)."""
55
57
 
56
- def resize(self, size, method: str = "FAST"):
58
+ def resize(self, size: tuple[int, int], method: str = "FAST"):
57
59
  """Resize the image.
58
60
 
59
61
  :param size: New size.
62
+ :type size: tuple[int, int]
60
63
  :param method: Method of resizing ('FAST', 'BILINEAR')
61
64
  :type method: str
62
65
  """
mathutils/__init__.pyi CHANGED
@@ -742,11 +742,11 @@ class Matrix:
742
742
  :rtype: typing_extensions.Self
743
743
  """
744
744
 
745
- def decompose(self) -> Quaternion:
745
+ def decompose(self) -> tuple[Vector, Quaternion, Vector]:
746
746
  """Return the translation, rotation, and scale components of this matrix.
747
747
 
748
748
  :return: Tuple of translation, rotation, and scale.
749
- :rtype: Quaternion
749
+ :rtype: tuple[Vector, Quaternion, Vector]
750
750
  """
751
751
 
752
752
  def determinant(self) -> float:
@@ -786,13 +786,16 @@ class Matrix:
786
786
 
787
787
  """
788
788
 
789
- def inverted(self, fallback=None) -> typing_extensions.Self:
789
+ def inverted(
790
+ self, fallback: typing.Any | None = None
791
+ ) -> typing.Any | typing_extensions.Self:
790
792
  """Return an inverted copy of the matrix.
791
793
 
792
794
  :param fallback: return this when the inverse can't be calculated
793
795
  (instead of raising a `ValueError`).
796
+ :type fallback: typing.Any | None
794
797
  :return: The inverted matrix or fallback when given.
795
- :rtype: typing_extensions.Self
798
+ :rtype: typing.Any | typing_extensions.Self
796
799
  """
797
800
 
798
801
  def inverted_safe(self) -> typing_extensions.Self:
@@ -1296,10 +1299,11 @@ class Quaternion:
1296
1299
  :rtype: typing_extensions.Self
1297
1300
  """
1298
1301
 
1299
- def to_axis_angle(self):
1302
+ def to_axis_angle(self) -> tuple[Vector, float]:
1300
1303
  """Return the axis, angle representation of the quaternion.
1301
1304
 
1302
1305
  :return: Axis, angle.
1306
+ :rtype: tuple[Vector, float]
1303
1307
  """
1304
1308
 
1305
1309
  def to_euler(
@@ -1334,13 +1338,14 @@ class Quaternion:
1334
1338
  :rtype: Matrix
1335
1339
  """
1336
1340
 
1337
- def to_swing_twist(self, axis: str):
1341
+ def to_swing_twist(self, axis: str) -> tuple[Quaternion, float]:
1338
1342
  """Split the rotation into a swing quaternion with the specified
1339
1343
  axis fixed at zero, and the remaining twist rotation angle.
1340
1344
 
1341
1345
  :param axis: Twist axis as a string in ['X', 'Y', 'Z'].
1342
1346
  :type axis: str
1343
1347
  :return: Swing, twist angle.
1348
+ :rtype: tuple[Quaternion, float]
1344
1349
  """
1345
1350
 
1346
1351
  def __init__(self, seq=(1.0, 0.0, 0.0, 0.0)):
@@ -3645,29 +3650,33 @@ class Vector:
3645
3650
  def angle(
3646
3651
  self,
3647
3652
  other: collections.abc.Sequence[float] | typing_extensions.Self,
3648
- fallback=None,
3649
- ) -> float:
3653
+ fallback: typing.Any | None = None,
3654
+ ) -> float | typing.Any:
3650
3655
  """Return the angle between two vectors.
3651
3656
 
3652
3657
  :param other: another vector to compare the angle with
3653
3658
  :type other: collections.abc.Sequence[float] | typing_extensions.Self
3654
3659
  :param fallback: return this when the angle can't be calculated (zero length vector),
3655
3660
  (instead of raising a `ValueError`).
3661
+ :type fallback: typing.Any | None
3656
3662
  :return: angle in radians or fallback when given
3657
- :rtype: float
3663
+ :rtype: float | typing.Any
3658
3664
  """
3659
3665
 
3660
3666
  def angle_signed(
3661
- self, other: collections.abc.Sequence[float] | typing_extensions.Self, fallback
3662
- ) -> float:
3667
+ self,
3668
+ other: collections.abc.Sequence[float] | typing_extensions.Self,
3669
+ fallback: typing.Any,
3670
+ ) -> float | typing.Any:
3663
3671
  """Return the signed angle between two 2D vectors (clockwise is positive).
3664
3672
 
3665
3673
  :param other: another vector to compare the angle with
3666
3674
  :type other: collections.abc.Sequence[float] | typing_extensions.Self
3667
3675
  :param fallback: return this when the angle can't be calculated (zero length vector),
3668
3676
  (instead of raising a `ValueError`).
3677
+ :type fallback: typing.Any
3669
3678
  :return: angle in radians or fallback when given
3670
- :rtype: float
3679
+ :rtype: float | typing.Any
3671
3680
  """
3672
3681
 
3673
3682
  def copy(self) -> typing_extensions.Self:
@@ -3816,7 +3825,7 @@ class Vector:
3816
3825
  self,
3817
3826
  other: collections.abc.Sequence[float] | typing_extensions.Self,
3818
3827
  factor: float,
3819
- fallback=None,
3828
+ fallback: typing.Any | None = None,
3820
3829
  ) -> typing_extensions.Self:
3821
3830
  """Returns the interpolation of two non-zero vectors (spherical coordinates).
3822
3831
 
@@ -3826,6 +3835,7 @@ class Vector:
3826
3835
  :type factor: float
3827
3836
  :param fallback: return this when the vector can't be calculated (zero length vector or direct opposites),
3828
3837
  (instead of raising a `ValueError`).
3838
+ :type fallback: typing.Any | None
3829
3839
  :return: The interpolated vector.
3830
3840
  :rtype: typing_extensions.Self
3831
3841
  """
@@ -3862,12 +3872,13 @@ class Vector:
3862
3872
  :rtype: Quaternion
3863
3873
  """
3864
3874
 
3865
- def to_tuple(self, precision: int = -1):
3875
+ def to_tuple(self, precision: int = -1) -> tuple[float]:
3866
3876
  """Return this vector as a tuple with.
3867
3877
 
3868
3878
  :param precision: The number to round the value to in [-1, 21].
3869
3879
  :type precision: int
3870
3880
  :return: the values of the vector rounded by precision
3881
+ :rtype: tuple[float]
3871
3882
  """
3872
3883
 
3873
3884
  def zero(self):
@@ -62,7 +62,7 @@ class BVHTree:
62
62
 
63
63
  def find_nearest(
64
64
  self, origin, distance: float = 1.84467e19
65
- ) -> float | mathutils.Vector:
65
+ ) -> tuple[mathutils.Vector, mathutils.Vector, int, float]:
66
66
  """Find the nearest element (typically face index) to a point.
67
67
 
68
68
  :param origin:
@@ -70,27 +70,28 @@ class BVHTree:
70
70
  :type distance: float
71
71
  :return: Returns a tuple: (position, normal, index, distance),
72
72
  Values will all be None if no hit is found.
73
- :rtype: float | mathutils.Vector
73
+ :rtype: tuple[mathutils.Vector, mathutils.Vector, int, float]
74
74
  """
75
75
 
76
76
  def find_nearest_range(
77
77
  self, origin, distance: float = 1.84467e19
78
- ) -> int | mathutils.Vector:
78
+ ) -> list[tuple[mathutils.Vector, mathutils.Vector, int, float]]:
79
79
  """Find the nearest elements (typically face index) to a point in the distance range.
80
80
 
81
81
  :param origin:
82
82
  :param distance: Maximum distance threshold.
83
83
  :type distance: float
84
84
  :return: Returns a list of tuples (position, normal, index, distance)
85
- :rtype: int | mathutils.Vector
85
+ :rtype: list[tuple[mathutils.Vector, mathutils.Vector, int, float]]
86
86
  """
87
87
 
88
- def overlap(self, other_tree: typing_extensions.Self):
88
+ def overlap(self, other_tree: typing_extensions.Self) -> list[tuple[int, int]]:
89
89
  """Find overlapping indices between 2 trees.
90
90
 
91
91
  :param other_tree: Other tree to perform overlap test on.
92
92
  :type other_tree: typing_extensions.Self
93
93
  :return: Returns a list of unique index pairs, the first index referencing this tree, the second referencing the other_tree.
94
+ :rtype: list[tuple[int, int]]
94
95
  """
95
96
 
96
97
  def ray_cast(
@@ -98,7 +99,7 @@ class BVHTree:
98
99
  origin: collections.abc.Sequence[float] | mathutils.Vector,
99
100
  direction: collections.abc.Sequence[float] | mathutils.Vector,
100
101
  distance: float = sys.float_info.max,
101
- ) -> float | mathutils.Vector:
102
+ ) -> tuple[mathutils.Vector, mathutils.Vector, int, float]:
102
103
  """Cast a ray onto the mesh.
103
104
 
104
105
  :param origin: Start location of the ray in object space.
@@ -109,7 +110,7 @@ class BVHTree:
109
110
  :type distance: float
110
111
  :return: Returns a tuple: (position, normal, index, distance),
111
112
  Values will all be None if no hit is found.
112
- :rtype: float | mathutils.Vector
113
+ :rtype: tuple[mathutils.Vector, mathutils.Vector, int, float]
113
114
  """
114
115
 
115
116
  def __init__(self, size):
@@ -61,12 +61,15 @@ def box_fit_2d(points) -> float:
61
61
  :rtype: float
62
62
  """
63
63
 
64
- def box_pack_2d(boxes: float):
64
+ def box_pack_2d(
65
+ boxes: list[list[float, float, float, float, int]],
66
+ ) -> tuple[float, float]:
65
67
  """Returns a tuple with the width and height of the packed bounding box.
66
68
 
67
69
  :param boxes: list of boxes, each box is a list where the first 4 items are [X, Y, width, height, ...] other items are ignored. The X & Y values in this list are modified to set the packed positions.
68
- :type boxes: float
70
+ :type boxes: list[list[float, float, float, float, int]]
69
71
  :return: The width and height of the packed bounding box.
72
+ :rtype: tuple[float, float]
70
73
  """
71
74
 
72
75
  def closest_point_on_tri(
@@ -89,16 +92,24 @@ def closest_point_on_tri(
89
92
  :rtype: mathutils.Vector
90
93
  """
91
94
 
92
- def convex_hull_2d(points):
95
+ def convex_hull_2d(points) -> list[int]:
93
96
  """Returns a list of indices into the list given
94
97
 
95
98
  :param points: Sequence of 2D points.
96
99
  :return: a list of indices
100
+ :rtype: list[int]
97
101
  """
98
102
 
99
103
  def delaunay_2d_cdt(
100
104
  vert_coords, edges, faces, output_type: int, epsilon: float, need_ids=True
101
- ):
105
+ ) -> tuple[
106
+ list[mathutils.Vector],
107
+ list[tuple[int, int]],
108
+ list[list[int]],
109
+ list[list[int]],
110
+ list[list[int]],
111
+ list[list[int]],
112
+ ]:
102
113
  """Computes the Constrained Delaunay Triangulation of a set of vertices,
103
114
  with edges and faces that must appear in the triangulation.
104
115
  Some triangles may be eaten away, or combined with other triangles,
@@ -121,6 +132,7 @@ def delaunay_2d_cdt(
121
132
  :type epsilon: float
122
133
  :param need_ids: are the orig output arrays needed?
123
134
  :return: Output tuple, (vert_coords, edges, faces, orig_verts, orig_edges, orig_faces)
135
+ :rtype: tuple[list[mathutils.Vector], list[tuple[int, int]], list[list[int]], list[list[int]], list[list[int]], list[list[int]]]
124
136
  """
125
137
 
126
138
  def distance_point_to_plane(
@@ -145,7 +157,7 @@ def interpolate_bezier(
145
157
  handle2: collections.abc.Sequence[float] | mathutils.Vector,
146
158
  knot2: collections.abc.Sequence[float] | mathutils.Vector,
147
159
  resolution: int,
148
- ):
160
+ ) -> list[mathutils.Vector]:
149
161
  """Interpolate a bezier spline segment.
150
162
 
151
163
  :param knot1: First bezier spline point.
@@ -159,6 +171,7 @@ def interpolate_bezier(
159
171
  :param resolution: Number of points to return.
160
172
  :type resolution: int
161
173
  :return: The interpolated points.
174
+ :rtype: list[mathutils.Vector]
162
175
  """
163
176
 
164
177
  def intersect_line_line(
@@ -166,7 +179,7 @@ def intersect_line_line(
166
179
  v2: collections.abc.Sequence[float] | mathutils.Vector,
167
180
  v3: collections.abc.Sequence[float] | mathutils.Vector,
168
181
  v4: collections.abc.Sequence[float] | mathutils.Vector,
169
- ):
182
+ ) -> tuple[mathutils.Vector, mathutils.Vector]:
170
183
  """Returns a tuple with the points on each line respectively closest to the other.
171
184
 
172
185
  :param v1: First point of the first line
@@ -178,6 +191,7 @@ def intersect_line_line(
178
191
  :param v4: Second point of the second line
179
192
  :type v4: collections.abc.Sequence[float] | mathutils.Vector
180
193
  :return: The intersection on each line or None when the lines are co-linear.
194
+ :rtype: tuple[mathutils.Vector, mathutils.Vector]
181
195
  """
182
196
 
183
197
  def intersect_line_line_2d(
@@ -228,7 +242,7 @@ def intersect_line_sphere(
228
242
  sphere_co: collections.abc.Sequence[float] | mathutils.Vector,
229
243
  sphere_radius: float,
230
244
  clip=True,
231
- ) -> mathutils.Vector:
245
+ ) -> tuple[mathutils.Vector, mathutils.Vector]:
232
246
  """Takes a line (as 2 points) and a sphere (as a point and a radius) and
233
247
  returns the intersection
234
248
 
@@ -241,7 +255,7 @@ def intersect_line_sphere(
241
255
  :param sphere_radius: Radius of the sphere
242
256
  :type sphere_radius: float
243
257
  :return: The intersection points as a pair of vectors or None when there is no intersection
244
- :rtype: mathutils.Vector
258
+ :rtype: tuple[mathutils.Vector, mathutils.Vector]
245
259
  """
246
260
 
247
261
  def intersect_line_sphere_2d(
@@ -250,7 +264,7 @@ def intersect_line_sphere_2d(
250
264
  sphere_co: collections.abc.Sequence[float] | mathutils.Vector,
251
265
  sphere_radius: float,
252
266
  clip=True,
253
- ) -> mathutils.Vector:
267
+ ) -> tuple[mathutils.Vector, mathutils.Vector]:
254
268
  """Takes a line (as 2 points) and a sphere (as a point and a radius) and
255
269
  returns the intersection
256
270
 
@@ -263,7 +277,7 @@ def intersect_line_sphere_2d(
263
277
  :param sphere_radius: Radius of the sphere
264
278
  :type sphere_radius: float
265
279
  :return: The intersection points as a pair of vectors or None when there is no intersection
266
- :rtype: mathutils.Vector
280
+ :rtype: tuple[mathutils.Vector, mathutils.Vector]
267
281
  """
268
282
 
269
283
  def intersect_plane_plane(
@@ -271,7 +285,7 @@ def intersect_plane_plane(
271
285
  plane_a_no: collections.abc.Sequence[float] | mathutils.Vector,
272
286
  plane_b_co: collections.abc.Sequence[float] | mathutils.Vector,
273
287
  plane_b_no: collections.abc.Sequence[float] | mathutils.Vector,
274
- ):
288
+ ) -> tuple | tuple[mathutils.Vector, mathutils.Vector]:
275
289
  """Return the intersection between two planes
276
290
 
277
291
  :param plane_a_co: Point on the first plane
@@ -283,19 +297,21 @@ def intersect_plane_plane(
283
297
  :param plane_b_no: Normal of the second plane
284
298
  :type plane_b_no: collections.abc.Sequence[float] | mathutils.Vector
285
299
  :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]
286
301
  """
287
302
 
288
303
  def intersect_point_line(
289
304
  pt: collections.abc.Sequence[float] | mathutils.Vector,
290
305
  line_p1: collections.abc.Sequence[float] | mathutils.Vector,
291
306
  line_p2,
292
- ):
307
+ ) -> tuple[mathutils.Vector, float]:
293
308
  """Takes a point and a line and returns a tuple with the closest point on the line and its distance from the first point of the line as a percentage of the length of the line.
294
309
 
295
310
  :param pt: Point
296
311
  :type pt: collections.abc.Sequence[float] | mathutils.Vector
297
312
  :param line_p1: First point of the lineSecond point of the line
298
313
  :type line_p1: collections.abc.Sequence[float] | mathutils.Vector
314
+ :rtype: tuple[mathutils.Vector, float]
299
315
  """
300
316
 
301
317
  def intersect_point_quad_2d(
@@ -392,7 +408,7 @@ def intersect_sphere_sphere_2d(
392
408
  radius_a: float,
393
409
  p_b: collections.abc.Sequence[float] | mathutils.Vector,
394
410
  radius_b: float,
395
- ):
411
+ ) -> tuple | tuple[mathutils.Vector, mathutils.Vector]:
396
412
  """Returns 2 points on between intersecting circles.
397
413
 
398
414
  :param p_a: Center of the first circle
@@ -404,6 +420,7 @@ def intersect_sphere_sphere_2d(
404
420
  :param radius_b: Radius of the second circle
405
421
  :type radius_b: float
406
422
  :return: 2 points on between intersecting circles or None when there is no intersection.
423
+ :rtype: tuple | tuple[mathutils.Vector, mathutils.Vector]
407
424
  """
408
425
 
409
426
  def intersect_tri_tri_2d(tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3) -> bool:
@@ -420,23 +437,27 @@ def normal(vectors) -> mathutils.Vector:
420
437
  """
421
438
 
422
439
  def points_in_planes(
423
- planes, epsilon_coplanar: float = 0.0001, epsilon_isect: float = 1e-06
424
- ):
440
+ planes: list[collections.abc.Sequence[float] | mathutils.Vector],
441
+ epsilon_coplanar: float = 0.0001,
442
+ epsilon_isect: float = 1e-06,
443
+ ) -> tuple[list[mathutils.Vector], list[int]]:
425
444
  """Returns a list of points inside all planes given and a list of index values for the planes used.
426
445
 
427
446
  :param planes: List of planes (4D vectors).
447
+ :type planes: list[collections.abc.Sequence[float] | mathutils.Vector]
428
448
  :param epsilon_coplanar: Epsilon value for interpreting plane pairs as co-plannar.
429
449
  :type epsilon_coplanar: float
430
450
  :param epsilon_isect: Epsilon value for intersection.
431
451
  :type epsilon_isect: float
432
452
  :return: Two lists, once containing the 3D coordinates inside the planes, another containing the plane indices used.
453
+ :rtype: tuple[list[mathutils.Vector], list[int]]
433
454
  """
434
455
 
435
- def tessellate_polygon(polylines) -> int:
456
+ def tessellate_polygon(polylines) -> list[tuple[int, int, int]]:
436
457
  """Takes a list of polylines (each point a pair or triplet of numbers) and returns the point indices for a polyline filled with triangles. Does not handle degenerate geometry (such as zero-length lines due to consecutive identical points).
437
458
 
438
459
  :param polylines: Polygons where each polygon is a sequence of 2D or 3D points.
439
- :rtype: int
460
+ :rtype: list[tuple[int, int, int]]
440
461
  """
441
462
 
442
463
  def volume_tetrahedron(
@@ -7,9 +7,10 @@ import typing
7
7
  import collections.abc
8
8
  import typing_extensions
9
9
 
10
- def poly_3d_calc(veclist, pt):
10
+ def poly_3d_calc(veclist, pt) -> list[float]:
11
11
  """Calculate barycentric weights for a point on a polygon.
12
12
 
13
13
  :param veclist: Sequence of 3D positions.
14
14
  :param pt: 2D or 3D position. :type pt: Sequence[float] :return: list of per-vector weights.
15
+ :rtype: list[float]
15
16
  """
@@ -8,6 +8,7 @@ Generic 3-dimensional kd-tree to perform spatial searches.
8
8
  import typing
9
9
  import collections.abc
10
10
  import typing_extensions
11
+ import mathutils
11
12
 
12
13
  class KDTree:
13
14
  """KdTree(size) -> new kd-tree initialized to hold size items."""
@@ -15,34 +16,38 @@ class KDTree:
15
16
  def balance(self):
16
17
  """Balance the tree."""
17
18
 
18
- def find(self, co, filter: collections.abc.Callable | None = None) -> int:
19
+ def find(
20
+ self, co, filter: collections.abc.Callable | None = None
21
+ ) -> tuple[mathutils.Vector, int, float]:
19
22
  """Find nearest point to co.
20
23
 
21
24
  :param co: 3D coordinates.
22
25
  :param filter: function which takes an index and returns True for indices to include in the search.
23
26
  :type filter: collections.abc.Callable | None
24
27
  :return: Returns (position, index, distance).
25
- :rtype: int
28
+ :rtype: tuple[mathutils.Vector, int, float]
26
29
  """
27
30
 
28
- def find_n(self, co, n: int) -> int:
31
+ def find_n(self, co, n: int) -> list[tuple[mathutils.Vector, int, float]]:
29
32
  """Find nearest n points to co.
30
33
 
31
34
  :param co: 3D coordinates.
32
35
  :param n: Number of points to find.
33
36
  :type n: int
34
37
  :return: Returns a list of tuples (position, index, distance).
35
- :rtype: int
38
+ :rtype: list[tuple[mathutils.Vector, int, float]]
36
39
  """
37
40
 
38
- def find_range(self, co, radius: float) -> int:
41
+ def find_range(
42
+ self, co, radius: float
43
+ ) -> list[tuple[mathutils.Vector, int, float]]:
39
44
  """Find all points within radius of co.
40
45
 
41
46
  :param co: 3D coordinates.
42
47
  :param radius: Distance to search for points.
43
48
  :type radius: float
44
49
  :return: Returns a list of tuples (position, index, distance).
45
- :rtype: int
50
+ :rtype: list[tuple[mathutils.Vector, int, float]]
46
51
  """
47
52
 
48
53
  def insert(self, co, index: int):
@@ -295,7 +295,7 @@ def voronoi(
295
295
  position: collections.abc.Sequence[float] | mathutils.Vector,
296
296
  distance_metric: str = "DISTANCE",
297
297
  exponent: float = 2.5,
298
- ):
298
+ ) -> list[list[float], list[mathutils.Vector]]:
299
299
  """Returns a list of distances to the four closest features and their locations.
300
300
 
301
301
  :param position: The position to evaluate the selected noise function.
@@ -305,4 +305,5 @@ def voronoi(
305
305
  :param exponent: The exponent for Minkowski distance metric.
306
306
  :type exponent: float
307
307
  :return: A list of distances to the four closest features and their locations.
308
+ :rtype: list[list[float], list[mathutils.Vector]]
308
309
  """