mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 08:54:38 +08:00
Merge branch 'master' of github.com:3b1b/manim into video-work
This commit is contained in:
@ -82,6 +82,14 @@ class Mobject(object):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.__class__.__name__
|
return self.__class__.__name__
|
||||||
|
|
||||||
|
def __add__(self, other : 'Mobject') -> 'Mobject':
|
||||||
|
assert(isinstance(other, Mobject))
|
||||||
|
return self.get_group_class()(self, other)
|
||||||
|
|
||||||
|
def __mul__(self, other : 'int') -> 'Mobject':
|
||||||
|
assert(isinstance(other, int))
|
||||||
|
return self.replicate(other)
|
||||||
|
|
||||||
def init_data(self):
|
def init_data(self):
|
||||||
self.data = {
|
self.data = {
|
||||||
"points": np.zeros((0, 3)),
|
"points": np.zeros((0, 3)),
|
||||||
@ -1610,6 +1618,10 @@ class Group(Mobject):
|
|||||||
Mobject.__init__(self, **kwargs)
|
Mobject.__init__(self, **kwargs)
|
||||||
self.add(*mobjects)
|
self.add(*mobjects)
|
||||||
|
|
||||||
|
def __add__(self, other : 'Mobject' or 'Group'):
|
||||||
|
assert(isinstance(other, Mobject))
|
||||||
|
return self.add(other)
|
||||||
|
|
||||||
|
|
||||||
class Point(Mobject):
|
class Point(Mobject):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
|
@ -1000,6 +1000,10 @@ class VGroup(VMobject):
|
|||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
self.add(*vmobjects)
|
self.add(*vmobjects)
|
||||||
|
|
||||||
|
def __add__(self:'VGroup', other : 'VMobject' or 'VGroup'):
|
||||||
|
assert(isinstance(other, VMobject))
|
||||||
|
return self.add(other)
|
||||||
|
|
||||||
|
|
||||||
class VectorizedPoint(Point, VMobject):
|
class VectorizedPoint(Point, VMobject):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
|
Reference in New Issue
Block a user