环形扇形

限定名称: manim.mobject.geometry.arc.AnnularSector

class AnnularSector(inner_radius=1, outer_radius=2, angle=1.5707963267948966, start_angle=0, fill_opacity=1, stroke_width=0, color=ManimColor('#FFFFFF'), **kwargs)[source]

基类: Arc

圆环的一个扇形。

参数:
  • inner_radius (float) – 环形扇形的内半径。

  • outer_radius (float) – 环形扇形的外半径。

  • angle (float) – 环形扇形的顺时针角度。

  • start_angle (float) – 环形扇形的起始顺时针角度。

  • fill_opacity (float) – 环形扇形填充颜色的不透明度。

  • stroke_width (float) – 环形扇形的描边宽度。

  • color (ParsableManimColor) – 环形扇形的填充颜色。

  • kwargs (Any)

示例

示例: AnnularSectorExample

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

class AnnularSectorExample(Scene):
    def construct(self):
        # Changes background color to clearly visualize changes in fill_opacity.
        self.camera.background_color = WHITE

        # The default parameter start_angle is 0, so the AnnularSector starts from the +x-axis.
        s1 = AnnularSector(color=YELLOW).move_to(2 * UL)

        # Different inner_radius and outer_radius than the default.
        s2 = AnnularSector(inner_radius=1.5, outer_radius=2, angle=45 * DEGREES, color=RED).move_to(2 * UR)

        # fill_opacity is typically a number > 0 and <= 1. If fill_opacity=0, the AnnularSector is transparent.
        s3 = AnnularSector(inner_radius=1, outer_radius=1.5, angle=PI, fill_opacity=0.25, color=BLUE).move_to(2 * DL)

        # With a negative value for the angle, the AnnularSector is drawn clockwise from the start value.
        s4 = AnnularSector(inner_radius=1, outer_radius=1.5, angle=-3 * PI / 2, color=GREEN).move_to(2 * DR)

        self.add(s1, s2, s3, s4)
class AnnularSectorExample(Scene):
    def construct(self):
        # Changes background color to clearly visualize changes in fill_opacity.
        self.camera.background_color = WHITE

        # The default parameter start_angle is 0, so the AnnularSector starts from the +x-axis.
        s1 = AnnularSector(color=YELLOW).move_to(2 * UL)

        # Different inner_radius and outer_radius than the default.
        s2 = AnnularSector(inner_radius=1.5, outer_radius=2, angle=45 * DEGREES, color=RED).move_to(2 * UR)

        # fill_opacity is typically a number > 0 and <= 1. If fill_opacity=0, the AnnularSector is transparent.
        s3 = AnnularSector(inner_radius=1, outer_radius=1.5, angle=PI, fill_opacity=0.25, color=BLUE).move_to(2 * DL)

        # With a negative value for the angle, the AnnularSector is drawn clockwise from the start value.
        s4 = AnnularSector(inner_radius=1, outer_radius=1.5, angle=-3 * PI / 2, color=GREEN).move_to(2 * DR)

        self.add(s1, s2, s3, s4)

方法

generate_points (生成点)

初始化 points,从而确定形状。

init_points (初始化点)

初始化 points,从而确定形状。

属性

animate (动画)

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

animation_overrides (动画覆盖)

颜色

depth (深度)

mobject 的深度。

fill_color (填充颜色)

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

height (高度)

mobject 的高度。

n_points_per_curve (每条曲线的点数)

sheen_factor (光泽因子)

stroke_color (描边颜色)

width (宽度)

mobject 的宽度。

_original__init__(inner_radius=1, outer_radius=2, angle=1.5707963267948966, start_angle=0, fill_opacity=1, stroke_width=0, color=ManimColor('#FFFFFF'), **kwargs)

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

参数:
  • inner_radius (float)

  • outer_radius (float)

  • angle (float)

  • start_angle (float)

  • fill_opacity (float)

  • stroke_width (浮点数)

  • color (ParsableManimColor)

  • kwargs (Any)

返回类型:

generate_points()[source]

初始化 points,从而确定形状。

在创建时调用。这是一个空方法,可由子类实现。

返回类型:

init_points()

初始化 points,从而确定形状。

在创建时调用。这是一个空方法,可由子类实现。

返回类型: