Arrow3D

限定名称: manim.mobject.three\_d.three\_dimensions.Arrow3D

Arrow3D(start=array([-1., 0., 0.]), end=array([1., 0., 0.]), thickness=0.02, height=0.3, base_radius=0.08, color=ManimColor('#FFFFFF'), resolution=24, **kwargs)[source]

基类: Line3D

由圆柱形线条和锥形尖端组成的箭头。

参数:
  • start (np.ndarray) – 箭头的起始位置。

  • end (np.ndarray) – 箭头的结束位置。

  • thickness (float) – 箭头的粗细。

  • height (float) – 锥形尖端的高度。

  • base_radius (float) – 锥形尖端的基部半径。

  • color (ParsableManimColor) – 箭头的颜色。

  • resolution (int | Sequence[int]) – 箭头线条的分辨率。

示例

示例: ExampleArrow3D

../_images/ExampleArrow3D-1.png
from manim import *

class ExampleArrow3D(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes()
        arrow = Arrow3D(
            start=np.array([0, 0, 0]),
            end=np.array([2, 2, 2]),
            resolution=8
        )
        self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)
        self.add(axes, arrow)
class ExampleArrow3D(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes()
        arrow = Arrow3D(
            start=np.array([0, 0, 0]),
            end=np.array([2, 2, 2]),
            resolution=8
        )
        self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)
        self.add(axes, arrow)

方法

获取终点

返回 Line3D 的结束点。

属性

animate (动画)

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

animation_overrides (动画覆盖)

颜色

depth (深度)

mobject 的深度。

fill_color (填充颜色)

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

height (高度)

mobject 的高度。

n_points_per_curve (每条曲线的点数)

sheen_factor (光泽因子)

stroke_color (描边颜色)

width (宽度)

mobject 的宽度。

_original__init__(start=array([-1., 0., 0.]), end=array([1., 0., 0.]), thickness=0.02, height=0.3, base_radius=0.08, color=ManimColor('#FFFFFF'), resolution=24, **kwargs)

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

参数:
  • start (ndarray)

  • end (ndarray)

  • thickness (float)

  • 高度 (浮点数)

  • base_radius (float)

  • color (ParsableManimColor)

  • resolution (int | Sequence[int])

返回类型:

get_end()[source]

返回 Line3D 的结束点。

返回:

endLine3D 的结束点。

返回类型:

numpy.array