简体   繁体   English

如何使用svg.js绘制弧

[英]How to draw arc using svg.js

Using svg.js I would like to draw path with arc: 使用svg.js我想用arc绘制路径:

M75,0 L75,118.85 A30,30 0 0 0 640,660.15 L568.5690264688633,781.8607965826662 

I have tried everything (gaps, commas,...) but not success. 我尝试过所有的东西(空白,逗号,......),但没有成功。 Still getting error: 还是得到错误:

Error: Problem parsing d="M 50 0 L 50 108.8499984741211 A 660.3822631835938 199.75233459472656 L 631.133056640625 133.80345153808594"

Thanks a lot in advance. 非常感谢提前。

There is a plugin https://github.com/otm/svg.path.js which provides a easier interface to create paths. 有一个插件https://github.com/otm/svg.path.js ,它提供了一个更简单的界面来创建路径。 With the plugin you can for instance write write: 使用插件,您可以写例如:

var draw = SVG('drawing').size(800, 800);
var path draw.path().M(10, 10).L(20, 20)

Here are some examples for the plugin: http://otm.github.io/svg.path.js/ 以下是该插件的一些示例: http//otm.github.io/svg.path.js/

There is also a new feature in svg.js called path array: svg.js中还有一个名为path array的新功能:

https://github.com/wout/svg.js#svgpatharray https://github.com/wout/svg.js#svgpatharray

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM