转换后获取SVG d [英] Getting SVG d after transform
问题描述
我有一个要创建为菱形的方形SVG,将其旋转45度可以达到我想要的效果,但是我仅限于将SVG的d
值用于图像.如何从 https://jsfiddle.net/x2v3tmdp/
I Have a square SVG that I want to create into a diamond, rotating it 45 degrees gives me the effect I want but I am limited to only using the d
value of an SVG for my image. How can I get the newly transform d
value from https://jsfiddle.net/x2v3tmdp/
换句话说,这是我的d:M13,14H2c-0.5523,0-1-0.4477-1-1V2c0-0.5523,0.4477-1,1-1h11c0.5523,0,1,0.4477,1,1v11C14,13.5523,13.5523,14,13,14z
现在我需要旋转45度并获取新的d值.
In other words here is my d: M13,14H2c-0.5523,0-1-0.4477-1-1V2c0-0.5523,0.4477-1,1-1h11c0.5523,0,1,0.4477,1,1v11C14,13.5523,13.5523,14,13,14z
now I need to rotate that 45 degrees and get the new d value.
推荐答案
如果要处理SVG文件以删除所有转换并将其烘焙到路径数据中,请
If you want to process an SVG file to remove all the transforms and bake them into the path data, you can use svgo for that.
如果您想自己编写代码,请 Timo关于此问题的分析器应该可以满足您的需求.
If you want to do it in code yourself, Timo's anser on this question should do what you need.
这篇关于转换后获取SVG d的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!