立方体¶
全限定名: manim.mobject.three\_d.three\_dimensions.Cube
- 类 Cube(side_length=2, fill_opacity=0.75, fill_color=ManimColor('#58C4DD'), stroke_width=0, **kwargs)[source]¶
基类:
VGroup
一个三维立方体。
- 参数:
side_length (float) –
Cube
的每条边的长度。fill_opacity (float) –
Cube
的透明度,从0(完全透明)到1(完全不透明)。默认为0.75。fill_color (ParsableManimColor) –
Cube
的颜色。stroke_width (float) –
Cube
的每个面周围描边的宽度。
示例
示例: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)
方法
属性
animate (动画)
用于动画化
self
的任何方法的应用。animation_overrides (动画覆盖)
颜色
depth (深度)
mobject 的深度。
fill_color (填充颜色)
如果存在多种颜色(用于渐变),则返回第一种颜色
height (高度)
mobject 的高度。
n_points_per_curve (每条曲线的点数)
sheen_factor (光泽因子)
stroke_color (描边颜色)
width (宽度)
mobject 的宽度。
- _original__init__(side_length=2, fill_opacity=0.75, fill_color=ManimColor('#58C4DD'), stroke_width=0, **kwargs)¶
初始化自身。有关准确签名,请参阅 help(type(self))。
- 参数:
side_length (float)
fill_opacity (float)
fill_color (ParsableManimColor)
stroke_width (浮点数)
- 返回类型:
无