本文整理汇总了Python中mobject.Mobject.point_thickness方法的典型用法代码示例。如果您正苦于以下问题:Python Mobject.point_thickness方法的具体用法?Python Mobject.point_thickness怎么用?Python Mobject.point_thickness使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mobject.Mobject
的用法示例。
在下文中一共展示了Mobject.point_thickness方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: construct
# 需要导入模块: from mobject import Mobject [as 别名]
# 或者: from mobject.Mobject import point_thickness [as 别名]
def construct(self):
val = 0.7
text = TexMobject([
"\\text{HC}(", "x", ")",
"=\\lim_{n \\to \\infty}\\text{PHC}_n(", "x", ")"
])
text.to_edge(UP)
x1 = text.split()[1]
x2 = text.split()[-2]
x2.highlight(BLUE)
explanation = TextMobject("Actual Hilbert curve function")
exp_arrow = Arrow(explanation, text.split()[0])
curve = UnitInterval()
dot = Dot(curve.number_to_point(val))
x_arrow = Arrow(x1.get_bottom(), dot, buff = 0)
curve.sort_points(lambda p : p[0])
curve.add_numbers(0, 1)
self.add(*text.split()[:3])
self.play(
ShimmerIn(explanation),
ShowCreation(exp_arrow)
)
self.dither()
self.remove(explanation, exp_arrow)
self.play(ShowCreation(curve))
self.play(
ApplyMethod(x1.highlight, BLUE),
ShowCreation(x_arrow),
ShowCreation(dot)
)
self.dither()
self.remove(x_arrow)
limit = Mobject(*text.split()[3:]).ingest_sub_mobjects()
limit.point_thickness = 1
self.play(ShimmerIn(limit))
for num in range(1, 9):
new_curve = HilbertCurve(order = num)
new_curve.scale(0.8)
new_dot = Dot(new_curve.points[int(val*new_curve.get_num_points())])
self.play(
Transform(curve, new_curve),
Transform(dot, new_dot),
)