Pre-matrix rewrite of chapter 11

This commit is contained in:
Grant Sanderson
2016-09-23 17:26:56 -07:00
parent 651c665fd7
commit 84967fd463
5 changed files with 1077 additions and 85 deletions

View File

@ -68,7 +68,7 @@ class Write(ShowCreation):
if "run_time" not in kwargs:
self.establish_run_time(mobject)
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)
def establish_run_time(self, mobject):

File diff suppressed because it is too large Load Diff

View File

@ -83,7 +83,7 @@ class Matrix(VMobject):
return np.array([
map(TexMobject, row)
for row in matrix
])
]).reshape(matrix.shape)
def organize_mob_matrix(self, matrix):
for i, row in enumerate(matrix):

View File

@ -497,6 +497,9 @@ class Mobject(object):
def __iter__(self):
return iter(self.split())
def __len__(self):
return len(self.split())
def split(self):
result = [self] if len(self.points) > 0 else []
return result + self.submobjects

View File

@ -364,7 +364,7 @@ class TeacherStudentsScene(Scene):
**bubble_kwargs):
if all(map(lambda s : isinstance(s, str), 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]
else:
raise Exception("Invalid content type")
@ -379,7 +379,7 @@ class TeacherStudentsScene(Scene):
pi_creature_target_mode = "pondering"
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 += [
FadeOut(p.bubble),
FadeOut(p.bubble.content)