Update mobject.py

This commit is contained in:
BillyLikesHacking
2021-10-22 20:00:27 +08:00
committed by GitHub
parent 0fd8fdc3ca
commit 6d0c55d2ba

View File

@ -82,6 +82,15 @@ class Mobject(object):
def __str__(self): def __str__(self):
return self.__class__.__name__ return self.__class__.__name__
def __add__(self, other : 'Mobject'):
assert(isinstance(other, Mobject))
return Group(self, other)
def __mul__(self, other : 'int'):
if isinstance(self, VMobject):
return VGroup(*[mob.copy() for mob in range(other)])
return Group(*[mob.copy() for mob in range(other)])
def init_data(self): def init_data(self):
self.data = { self.data = {
"points": np.zeros((0, 3)), "points": np.zeros((0, 3)),