public
Last active

  • Download Gist
gistfile1.coffee
CoffeeScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# 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)`

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.