Open
Description
Description of bug / unexpected behavior
Rendering the scene below twice with caching enabled results in a false placement of one object at the end.
(follow-up of https://discord.com/channels/581738731934056449/1337379695628521513/1337379695628521513 )
Expected behavior
The second (and subsequent) rendering of the scene should result in the same output as the first rendering.
How to reproduce the issue
Code for reproducing the problem
class Sin2(Scene):
def construct(self):
ax = Axes(x_range=(-2, 2, 1), y_range=(-2, 2, 1), x_length=6)
trigo_circle = Circle(radius=1.5)
self.add(ax, trigo_circle, Dot(color=RED).shift(1.5*RIGHT))
theta = ValueTracker(0)
neg_point = always_redraw(
lambda: Dot(
trigo_circle.point_at_angle(-theta.get_value()),
color=YELLOW
)
)
neg_arc = always_redraw(
lambda: Arc(radius=1.4, angle=-(theta.get_value() % TAU), stroke_width=2,
color=YELLOW
)
)
pos_neg = always_redraw(
lambda: Tex(
"$e^{-i \\theta}$",
color=YELLOW
).move_to(0.6*neg_point.get_center())
)
self.add(pos_neg, neg_point, neg_arc)
self.play(theta.animate(run_time=5).set_value(TAU))
self.play(theta.animate(run_time=2).set_value(TAU+2.4))
self.wait()
Additional media files
Images/GIFs
Result of the first rendering
Sin2.mp4
Result of the second rendering
Sin2.mp4
System specifications
System Details
- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): Windows 10
- Python version (
python/py/python3 --version
): 3.13.0
Metadata
Metadata
Assignees
Labels
No labels