解释
逐行回顾一下您刚刚执行的脚本,看看 Manim 的情况如何能够画圆。
第一行导入库的所有内容:
from manim import *
这是使用 Manim 的推荐方法,因为单个脚本经常使用 来自 Manim 命名空间的多个名称。在脚本中,您导入并使用了Scene
、 Circle
、PINK
和Create
。
现在让我们看看接下来的两行:
class CreateCircle(Scene):
def construct(self):
[...]
接下来的两行创建一个圆圈并设置其颜色和不透明度:
circle = Circle() # create a circle
circle.set_fill(PINK, opacity=0.5) # set the color and transparency
最后,最后一行使用动画 'Create' 在屏幕上显示圆圈:
self.play(Create(circle)) # show the circle on screen
Last updated