diff --git a/manim/mobject/geometry/arc.py b/manim/mobject/geometry/arc.py index 3ade6d150b..f1390d3874 100644 --- a/manim/mobject/geometry/arc.py +++ b/manim/mobject/geometry/arc.py @@ -63,13 +63,12 @@ def construct(self): ) if TYPE_CHECKING: + import manim.mobject.geometry.tips as tips from manim.mobject.mobject import Mobject from manim.mobject.text.tex_mobject import SingleStringMathTex, Tex from manim.mobject.text.text_mobject import Text from manim.typing import CubicBezierPoints, Point3D, QuadraticBezierPoints, Vector - import manim.mobject.geometry.tips as tips - Angle: TypeAlias = Union[float, np.float64] @@ -170,9 +169,7 @@ def get_unpositioned_tip( tip = tip_shape(length=tip_length, **style) return tip - def position_tip( - self, tip: tips.ArrowTip, at_start: bool = False - ): + def position_tip(self, tip: tips.ArrowTip, at_start: bool = False): # Last two control points, defining both # the end, and the tangency direction if at_start: @@ -199,9 +196,7 @@ def position_tip( tip.shift(anchor - tip.tip_point) return tip - def reset_endpoints_based_on_tip( - self, tip: tips.ArrowTip, at_start: bool - ) -> Self: + def reset_endpoints_based_on_tip(self, tip: tips.ArrowTip, at_start: bool) -> Self: if self.get_length() == 0: # Zero length, put_start_and_end_on wouldn't work return self @@ -212,9 +207,7 @@ def reset_endpoints_based_on_tip( self.put_start_and_end_on(self.get_start(), tip.base) return self - def asign_tip_attr( - self, tip: tips.ArrowTip, at_start: bool - ) -> Self: + def asign_tip_attr(self, tip: tips.ArrowTip, at_start: bool) -> Self: if at_start: self.start_tip = tip else: diff --git a/manim/mobject/geometry/boolean_ops.py b/manim/mobject/geometry/boolean_ops.py index 87dea629f9..0bc33d70b0 100644 --- a/manim/mobject/geometry/boolean_ops.py +++ b/manim/mobject/geometry/boolean_ops.py @@ -21,6 +21,7 @@ class _BooleanOps(VMobject, metaclass=ConvertToOpenGL): helps to convert to and from skia objects and manim objects (:class:`~.VMobject`). """ + def _convert_2d_to_3d_array( self, points: Point2D_Array, diff --git a/manim/utils/bezier.py b/manim/utils/bezier.py index 20ac78fd10..d687364abc 100644 --- a/manim/utils/bezier.py +++ b/manim/utils/bezier.py @@ -350,14 +350,14 @@ def inverse_interpolate(start: float, end: float, value: float) -> float: def inverse_interpolate(start: float, end: float, value: Point3D) -> Point3D: ... + @overload def inverse_interpolate(start: Point3D, end: Point3D, value: Point3D) -> Point3D: ... + def inverse_interpolate( - start: float | Point3D, - end: float | Point3D, - value: float | Point3D + start: float | Point3D, end: float | Point3D, value: float | Point3D ) -> float | Point3D: """Perform inverse interpolation to determine the alpha values that would produce the specified ``value`` @@ -372,7 +372,7 @@ def inverse_interpolate( value The value or point for which the alpha value should be determined. - + Returns ------- The alpha values producing the given input diff --git a/manim/utils/space_ops.py b/manim/utils/space_ops.py index 848dbfd3c4..16af964e74 100644 --- a/manim/utils/space_ops.py +++ b/manim/utils/space_ops.py @@ -623,9 +623,8 @@ def shoelace_direction(x_y: np.ndarray) -> str: def cross2d( - a: Sequence[Vector] | Vector, - b: Sequence[Vector] | Vector - ) -> Sequence[float] | float: + a: Sequence[Vector] | Vector, b: Sequence[Vector] | Vector +) -> Sequence[float] | float: """Compute the determinant(s) of the passed vector (sequences). @@ -635,7 +634,7 @@ def cross2d( A vector or a sequence of vectors. b A vector or a sequence of vectors. - + Returns ------- Sequence[float] | float @@ -650,8 +649,8 @@ def cross2d( >>> cross2d(np.array([1, 2]), np.array([3, 4])) -2 >>> cross2d( - ... np.array([[1, 2, 0], [1, 0, 0]]), - ... np.array([[3, 4, 0], [0, 1, 0]]), + ... np.array([[1, 2, 0], [1, 0, 0]]), + ... np.array([[3, 4, 0], [0, 1, 0]]), ... ) array([-2, 1]) """