mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 13:34:19 +08:00
Merge branch 'master' into lighthouse2
# Conflicts: # .gitignore -> resolved
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@ -7,9 +7,7 @@ special_animations.py
|
|||||||
prettiness_hall_of_fame.py
|
prettiness_hall_of_fame.py
|
||||||
files/
|
files/
|
||||||
ben_playground.py
|
ben_playground.py
|
||||||
|
|
||||||
ben_cairo_test.py
|
ben_cairo_test.py
|
||||||
|
|
||||||
.idea/manim.iml
|
|
||||||
|
|
||||||
*.xml
|
*.xml
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
@ -22,8 +22,9 @@ class Transform(Animation):
|
|||||||
#Copy target_mobject so as to not mess with caller
|
#Copy target_mobject so as to not mess with caller
|
||||||
self.original_target_mobject = target_mobject
|
self.original_target_mobject = target_mobject
|
||||||
target_mobject = target_mobject.copy()
|
target_mobject = target_mobject.copy()
|
||||||
digest_config(self, kwargs, locals())
|
|
||||||
mobject.align_data(target_mobject)
|
mobject.align_data(target_mobject)
|
||||||
|
self.target_mobject = target_mobject
|
||||||
|
digest_config(self, kwargs)
|
||||||
self.init_path_func()
|
self.init_path_func()
|
||||||
|
|
||||||
Animation.__init__(self, mobject, **kwargs)
|
Animation.__init__(self, mobject, **kwargs)
|
||||||
@ -40,7 +41,7 @@ class Transform(Animation):
|
|||||||
def init_path_func(self):
|
def init_path_func(self):
|
||||||
if self.path_func is not None:
|
if self.path_func is not None:
|
||||||
return
|
return
|
||||||
if self.path_arc == 0:
|
elif self.path_arc == 0:
|
||||||
self.path_func = straight_path
|
self.path_func = straight_path
|
||||||
else:
|
else:
|
||||||
self.path_func = path_along_arc(
|
self.path_func = path_along_arc(
|
||||||
|
@ -670,3 +670,10 @@ class DictAsObject(object):
|
|||||||
# Just to have a less heavyweight name for this extremely common operation
|
# Just to have a less heavyweight name for this extremely common operation
|
||||||
def fdiv(a, b):
|
def fdiv(a, b):
|
||||||
return np.true_divide(a,b)
|
return np.true_divide(a,b)
|
||||||
|
|
||||||
|
# For debugging purposes
|
||||||
|
|
||||||
|
def print_mobject_family(mob, n_tabs = 0):
|
||||||
|
print "\t"*n_tabs, mob, id(mob)
|
||||||
|
for submob in mob.submobjects:
|
||||||
|
print_mobject_family(submob, n_tabs + 1)
|
||||||
|
@ -771,10 +771,10 @@ class Mobject(Container):
|
|||||||
self.null_point_align(mobject)
|
self.null_point_align(mobject)
|
||||||
self_count = len(self.submobjects)
|
self_count = len(self.submobjects)
|
||||||
mob_count = len(mobject.submobjects)
|
mob_count = len(mobject.submobjects)
|
||||||
diff = abs(self_count-mob_count)
|
diff = self_count-mob_count
|
||||||
if self_count < mob_count:
|
if diff < 0:
|
||||||
self.add_n_more_submobjects(diff)
|
self.add_n_more_submobjects(-diff)
|
||||||
elif mob_count < self_count:
|
elif diff > 0:
|
||||||
mobject.add_n_more_submobjects(diff)
|
mobject.add_n_more_submobjects(diff)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@ -42,7 +42,8 @@ class VMobject(Mobject):
|
|||||||
stroke_width = None,
|
stroke_width = None,
|
||||||
fill_color = None,
|
fill_color = None,
|
||||||
fill_opacity = None,
|
fill_opacity = None,
|
||||||
family = True):
|
family = True
|
||||||
|
):
|
||||||
if stroke_color is not None:
|
if stroke_color is not None:
|
||||||
self.stroke_rgb = color_to_rgb(stroke_color)
|
self.stroke_rgb = color_to_rgb(stroke_color)
|
||||||
if fill_color is not None:
|
if fill_color is not None:
|
||||||
|
@ -356,7 +356,7 @@ class Line(VMobject):
|
|||||||
def insert_n_anchor_points(self, n):
|
def insert_n_anchor_points(self, n):
|
||||||
if not self.path_arc:
|
if not self.path_arc:
|
||||||
n_anchors = self.get_num_anchor_points()
|
n_anchors = self.get_num_anchor_points()
|
||||||
new_num_points = 3*(n_anchors + n)+1
|
new_num_points = 3*(n_anchors + n)-2
|
||||||
self.points = np.array([
|
self.points = np.array([
|
||||||
self.point_from_proportion(alpha)
|
self.point_from_proportion(alpha)
|
||||||
for alpha in np.linspace(0, 1, new_num_points)
|
for alpha in np.linspace(0, 1, new_num_points)
|
||||||
|
Reference in New Issue
Block a user