获取路径的像素坐标

时间:2015-12-23 14:19:11

标签: javascript svg

path下的典型svg元素就像

<svg width="960" height="960">
<g transform="translate(480,480)">
<path style="fill:none; stroke:#000" 
    d="M69.963,-353.136
    L66.190,-341.705
    C62.417,-330.274,54.870,-307.412,46.957,-284.620
    C39.043,-261.828,30.762,-239.107,28.338,-191.600
    C25.915,-144.093,29.348,-71.801,1.420,-46.863
    C-26.507,-21.924,-85.794,-44.340,-128.969,-48.510
    C-172.144,-52.680,-199.207,-38.604,-234.999,-29.311
    C-270.791,-20.018,-315.311,-15.509,-337.572,-13.255
    L-359.832,-10.100">
</path></g></svg>

现在我需要获得Bézier曲线中像素的坐标。我知道我可以通过Bézier曲线的定义来计算坐标。但还有其他更方便的方式(比如一些现成的例程)吗?

0 个答案:

没有答案