我已经为此挣扎了一段时间,似乎在任何地方都找不到一个(有效的)答案。我有一个SVG文件,看起来像这样:

<svg

   xmlns:dc="http://purl.org/dc/elements/1.1/"
   ...
   width="72.9375"
   height="58.21875"
   ...>
   ...
   <g
     ...
     transform="translate(10.75,-308.96875)"
     style="...">
     <path
       inkscape:connector-curvature="0"
       d="m -10.254587,345.43597 c 0,-1.41732 0.17692,-2.85384 0.5312502,-3.5625 0.70866,-1.41733 2.14518,-2.82259 3.5625,-3.53125 1.41733,-0.70866 2.11392,-0.70867 3.53125,0 1.41732,0.70866 ... z"
       ... />
  </g>
</svg>

我想删除transform="…"行,但仍然有我的图像留在我已经放置它(在InkScape)。如果我手动删除转换,图像将压缩到屏幕的另一部分(正如预期的那样),但我需要完全删除转换,同时让图像保持在我想要的位置。是否有一种方法可以移除/平展转换到路径坐标本身?(我唯一需要处理的变换是平移和缩放,没有矩阵。)


当前回答

对于团队来说,重组可以很快完成任务。选择组,按Ctrl+Shift+G(去组),然后按Ctrl+G(组)。

对于一些有类似问题的对象,例如螺旋线和星形,快速的方法是按Ctrl+Alt+C(描边到路径)-然而,这将对象转换为纯路径,并删除所有额外的属性,如sodipodi:cx, sodipodi:revolutions等等。

其他回答

对于团队来说,重组可以很快完成任务。选择组,按Ctrl+Shift+G(去组),然后按Ctrl+G(组)。

对于一些有类似问题的对象,例如螺旋线和星形,快速的方法是按Ctrl+Alt+C(描边到路径)-然而,这将对象转换为纯路径,并删除所有额外的属性,如sodipodi:cx, sodipodi:revolutions等等。

I tried the solution posted here, namely to remove the group tags in the SVG-file and reopen it in Inkscape (0.48.3.1 in my case). Alas, after I translated the paths again using the select and transform mode (F1) and saved it, the group tags reappeared! Inkscape saves all transformations applied to the path in a surrounding group element. Unless you use the path-node selection tool (F2), hit ctrl+a and move the nodes of the path to their right place. After I had done this instead and saved afterwards Inkscape didn't add the group tags, because this translation applied directly to the path model. Hope this helps.

如何在Inkscape中删除变换

打开svg文件在Inkscape 进入编辑->全选 执行“Object ->取消分组” 进入编辑-> XML编辑器 在图层中找到“transform”属性并删除它们

如何在不创建另一个转换属性的情况下移动所有对象

点击编辑->在所有图层中选择全部 进入对象->变换

在变换面板

取消选中“相对移动”,分别选中“应用到每个对象” 根据需要设置“水平”和“垂直”值,单击“应用”

根据我的经验,如果你正在使用Inkscape,它足以稍微移动路径元素(例如用光标键),Inkscape将删除转换属性,并相应地调整路径数据。(如果你真的想保留transform属性,这很烦人。)

因此,您可以简单地选择路径(确保它是路径而不是周围的组),点击左右光标键,就完成了。

在方法绘制中加载SVG http://editor.method.ac(文件>打开图像) 取消元素组(Object > Ungroup elements),你可能需要做不止一次。 选择你的路径 重定向路径(对象>重定向路径)。 保存你的图像(文件>保存图像)如果它出现在一个新的窗口,你可以右键单击并“另存图像为…”