module.exports = { setup: function(api) { api.setSize(320,320); var curve = new api.Bezier([ {x:248,y:188}, {x:218,y:294}, {x:45,y:290}, {x:12,y:236}, {x:14,y:82}, {x:186,y:177}, {x:221,y:90}, {x:18,y:156}, {x:34,y:57}, {x:198,y:18} ]); api.setCurve(curve); api._lut = curve.getLUT(); }, findClosest: function(LUT, p, dist) { var i, end = LUT.length, d, dd = dist(LUT[0],p), f = 0; for(i=1; i