I am trying to convert a disconnected path in SVG into SVG lines . e.g If I have drawn a triangle using
<path id="path" d="M150 0 L75 200 L225 200 Z" />
then after conversion , i should get 3 SVG lines
<line x1=150 y1=0 x2=75 y2=200/>
<line x1=75 y1=200 x2=225 y2=200 />
<line x1=225 y1=200 x2=150 y2=0 />
And this path can be disconnected that it can have multiple Moveto commands like
<path id="path" d="M150 0 L75 200 L225 200 M450 200 L375 400 L525 400 Z" />
In this case I should get 6 SVG lines. Also moveto and lineto commands may be absolute and relative Any help ? Thanks