Cube¶
Qualified name: manim.mobject.three\_d.three\_dimensions.Cube
- class Cube(side_length=2, fill_opacity=0.75, fill_color=ManimColor('#58C4DD'), stroke_width=0, **kwargs)[source]¶
Bases:
VGroupA three-dimensional cube.
- Parameters:
side_length (float) – Length of each side of the
Cube.fill_opacity (float) – The opacity of the
Cube, from 0 being fully transparent to 1 being fully opaque. Defaults to 0.75.fill_color (ParsableManimColor) – The color of the
Cube.stroke_width (float) – The width of the stroke surrounding each face of the
Cube.kwargs (Any)
Examples
Example: CubeExample ¶
from manim import * class CubeExample(ThreeDScene): def construct(self): self.set_camera_orientation(phi=75*DEGREES, theta=-45*DEGREES) axes = ThreeDAxes() cube = Cube(side_length=3, fill_opacity=0.7, fill_color=BLUE) self.add(cube)
class CubeExample(ThreeDScene): def construct(self): self.set_camera_orientation(phi=75*DEGREES, theta=-45*DEGREES) axes = ThreeDAxes() cube = Cube(side_length=3, fill_opacity=0.7, fill_color=BLUE) self.add(cube)Methods
Creates the sides of the
Cube.init_pointsAttributes
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__(side_length=2, fill_opacity=0.75, fill_color=ManimColor('#58C4DD'), stroke_width=0, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
side_length (float)
fill_opacity (float)
fill_color (ParsableManimColor)
stroke_width (float)
kwargs (Any)
- Return type:
None