svg_item¶
- class janim.items.svg.svg_item.SVGItem(file_path: str, *, scale: float = 1.0, width: float | None = None, height: float | None = None, mark_basepoint: bool = False, stroke_radius: float | Iterable[float] | None = None, **kwargs)¶
基类:
Group[SVGElemItem]传入 SVG 文件路径,解析为物件
- vitem_builders_map: dict[tuple, tuple[list[ItemBuilder], GroupIndexer]] = {}¶
- group_key: str | None = None¶
- move_into_position() None¶
- copy(*, root_only=False) Self¶
复制物件
- scale_descendants_stroke_radius(factor: float) Self¶
将所有后代物件的 stroke_radius 都乘上一个值
- classmethod get_items_from_file(file_path: str, mark_basepoint: bool = False) tuple[list[SVGElemItem], dict[str, list[SVGElemItem]]]¶
解析文件并得到物件列表
- static build_items(builders: list[ItemBuilder], indexers: GroupIndexer) tuple[list[SVGElemItem], dict[str, list[SVGElemItem]]]¶
- static get_styles_from_shape(shape: Shape) dict¶
- static get_rot_and_shift_from_matrix(mat: Matrix) tuple[ndarray, ndarray]¶
- static convert_path(path: Path, offset: ndarray, mark_basepoint: bool = False) ItemBuilder¶
- static convert_line(line: SimpleLine, offset: ndarray) ItemBuilder¶
- static convert_rect(rect: Rect, offset: ndarray) ItemBuilder¶
- static convert_ellipse(ellipse: Circle | Ellipse, offset: ndarray) ItemBuilder¶
- static convert_polygon(polygon: Polygon, offset: ndarray) ItemBuilder¶
- static convert_polyline(polyline: Polyline, offset: ndarray) ItemBuilder¶
- static convert_text(text: Text, offset: ndarray) ItemBuilder¶
- static convert_image(image: Image, offset: ndarray) ItemBuilder¶