Torus¶
Qualified name: manim.mobject.three\_d.three\_dimensions.Torus
- class Torus(major_radius=3, minor_radius=1, u_range=(0, 6.283185307179586), v_range=(0, 6.283185307179586), resolution=None, **kwargs)[source]¶
Bases:
SurfaceA torus.
- Parameters:
major_radius (float) – Distance from the center of the tube to the center of the torus.
minor_radius (float) – Radius of the tube.
u_range (tuple[float, float]) – The range of the
uvariable:(u_min, u_max).v_range (tuple[float, float]) – The range of the
vvariable:(v_min, v_max).resolution (int | tuple[int, int] | None) – The number of samples taken of the
Torus. A tuple can be used to define different resolutions foruandvrespectively.kwargs (Any)
Examples
Example: ExampleTorus ¶
from manim import * class ExampleTorus(ThreeDScene): def construct(self): axes = ThreeDAxes() torus = Torus() self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES) self.add(axes, torus)
class ExampleTorus(ThreeDScene): def construct(self): axes = ThreeDAxes() torus = Torus() self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES) self.add(axes, torus)Methods
Attributes
alwaysCall a method on a mobject every frame.
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe width of the mobject.
- _original__init__(major_radius=3, minor_radius=1, u_range=(0, 6.283185307179586), v_range=(0, 6.283185307179586), resolution=None, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
major_radius (float)
minor_radius (float)
u_range (tuple[float, float])
v_range (tuple[float, float])
resolution (int | tuple[int, int] | None)
kwargs (Any)
- Return type:
None