使用Inkscape将所有svg转换并合成成path


转换

通过inkscape将rectpolygontransform等转为path,方便合成服务进行处理,步骤如下:

  1. 全选所有元素;
  2. 连续执行5次取消分组(根据嵌套的层次,一般最多也就5层);
  3. 执行 Path > Stroke to Path;
  4. 合并所有的路径,通过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。

参考文档


文章作者: zzq0324
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 zzq0324 !