【问题标题】:SVG : Ungroup objects / remove transform from command lineSVG:取消组合对象/从命令行删除变换
【发布时间】:2020-04-02 10:19:37
【问题描述】:

这是一个带有一些路径的 SVG 文件:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0"
    ... viewBox="0 0 1920.000000 1080.000000">
    <g transform="translate(0.000000,1080.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
        <path d="M16320 10788 c0 -5 132 -7 293 -6 293 2 259 6 -101 10 -105 2 -192 0
-192 -4z"/>
 <!-- Many other paths -->

我想提取 1080x1920 参考帧内的路径数据。在提取路径数据之前必须考虑平移和缩放。
在提取所有路径之前,我目前在 Inkscape 中使用 Ungroup 选项。
如何自动完成(通过命令行或程序)?

【问题讨论】:

  • 使用 'deep ungroup' 扩展来取消组合所有内容。它必须列在 --verb-list 中的某处。如果你知道你永远不会有超过 5 个嵌套组,你也可以重复几次 Ungroup 动词,与 Select all 交替使用。
  • 可以从命令行完成吗?
  • 是的。扩展可以通过 Inkscape 命令行启动(不是没有 GUI),或者它们可以自己运行,直接从命令行运行,而不需要 Inkscape。尝试 'python /path/to/ungroup-deep.py /path/to/yourdrawing.svg > /path/to/target_file.svg' (在 Linux shell 上,在 Windows 上这可能看起来有点不同。)
  • 不幸的是:TypeError: can only concatenate str (not "NoneType") to str任何提示?

标签: svg inkscape svg-transforms


【解决方案1】:

您可以从命令行运行 Inkscape 操作

inkscape --actions "select-all:groups; SelectionUnGroup; export-filename: output.svg; export-plain-svg; export-do;" intput.svg

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-05
    • 2017-04-15
    • 2014-06-15
    • 2013-09-04
    • 1970-01-01
    • 2010-11-06
    • 2019-02-16
    • 2022-01-01
    相关资源
    最近更新 更多