Created
October 17, 2015 00:52
-
-
Save psaia/5989aa03f8cdbd09829e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convert(path) { | |
var arr = []; | |
var len = path.getTotalLength(); | |
var p; | |
for (var i = 0; i < len; i++) { | |
p = path.getPointAtLength(i); | |
arr.push([parseFloat(p.x), parseFloat(p.y)]); | |
} | |
return JSON.stringify(arr); | |
} | |
convert(document.getElementByTagName('path')[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment