您好我试图在JavaScript Canvas中绘制SVG。我尝试过不同的SVG,例如Vector Magic和Inkscape。它们具有正常的路径格式:
<path fill="#507834" opacity="1.00" d=" M 0.00 0.00 L 48.98 0.00 C 37.54 10.24 26.32 20.81 13.99 29.99 C 9.47 33.36 4.53 36.10 0.00 39.45 L 0.00 0.00 Z" />
很容易理解哪个坐标属于哪个字母。
现在我尝试使用AI生成的SVG文件,路径表示为:
<path d="M563,420v97.5a76,76,0,0,1-7.9,2.09c-2.31.37-3.12,1-2.89,3.6.11,1.22-1.43,3.26-2.71,3.8-4.46,1.88-9.22,3-13.67,4.92-2.73,1.16-5.11,3.16-7.64,4.79a19.06,19.06,0,0,1-2.73,1.78c-6.39,2.65-13.05,1.17-19.45.48-4.52-.48-7.24,1-10.16,3.84-1.74,1.7-1.94,3-.56,4.77,3.67,4.7,7.19,9.53,11.09,14,2.11,2.43,2.09,4.42.58,7-1.95,3.42-4.39,6.89-5.09,10.62a22.07,22.07,0,0,1-4,9c-1.36,1.93-3.1,3.78-3.83,5.94-2.48,7.31-7.95,11.18-14.7,13.84-1,.39-2.33,1-2.69,1.8-1.81,4.21-3.85,8.43-4.76,12.87-.5,2.45.24,6.07,1.87,7.82,2.23,2.39,5.77,4.62,9.45,2.5,4.27-2.46,8.72-2.58,13.39-2.35s5.4,1.43,4.92,6.07c-.29,2.81-1.85,6.16,1.67,8.41.34.21-.11,1.55-.09,2.37a8.62,8.62,0,0,0,.27,3.11c1.56,3.55,1.15,6.23-1.84,8.52-1.87,1.43-3.84,3.15-6,3.66-3.76.89-5.94,3.29-8.55,5.85-6.54,6.41-14.51,11.27-20.12,18.76-3.18,4.24-7.15,7.9-10.16,12.23-2.54,3.67-4.34,7.69-9.93,5.38-.4-.17-1,0-1.47.12-7.54,1.19-12.05-1-15.71-7.48a6.26,6.26,0,0,0-2.45-2.74c-6.56-2.87-6.38-8.29-5.43-14q1.56-9.35,3.42-18.65c1.63-8.17,3.29-16.34,5.17-24.46.6-2.62,2.61-5,2.85-7.59.59-6.3,4.36-10.72,8-15.21,2.83-3.44,6-6.56,9-9.92a5.9,5.9,0,0,0,1-2.7c.49-2.63.92-5.27,1.31-7.92.69-4.74,1.23-9.5,2.06-14.21a8.85,8.85,0,0,1,2-4c3.2-3.77,6.4-7.42,4.52-13-1.51-4.44-3-8.88-4.24-13.4-.45-1.65.41-3.72-.21-5.24-1.7-4.18-.25-8,1.87-11,5.51-7.94,5.6-17.28,6.77-26.09.74-5.56,2.19-10.84,3.37-16.22,1.15-5.21,4-10.27,4.09-15.43a43.22,43.22,0,0,1,2-11.95c.75-2.48,2.21-4.74,3.15-7.18,1.84-4.74,5.61-6.82,10.29-7.53,3.07-.47,6.19-.62,9.29-.85,4.68-.34,10-5.19,10.89-9.81.36-1.95,1.12-3.85,1.31-5.81.27-2.65.14-5.34.22-8,.1-2.9.05-5.83.42-8.7.56-4.29,2.06-8.55,2-12.8-.09-3.73,1.45-6.35,4.05-7.78a9.67,9.67,0,0,1,7.4-.3,89,89,0,0,1,16.19,8.24c6,4.07,11.36,9.16,17.16,13.6C558.67,418.45,561,419.06,563,420Zm-81.27,72.3c-1.19,3.26-2.2,6.32-3.44,9.29a6.65,6.65,0,0,0,1.95,8.1,83.73,83.73,0,0,0,9.75,6.87c1,.62,2.4.57,3.62.83a15.93,15.93,0,0,0,.49-3.77c-.46-4.55,1-8.16,4-9.61,4.59-2.15,7.56-5.57,8-10.72a30.84,30.84,0,0,0-.23-7c-1.35-9.38-4-18.22-11.22-25-2.61-2.43-7.19-2.88-9,0-2,3.26-3.88,7.08-4.33,10.83C480.64,478.82,478,485.63,481.73,492.3Z" transform="translate(-50.69 -12.7)" style="fill: #5b8541"/>
没有单一的自由空间。 我可以看到它意味着
M563,420
v97.5
a76,76,0,0,1-7.9,2.09
c-2.31.37-3.12,1-2.89,3.6.11,1.22-1.43,3.26-2.71,3.8-4.46,1.88-9.22,3-13.67,4.92-2.73,1.16-5.11,3.16-7.64,4.79
但我不明白&#34; - &#34;例如1-7.9或c-2.31.37
点的作用有人可以解释一下吗?
答案 0 :(得分:1)
减号表示负数的开头。
1-7.9是数字1,后跟数字-7.9
c-2.31.37与c -2.31 .37相同