【Manim动画教程】——基本几何 【弧-上】

 1.标注点(AnnotationDot)

具有较大半径和粗体笔触的点,用于注释场景。

class AnnotationDot(radius=0.10400000000000001, stroke_width=5, 
stroke_color=ManimColor('#FFFFFF'), 
fill_color=ManimColor('#58C4DD'), **kwargs)

 实例代码:

from manim import *
class AnnotationDot2(Scene):
    def construct(self):
        self.camera.background_color =BLACK
        #dot = AnnotationDot(radius=1, stroke_width=20, stroke_color=WHITE, fill_color=RED)
        dot01 = AnnotationDot(radius=0.05, stroke_width=30, stroke_color=WHITE,fill_color=RED)
        self.add(dot01)
        #self.play(Create(dot))
        self.wait(1)

运行结果:

参数:

  • 半径float):小点的半径,stroke_width (float):外圈的颜色

  • stroke_color("Manim的颜色"):外圈的颜色,fill_color ("Manim的颜色"):内圈的颜色

from manim import *

class AnnularSectorExample(Scene):
    def construct(self):
        
        self.camera.background_color = WHITE

       axis.
        s1 = AnnularSector(color=YELLOW).move_to(2 * UL)

        
        s2 = AnnularSector(inner_radius=1.5, outer_radius=2, angle=45 * DEGREES, color=RED).move_to(2 * UR)

        AnnularSector is transparent.
        s3 = AnnularSector(inner_radius=1, outer_radius=1.5, angle=PI, fill_opacity=0.25, color=BLUE).move_to(2 * DL)

        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)

 运行结果:

环形的一个扇区。

参数:

  • inner_radius浮点数) – 环形扇区的内半径。

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

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

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

  • fill_opacity浮点数) – 环形扇区中填充的颜色的不透明度。

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

  • color () - 填充到环形扇区的颜色。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Yasen.M

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值