ManimCommunity / manim

A community-maintained Python framework for creating mathematical animations.
https://www.manim.community
MIT License
20.97k stars 1.53k forks source link

Rotating a point on a ellipse #2378

Open juliomulero opened 2 years ago

juliomulero commented 2 years ago

Description of bug / unexpected behavior

When creating the typical representation of the ellipse with a rotating point and segments to the focuses, the animation do not finish over the horizontal axis.

Expected behavior

The point must rotate TAU radians and finish its trajectory on the horizontal axis.

How to reproduce the issue

Code for reproducing the problem ```py class elipse(Scene): def construct(self): elipse = Ellipse(width=5.6, height=4.0, color=BLUE) foco1 = Dot().move_to(1.96*LEFT) foco2 = Dot().move_to(1.96*RIGHT) t = ValueTracker(0) dot = always_redraw(lambda : Dot(elipse.point_at_angle(t.get_value()))) line_L = always_redraw(lambda : Line(start = foco2.get_center(), end = dot.get_center(), color = RED, buff = 0.1)) Line_R = always_redraw(lambda : Line(start = foco1.get_center(), end = dot.get_center(), color = GREEN, buff = 0.1)) self.add(elipse) self.add(dot,foco1,foco2) self.play(Create(Line_R), Create(line_L)) self.play(t.animate.set_value(TAU),run_time=5, rate_func=linear) ```

Additional comments

As ad_chaos suggested me in discord, the problem is solved by adding self.wait() at the end of the code.

netwizard22 commented 2 years ago

Yes, for some reason the last frame of the animation is not processed if it's the last animation in the scene. Adding self.wait() resolves this problem. I think you need to close this issue. Nvm, this is still a bug. Perhaps you need to rename it into last frame is not rendering