mirror of
https://github.com/3b1b/manim.git
synced 2025-07-31 22:13:30 +08:00
Pre-matrix rewrite of chapter 11
This commit is contained in:
@ -68,7 +68,7 @@ class Write(ShowCreation):
|
|||||||
if "run_time" not in kwargs:
|
if "run_time" not in kwargs:
|
||||||
self.establish_run_time(mobject)
|
self.establish_run_time(mobject)
|
||||||
if "lag_factor" not in kwargs:
|
if "lag_factor" not in kwargs:
|
||||||
self.lag_factor = max(self.run_time - 1, 1)
|
self.lag_factor = max(self.run_time - 1, 2)
|
||||||
ShowCreation.__init__(self, mobject, **kwargs)
|
ShowCreation.__init__(self, mobject, **kwargs)
|
||||||
|
|
||||||
def establish_run_time(self, mobject):
|
def establish_run_time(self, mobject):
|
||||||
|
1151
eola/chapter11.py
1151
eola/chapter11.py
File diff suppressed because it is too large
Load Diff
@ -83,7 +83,7 @@ class Matrix(VMobject):
|
|||||||
return np.array([
|
return np.array([
|
||||||
map(TexMobject, row)
|
map(TexMobject, row)
|
||||||
for row in matrix
|
for row in matrix
|
||||||
])
|
]).reshape(matrix.shape)
|
||||||
|
|
||||||
def organize_mob_matrix(self, matrix):
|
def organize_mob_matrix(self, matrix):
|
||||||
for i, row in enumerate(matrix):
|
for i, row in enumerate(matrix):
|
||||||
|
@ -497,6 +497,9 @@ class Mobject(object):
|
|||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return iter(self.split())
|
return iter(self.split())
|
||||||
|
|
||||||
|
def __len__(self):
|
||||||
|
return len(self.split())
|
||||||
|
|
||||||
def split(self):
|
def split(self):
|
||||||
result = [self] if len(self.points) > 0 else []
|
result = [self] if len(self.points) > 0 else []
|
||||||
return result + self.submobjects
|
return result + self.submobjects
|
||||||
|
@ -364,7 +364,7 @@ class TeacherStudentsScene(Scene):
|
|||||||
**bubble_kwargs):
|
**bubble_kwargs):
|
||||||
if all(map(lambda s : isinstance(s, str), content)):
|
if all(map(lambda s : isinstance(s, str), content)):
|
||||||
content = TextMobject(*content)
|
content = TextMobject(*content)
|
||||||
elif len(content) == 1 and isinstance(content[0], TexMobject):
|
elif len(content) == 1 and isinstance(content[0], Mobject):
|
||||||
content = content[0]
|
content = content[0]
|
||||||
else:
|
else:
|
||||||
raise Exception("Invalid content type")
|
raise Exception("Invalid content type")
|
||||||
@ -379,7 +379,7 @@ class TeacherStudentsScene(Scene):
|
|||||||
pi_creature_target_mode = "pondering"
|
pi_creature_target_mode = "pondering"
|
||||||
|
|
||||||
for p in self.get_everyone():
|
for p in self.get_everyone():
|
||||||
if p.bubble and p is not pi_creature:
|
if (p.bubble is not None) and (p is not pi_creature):
|
||||||
added_anims += [
|
added_anims += [
|
||||||
FadeOut(p.bubble),
|
FadeOut(p.bubble),
|
||||||
FadeOut(p.bubble.content)
|
FadeOut(p.bubble.content)
|
||||||
|
Reference in New Issue
Block a user