Skip to content

Commit

Permalink
Small tweaks to old videos when revisiting their animations
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Jan 6, 2020
1 parent 6fe082a commit 16f8c02
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions from_3b1b/old/clacks/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ def add_counter(self):
counter_mob = Integer(self.n_clacks)
counter_mob.next_to(
counter_label[-1], RIGHT,
aligned_edge=DOWN,
)
counter_mob.align_to(counter_label[-1][-1], DOWN)
counter_group = VGroup(
counter_label,
counter_mob,
Expand Down Expand Up @@ -747,7 +747,7 @@ class BlocksAndWallExampleMass1e2(BlocksAndWallExample):
"velocity": -0.6,
}
},
"wait_time": 25,
"wait_time": 35,
}


Expand Down
19 changes: 17 additions & 2 deletions from_3b1b/old/clacks/solution1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,13 +1204,18 @@ class CircleDiagramFromSlidingBlocks(Scene):
"fill_color": GREEN,
"fill_opacity": 0.3,
},
"show_dot": True,
"show_vector": False,
}

def construct(self):
sliding_blocks_scene = self.BlocksAndWallSceneClass(
show_flash_animations=False,
write_to_movie=False,
wait_time=0,
file_writer_config={
"output_directory": ".",
}
)
blocks = sliding_blocks_scene.blocks
times = [pair[1] for pair in blocks.clack_data]
Expand All @@ -1229,7 +1234,17 @@ def show_circle_lines(self, times, slope):
dot = Dot(color=RED, radius=0.06)
dot.move_to(lines[0].get_start())

self.add(end_zone, axes, circle, dot)
vector = Vector(lines[0].get_start())
vector.set_color(RED)
vector.add_updater(lambda v: v.put_start_and_end_on(
ORIGIN, dot.get_center()
))
vector.set_stroke(BLACK, 2, background=True)

dot.set_opacity(int(self.show_dot))
vector.set_opacity(int(self.show_vector))

self.add(end_zone, axes, circle, dot, vector)

last_time = 0
for time, line in zip(times, lines):
Expand All @@ -1238,7 +1253,7 @@ def show_circle_lines(self, times, slope):
self.wait(time - last_time)
last_time = time
dot.move_to(line.get_end())
self.add(line, dot)
self.add(line, dot, vector)
self.wait()

def get_circle(self):
Expand Down
2 changes: 1 addition & 1 deletion from_3b1b/old/spirals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4926,6 +4926,6 @@ def add_dots(self):
label.to_corner(DL, MED_LARGE_BUFF)

self.add(dots)
self.add(label)
# self.add(label)

self.dots = dots

0 comments on commit 16f8c02

Please sign in to comment.