从SVG路径创建VMobject¶
限定名称: manim.mobject.svg.svg\_mobject.VMobjectFromSVGPath
- class VMobjectFromSVGPath(path_obj, long_lines=False, should_subdivide_sharp_curves=False, should_remove_null_curves=False, **kwargs)[来源]¶
基础类:
VMobject表示SVG路径的向量化对象。
注意
long_lines、should_subdivide_sharp_curves和should_remove_null_curves关键字参数仅在 OpenGL 渲染器中有效。- Parameters:
path_obj (se.Path) – 一个解析后的SVG路径对象。
long_lines (bool) – 向量化对象中的直线是否以一个或两个线段绘制。
should_subdivide_sharp_curves (bool) – 是否在两条线段以比给定阈值更尖锐的角度相交时进一步细分子曲线。
should_remove_null_curves (bool) – 是否移除长度为0的子曲线。
kwargs – 其他关键字参数传递给父类。
方法
初始化
points并因此确定形状。handle_commandsinit_points属性
animate用于动画化
self的任何方法的应用。animation_overridescolordepthmobject的深度。
fill_color如果有多种颜色(用于渐变),则返回第一个颜色
heightmobject的高度。
n_points_per_curvesheen_factorstroke_colorwidthmobject的宽度。
- _original__init__(path_obj, long_lines=False, should_subdivide_sharp_curves=False, should_remove_null_curves=False, **kwargs)¶
初始化自身。有关准确的签名,请参阅 help(type(self))。
- Parameters:
path_obj (Path)
long_lines (bool)
should_subdivide_sharp_curves (bool)
should_remove_null_curves (bool)
- generate_points()¶
初始化
points并因此确定形状。在创建时调用。这是一个可以由子类实现的空方法。
- Return type:
无