manim icon indicating copy to clipboard operation
manim copied to clipboard

Animating Circle.set_fill results in a weird pattern.

Open Srivaths-P opened this issue 4 years ago • 1 comments

Animating Circle.set_fill results in a weird pattern as follows:

https://user-images.githubusercontent.com/41336229/125058195-ac5fb800-e0c7-11eb-9a75-3f5ee05589de.mp4

Code:

from manimlib import *

class Test(Scene):
    def construct(self):
        circle = Circle(color=BLUE).set_fill(BLUE, opacity=0.5)
        self.play(ShowCreation(circle))
        self.wait()

Also, how do I animate the fill smoothly?

Srivaths-P avatar Jul 09 '21 09:07 Srivaths-P

I didn't find a way to do that other than fading between 2 instance of Circle with ReplacementTransform. (Mind you, I'm not the most proficient with Manim.)

class Test(Scene):
    def construct(self):
        circle = Circle(color=BLUE)
        circle2 = Circle(color=BLUE).set_fill(BLUE, opacity=0.5)
        self.play(ShowCreation(circle))
        self.play(ReplacementTransform(circle, circle2))
        self.wait()

https://user-images.githubusercontent.com/73761711/134973491-88e51fef-9d8b-45d8-9209-32201b6426f5.mp4

Leoriem-code avatar Sep 27 '21 19:09 Leoriem-code