Skip to content

Commit ef675b6

Browse files
Fix typehint of Vector direction parameter (#3640)
* Fix typehint of Vector * Change from Vector to Point in typehint In `TipableVMobject._pointify` it converts a 3D list of the form [x, y, z] to a Vector3D. Therefore the direction parameter can take lists, not just numpy arrays.
1 parent afe1d18 commit ef675b6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

manim/mobject/geometry/line.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from typing import TYPE_CHECKING
1818

1919
import numpy as np
20-
from typing_extensions import Self
2120

2221
from manim import config
2322
from manim.constants import *
@@ -31,6 +30,8 @@
3130
from manim.utils.space_ops import angle_of_vector, line_intersection, normalize
3231

3332
if TYPE_CHECKING:
33+
from typing_extensions import Self
34+
3435
from manim.typing import Point2D, Point3D, Vector3D
3536
from manim.utils.color import ParsableManimColor
3637

@@ -659,7 +660,9 @@ def construct(self):
659660
self.add(plane, vector_1, vector_2)
660661
"""
661662

662-
def __init__(self, direction: Vector3D = RIGHT, buff: float = 0, **kwargs) -> None:
663+
def __init__(
664+
self, direction: Point2D | Point3D = RIGHT, buff: float = 0, **kwargs
665+
) -> None:
663666
self.buff = buff
664667
if len(direction) == 2:
665668
direction = np.hstack([direction, 0])

0 commit comments

Comments
 (0)