棱镜¶
限定名称: manim.mobject.three\_d.three\_dimensions.Prism
- class Prism(dimensions=[3, 2, 1], **kwargs)[source]¶
基础类:
Cube一个直角棱柱(或长方体)。 由每边的长度以
[x, y, z]格式定义。- Parameters:
尺寸 (元组[浮点数, 浮点数, 浮点数] | np.ndarray) –
Prism的尺寸,格式为[x, y, z]。
示例
示例:ExamplePrism ¶
from manim import * class ExamplePrism(ThreeDScene): def construct(self): self.set_camera_orientation(phi=60 * DEGREES, theta=150 * DEGREES) prismSmall = Prism(dimensions=[1, 2, 3]).rotate(PI / 2) prismLarge = Prism(dimensions=[1.5, 3, 4.5]).move_to([2, 0, 0]) self.add(prismSmall, prismLarge)
class ExamplePrism(ThreeDScene): def construct(self): self.set_camera_orientation(phi=60 * DEGREES, theta=150 * DEGREES) prismSmall = Prism(dimensions=[1, 2, 3]).rotate(PI / 2) prismLarge = Prism(dimensions=[1.5, 3, 4.5]).move_to([2, 0, 0]) self.add(prismSmall, prismLarge)方法
创建
Prism的侧面。属性
animate用于动画化
self的任何方法的应用。animation_overridescolordepthmobject的深度。
fill_color如果有多种颜色(用于渐变),则返回第一个颜色
heightmobject的高度。
n_points_per_curvesheen_factorstroke_colorwidthmobject的宽度。
- _original__init__(dimensions=[3, 2, 1], **kwargs)¶
初始化自身。有关准确的签名,请参阅 help(type(self))。
- Parameters:
尺寸 (元组[浮点数, 浮点数, 浮点数] | ndarray)
- Return type:
无