From a0e841f21556035a3298e994b30bc21f36ace14f Mon Sep 17 00:00:00 2001 From: Samarth Naik Date: Wed, 29 Oct 2025 22:09:40 +0530 Subject: [PATCH 1/3] refactor: rename Torus field 'r' to 'minor_radius' for clarity --- manim/mobject/three_d/three_dimensions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manim/mobject/three_d/three_dimensions.py b/manim/mobject/three_d/three_dimensions.py index ccbc4dea91..a5e2c10fb1 100644 --- a/manim/mobject/three_d/three_dimensions.py +++ b/manim/mobject/three_d/three_dimensions.py @@ -1254,7 +1254,7 @@ def __init__( resolution = resolution if resolution is not None else res_value self.R = major_radius - self.r = minor_radius + self.minor_radius = minor_radius super().__init__( self.func, u_range=u_range, @@ -1271,5 +1271,5 @@ def func(self, u: float, v: float) -> np.ndarray: :class:`numpy.ndarray` The z values defining the :class:`Torus`. """ - P = np.array([np.cos(u), np.sin(u), 0]) - return (self.R - self.r * np.cos(v)) * P - self.r * np.sin(v) * OUT + P = np.array([np.cos(u), np.sin(u), 0]) + return (self.R - self.minor_radius * np.cos(v)) * P - self.minor_radius * np.sin(v) * OUT From 74740326b5a67ae366fd6b3aabeb056952221ff2 Mon Sep 17 00:00:00 2001 From: Samarth Naik Date: Wed, 29 Oct 2025 22:19:16 +0530 Subject: [PATCH 2/3] fixed intendation --- manim/mobject/three_d/three_dimensions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manim/mobject/three_d/three_dimensions.py b/manim/mobject/three_d/three_dimensions.py index a5e2c10fb1..b25502491e 100644 --- a/manim/mobject/three_d/three_dimensions.py +++ b/manim/mobject/three_d/three_dimensions.py @@ -1271,5 +1271,5 @@ def func(self, u: float, v: float) -> np.ndarray: :class:`numpy.ndarray` The z values defining the :class:`Torus`. """ - P = np.array([np.cos(u), np.sin(u), 0]) - return (self.R - self.minor_radius * np.cos(v)) * P - self.minor_radius * np.sin(v) * OUT + P = np.array([np.cos(u), np.sin(u), 0]) + return (self.R - self.minor_radius * np.cos(v)) * P - self.minor_radius * np.sin(v) * OUT From 22a45bb2f8941f55d7522c45cf762078325c643d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 16:50:02 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- manim/mobject/three_d/three_dimensions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manim/mobject/three_d/three_dimensions.py b/manim/mobject/three_d/three_dimensions.py index b25502491e..86ecf0917c 100644 --- a/manim/mobject/three_d/three_dimensions.py +++ b/manim/mobject/three_d/three_dimensions.py @@ -1272,4 +1272,6 @@ def func(self, u: float, v: float) -> np.ndarray: The z values defining the :class:`Torus`. """ P = np.array([np.cos(u), np.sin(u), 0]) - return (self.R - self.minor_radius * np.cos(v)) * P - self.minor_radius * np.sin(v) * OUT + return ( + self.R - self.minor_radius * np.cos(v) + ) * P - self.minor_radius * np.sin(v) * OUT