Created
April 10, 2015 09:46
-
-
Save Samsy/0b10441172256589c34a to your computer and use it in GitHub Desktop.
svg to poly
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
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" | |
xmlns:xlink="http://www.w3.org/1999/xlink"> | |
<path id="svg" fill="#5DD7FC" d="M0.5,262.094c0,0,52.172,79.049,158.323,77.241c68.433-2.031,165.549-32.296,191.523-132.123 | |
c0,0,27.893,4.742,47.654-16.939c-26.99,3.727-44.944-4.743-44.944-4.743s35.346-1.017,43.137-21.908 | |
c-20.89,9.035-46.751,1.355-46.751,1.355S337.245,90.22,262.939,87.51c0,0,39.713-8.093,33.502-17.24 | |
c-4.968-6.663-32.597,5.722-32.597,5.722s15.396-6.776,15.057-14.003c-15.584,1.806-29.888,13.325-29.888,13.325 | |
s4.365-7.001,4.44-9.937c-37.114,20.628-62.334,97.455-62.334,97.455s-9.411-10.427-25.07-21.72 | |
C128.257,118.829,58.544,92.479,58.544,92.479s-4.668,28.759,32.522,49.838c-15.207,1.205-22.886,3.162-22.886,3.162 | |
s0,30.565,44.342,40.503c-20.552,0.752-27.328,10.991-27.328,10.991s11.594,27.253,48.031,24.995 | |
c-29.662,15.357-10.389,36.286,13.852,34.027C69.083,325.859,0.5,262.094,0.5,262.094z"/> | |
<script type="text/javascript"> | |
<![CDATA[ | |
path = document.querySelector("#svg") | |
var len = path.getTotalLength(); | |
var p=path.getPointAtLength(0); | |
var poly = [] | |
poly.push(p.x) | |
poly.push(p.y) | |
var i = 1; | |
for(var i=1; i<len; i++){ | |
p=path.getPointAtLength(i); | |
poly.push(p.x) | |
poly.push(p.y) | |
} | |
console.log(poly); | |
]]> | |
</script> | |
</svg> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment