棱镜

限定名称: 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

../_images/ExamplePrism-1.png
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)

方法

generate_points

创建Prism的侧面。

属性

animate

用于动画化self的任何方法的应用。

animation_overrides

color

depth

mobject的深度。

fill_color

如果有多种颜色(用于渐变),则返回第一个颜色

height

mobject的高度。

n_points_per_curve

sheen_factor

stroke_color

width

mobject的宽度。

_original__init__(dimensions=[3, 2, 1], **kwargs)

初始化自身。有关准确的签名,请参阅 help(type(self))。

Parameters:

尺寸 (元组[浮点数, 浮点数, 浮点数] | ndarray)

Return type:

generate_points()[来源]

创建Prism的侧面。

Return type: