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 (Sequence[float]) – The range of the
uvariable:(u_min, u_max).v_range (Sequence[float]) – The range of the
vvariable:(v_min, v_max).resolution (Sequence[int]) – The number of samples taken of the
Torus. A tuple can be used to define different resolutions foruandvrespectively.
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)
Methods
Attributes
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.