from manim import *
class SpinInDemo(Scene):
    def construct(self):
        title = Text("SpinInFromNothing：旋转着从无到有", font="STLiti", font_size=32).to_edge(UP)
        self.play(FadeIn(title), run_time=0.6)
        p1 = RegularPolygon(5, color=WHITE, stroke_width=8).scale(1.0).shift(LEFT * 3.4)
        p2 = RegularPolygon(6, color=RED, stroke_width=8).scale(1.0)
        p3 = RegularPolygon(8, color=YELLOW, stroke_width=8).scale(1.0).shift(RIGHT * 3.4)
        self.play(SpinInFromNothing(p1), run_time=1.0)
        self.play(SpinInFromNothing(p2, angle=PI, point_color=PINK), run_time=1.0)
        self.play(SpinInFromNothing(p3, angle=3 * PI / 2, point_color=PINK), run_time=1.0)
        note = Text("angle 控制出场前旋转的角度，2*PI 为一整圈", font="STLiti", font_size=21, color=YELLOW).to_edge(DOWN)
        self.play(FadeIn(note), run_time=0.5)
        self.wait(2.2)
