本文整理汇总了Python中mobject.vectorized_mobject.VMobject.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python VMobject.__init__方法的具体用法?Python VMobject.__init__怎么用?Python VMobject.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mobject.vectorized_mobject.VMobject
的用法示例。
在下文中一共展示了VMobject.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import __init__ [as 别名]
def __init__(self, **kwargs):
hand = SVGMobject("RightHandOutline")
self.inlines = VMobject(*hand.split()[:-4])
self.outline = VMobject(*hand.split()[-4:])
self.outline.set_stroke(color = WHITE, width = 5)
self.inlines.set_stroke(color = DARK_GREY, width = 3)
VMobject.__init__(self, self.outline, self.inlines)
self.center().scale_to_fit_height(3)
示例2: __init__
# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import __init__ [as 别名]
def __init__(self, float_num, **kwargs):
digest_config(self, kwargs)
num_string = '%.*f' % (self.num_decimal_points, float_num)
VMobject.__init__(self, *[
TexMobject(char)
for char in num_string
], **kwargs)
self.arrange_submobjects(
buff = self.digit_to_digit_buff,
aligned_edge = DOWN
)
if float_num < 0:
minus = self.submobjects[0]
minus.next_to(
self.submobjects[1], LEFT,
buff = self.digit_to_digit_buff
)
示例3: __init__
# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import __init__ [as 别名]
def __init__(self, matrix, **kwargs):
"""
Matrix can either either include numbres, tex_strings,
or mobjects
"""
VMobject.__init__(self, **kwargs)
matrix = np.array(matrix)
if matrix.ndim == 1:
matrix = matrix.reshape((matrix.size, 1))
if not isinstance(matrix[0][0], Mobject):
matrix = matrix.astype("string")
matrix = self.string_matrix_to_mob_matrix(matrix)
self.organize_mob_matrix(matrix)
self.add(*matrix.flatten())
self.add_brackets()
self.center()
self.mob_matrix = matrix
示例4: __init__
# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import __init__ [as 别名]
def __init__(self, **kwargs):
digest_config(self, kwargs)
if self.leftmost_tick is None:
self.leftmost_tick = np.ceil(self.x_min)
VMobject.__init__(self, **kwargs)
示例5: __init__
# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import __init__ [as 别名]
def __init__(self, function, **kwargs):
self.function = function
VMobject.__init__(self, **kwargs)
示例6: __init__
# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import __init__ [as 别名]
def __init__(self, start, end, **kwargs):
digest_config(self, kwargs)
self.set_start_and_end(start, end)
VMobject.__init__(self, **kwargs)
示例7: __init__
# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import __init__ [as 别名]
def __init__(self, **kwargs):
VMobject.__init__(self, **kwargs)
for submobject in self.submobject_family():
submobject.part_of_3d_mobject = True
示例8: __init__
# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import __init__ [as 别名]
def __init__(self, mobject, **kwargs):
VMobject.__init__(self, **kwargs)
self.mobject = mobject
self.submobjects = self.get_eyes().submobjects