1313from manim .mobject .types .vectorized_mobject import VMobject
1414
1515if TYPE_CHECKING :
16- from manim .typing import Point2D_Array , Point3D_Array
16+ from typing import Any
17+
18+ from manim .typing import InternalPoint3D_Array , Point2D_Array
1719
1820from ...constants import RendererType
1921
@@ -30,7 +32,7 @@ def _convert_2d_to_3d_array(
3032 self ,
3133 points : Point2D_Array ,
3234 z_dim : float = 0.0 ,
33- ) -> Point3D_Array :
35+ ) -> InternalPoint3D_Array :
3436 """Converts an iterable with coordinates in 2D to 3D by adding
3537 :attr:`z_dim` as the Z coordinate.
3638
@@ -51,13 +53,14 @@ def _convert_2d_to_3d_array(
5153 >>> a = _BooleanOps()
5254 >>> p = [(1, 2), (3, 4)]
5355 >>> a._convert_2d_to_3d_array(p)
54- [array([1., 2., 0.]), array([3., 4., 0.])]
56+ array([[1., 2., 0.],
57+ [3., 4., 0.]])
5558 """
56- points = list (points )
57- for i , point in enumerate (points ):
59+ list_of_points = list (points )
60+ for i , point in enumerate (list_of_points ):
5861 if len (point ) == 2 :
59- points [i ] = np .array (list (point ) + [z_dim ])
60- return points
62+ list_of_points [i ] = np .array (list (point ) + [z_dim ])
63+ return np . asarray ( list_of_points )
6164
6265 def _convert_vmobject_to_skia_path (self , vmobject : VMobject ) -> SkiaPath :
6366 """Converts a :class:`~.VMobject` to SkiaPath. This method only works for
@@ -95,7 +98,7 @@ def _convert_vmobject_to_skia_path(self, vmobject: VMobject) -> SkiaPath:
9598 if vmobject .consider_points_equals (subpath [0 ], subpath [- 1 ]):
9699 path .close ()
97100 elif config .renderer == RendererType .CAIRO :
98- subpaths = vmobject .gen_subpaths_from_points_2d (points )
101+ subpaths = vmobject .gen_subpaths_from_points_2d (points ) # type: ignore[assignment]
99102 for subpath in subpaths :
100103 quads = vmobject .gen_cubic_bezier_tuples_from_points (subpath )
101104 start = subpath [0 ]
@@ -177,7 +180,7 @@ def construct(self):
177180
178181 """
179182
180- def __init__ (self , * vmobjects : VMobject , ** kwargs ) -> None :
183+ def __init__ (self , * vmobjects : VMobject , ** kwargs : Any ) -> None :
181184 if len (vmobjects ) < 2 :
182185 raise ValueError ("At least 2 mobjects needed for Union." )
183186 super ().__init__ (** kwargs )
@@ -216,7 +219,7 @@ def construct(self):
216219
217220 """
218221
219- def __init__ (self , subject : VMobject , clip : VMobject , ** kwargs ) -> None :
222+ def __init__ (self , subject : VMobject , clip : VMobject , ** kwargs : Any ) -> None :
220223 super ().__init__ (** kwargs )
221224 outpen = SkiaPath ()
222225 difference (
@@ -258,7 +261,7 @@ def construct(self):
258261
259262 """
260263
261- def __init__ (self , * vmobjects : VMobject , ** kwargs ) -> None :
264+ def __init__ (self , * vmobjects : VMobject , ** kwargs : Any ) -> None :
262265 if len (vmobjects ) < 2 :
263266 raise ValueError ("At least 2 mobjects needed for Intersection." )
264267
@@ -311,7 +314,7 @@ def construct(self):
311314
312315 """
313316
314- def __init__ (self , subject : VMobject , clip : VMobject , ** kwargs ) -> None :
317+ def __init__ (self , subject : VMobject , clip : VMobject , ** kwargs : Any ) -> None :
315318 super ().__init__ (** kwargs )
316319 outpen = SkiaPath ()
317320 xor (
0 commit comments