转换
通过inkscape将rect
、polygon
、transform
等转为path,方便合成服务进行处理,步骤如下:
- 全选所有元素;
- 连续执行5次取消分组(根据嵌套的层次,一般最多也就5层);
- 执行 Path > Stroke to Path;
- 合并所有的路径,通过Path > Combine实现。
命令如下:
inkscape --actions "select-all:groups;selection-ungroup;selection-ungroup;selection-ungroup;selection-ungroup;selection-ungroup;object-stroke-to-path;path-combine;export-filename:result.svg;export-do;" source.svg
export-filename后面带的参数是要导出的svg。
inkscape --action-list > actions.txt
可以看所有支持的action。