mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 08:54:38 +08:00
Finished general L'Hoptital example of eoc7
This commit is contained in:
@ -75,7 +75,10 @@ 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:
|
||||||
min_lag_factor = min(len(mobject.family_members_with_points())/2.0, 2)
|
if len(mobject.family_members_with_points()) < 2:
|
||||||
|
min_lag_factor = 1
|
||||||
|
else:
|
||||||
|
min_lag_factor = 2
|
||||||
self.lag_factor = max(self.run_time - 1, min_lag_factor)
|
self.lag_factor = max(self.run_time - 1, min_lag_factor)
|
||||||
ShowCreation.__init__(self, mobject, **kwargs)
|
ShowCreation.__init__(self, mobject, **kwargs)
|
||||||
|
|
||||||
|
@ -137,7 +137,8 @@ class ApplyMethod(Transform):
|
|||||||
)
|
)
|
||||||
assert(isinstance(method.im_self, Mobject))
|
assert(isinstance(method.im_self, Mobject))
|
||||||
method_kwargs = kwargs.get("method_kwargs", {})
|
method_kwargs = kwargs.get("method_kwargs", {})
|
||||||
target = copy.deepcopy(method)(*args, **method_kwargs)
|
target = method.im_self.copy()
|
||||||
|
method.im_func(target, *args, **method_kwargs)
|
||||||
Transform.__init__(self, method.im_self, target, **kwargs)
|
Transform.__init__(self, method.im_self, target, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
891
eoc/chapter7.py
891
eoc/chapter7.py
File diff suppressed because it is too large
Load Diff
@ -102,6 +102,7 @@ class TexMobject(SVGMobject):
|
|||||||
self.expression_parts = list(self.args)
|
self.expression_parts = list(self.args)
|
||||||
for expr in self.args:
|
for expr in self.args:
|
||||||
sub_tex_mob = TexMobject(expr, **self.CONFIG)
|
sub_tex_mob = TexMobject(expr, **self.CONFIG)
|
||||||
|
sub_tex_mob.tex_string = expr ##Want it unmodified
|
||||||
new_index = curr_index + len(sub_tex_mob.submobjects)
|
new_index = curr_index + len(sub_tex_mob.submobjects)
|
||||||
sub_tex_mob.submobjects = self.submobjects[curr_index:new_index]
|
sub_tex_mob.submobjects = self.submobjects[curr_index:new_index]
|
||||||
new_submobjects.append(sub_tex_mob)
|
new_submobjects.append(sub_tex_mob)
|
||||||
|
@ -129,7 +129,7 @@ class ZoomedScene(Scene):
|
|||||||
)
|
)
|
||||||
if self.zoom_activated and self.little_rectangle in moving_mobjects:
|
if self.zoom_activated and self.little_rectangle in moving_mobjects:
|
||||||
# When the camera is moving, so is everything,
|
# When the camera is moving, so is everything,
|
||||||
return list(moving_mobjects) + list(static_mobjects), []
|
return self.get_mobjects(), []
|
||||||
else:
|
else:
|
||||||
return moving_mobjects, static_mobjects
|
return moving_mobjects, static_mobjects
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user