module.exports = { degree: 3, activeDistance: 9, setup() { this.size(400, 400); var TAU = Math.PI*2; for (let i=0; i { this.stroke(200); this.line(n.x, n.y, p.x, p.y); p = n; this.stroke(0); this.circle(p.x, p.y, 4); }); this.drawSplineData(); }, drawSplineData() { if (this.points.length <= this.degree) return; var mapped = this.points.map(p => [p.x, p.y]); this.drawCurve(mapped); this.drawKnots(mapped); } };