Last active
December 11, 2015 15:09
-
-
Save Szeliga/4619286 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 path string | |
path_string = "M,208,405C,208,405,206,744,206,744C,206,744,552,715,552,715C,552,715,590,451,590,451C,590,451,208,405,208,405" | |
# points will contain an array of arrays for each point of the path | |
points = Raphael.parsePathString(pe.attrs.path_string) | |
spline = new THREE.Shape() | |
spline.autoClose = true | |
_.each points, (p, i) -> | |
switch p[0] | |
when "M" then spline.moveTo(p[1], p[2]) | |
when "C" then spline.bezierCurveTo(p[1], p[2], p[3], p[4], p[5], p[6]) | |
geo = new t.ShapeGeometry(spline) | |
mesh = new t.Mesh(geo, mat)` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment