diff --git a/lib/torque/renderer/iso.js b/lib/torque/renderer/iso.js index d4aaa70..4786893 100644 --- a/lib/torque/renderer/iso.js +++ b/lib/torque/renderer/iso.js @@ -265,6 +265,16 @@ torque.extend(IsoRenderer.prototype, torque.Event, { return gctx.getImageData(0, 0, 1, 256).data; }, + cardinalSpline: function(line){ + var plainArray = []; + for (var p = 0; p < line.length; p++){ + var interpolation = line[p].coord.interpolation || {x: 0.5, y: 0.5}; + plainArray.push(20 + 20*line[p].coord.x + 20 * interpolation.x); + plainArray.push(20 + 20*line[p].coord.y + 20 * interpolation.y); + } + return cSpline(plainArray, 0.5, 25, true); + } + /* CARDINAL SPLINE by Steffen Bär