Simplepath

simplepath.png

関数

lexPath(d) returns and iterator that breaks path data identifies command and parameter tokens
parsePath(d) パスの頂点座標を2次元配列で返してくれます
formatPath(a) 頂点配列データをSVGの形に変換してくれます
translatePath(p,x,y)
scalePath(p,x,y)
rotatePath(p,a,cx = 0,cy = 0)

変数

dictionary pathdefs
dictionary simplepath.pathdefs
初期値はこうなってます

     = {
         'M':['L', 2, [float, float], ['x','y']], 
         'L':['L', 2, [float, float], ['x','y']], 
         'H':['H', 1, [float], ['x']], 
         'V':['V', 1, [float], ['y']], 
         'C':['C', 6, [float, float, float, float, float, float], ['x','y','x','y','x','y']], 
         'S':['S', 4, [float, float, float, float], ['x','y','x','y']], 
         'Q':['Q', 4, [float, float, float, float], ['x','y','x','y']], 
         'T':['T', 2, [float, float], ['x','y']], 
        'A':['A', 7, [float, float, float, int, int, float, float], ['r','r','a',0,'s','x','y']], 
        'Z':['L', 0, [], []]
       }

parsePath

こんなかんじで返ってきます

[['M', [40.406101999999997, 151.30610999999999]], ['L', [96.974644999999995, 243.22998999999999]], ['L', [177.78684999999999, 147.2655]], ['L', [117.1777, 105.84923999999999]]]

inkscape-get-path

サポートサイト Wikidot.com inkscape-get-path