// Newton Line for Scriptographer // version 20110908 // written by xoi (http://xoihazard.com) tool.eventInterval = 1000 / 100; var values = { lines: 1, mass: 30, gravity: 1, pressOn: true, pressGrav: 0.8, pressFric: 0.2, timescale: 0.2, friction: 0.02, rough: 5, drawAccel: true, optimize: false }; var components = { r1: { label: 'Physical Variables', type: 'ruler' }, mass: { type: 'slider', label: 'Mass', range: [1, 100] }, friction: { type: 'slider', label: 'Friction', range: [0, 0.1] }, timescale: { type: 'slider', label: 'Speed of Time', range: [0.01, 1] }, r2: { label: 'Tablet Pressure', type: 'ruler' }, pressOn: { type: 'checkbox', label: 'Pressure' }, pressGrav: { type: 'slider', label: 'Gravity Variation', range: [0, 1] }, pressFric: { type: 'slider', label: 'Friction (Decrease)', range: [0, 1] }, r3: { label: 'Path Options', type: 'ruler' }, rough: { type: 'slider', label: 'Rough', range: [0.1, 100] }, optimize: { label: 'Optimize', type: 'checkbox' }, credits: { type: 'text', value: 'xoihazard 20110908' } }; var palette = new Palette('Newton Curve', components, values); var newton = new Array(values.lines); function onMouseDown(event) { for (i=0; i values.rough) { this.path.add(position); } this.lastPosition = position; } nL.prototype.finish = function(optimize) { if (optimize) { this.path.pointsToCurves(); } else { this.path.smooth(); } }