Create a gist now

Instantly share code, notes, and snippets.

# 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