Commit 3197c81babd811eaaced15542dcf80418f910bf7
default to hires curves
Dominic Tarr committed on 12/30/2017, 8:03:29 AMParent: 485abbed38bbfd00fab0954f74231a8d4085db0d
Files changed
midpoint.js | changed |
midpoint.js | ||
---|---|---|
@@ -32,9 +32,9 @@ | ||
32 | 32 … | exports.snapY = snap |
33 | 33 … | |
34 | 34 … | function smooth2D (points, tension, sides) { |
35 | 35 … | tension = tension || 0.5 |
36 | - sides = sides || 3 | |
36 … | + sides = sides || 5 | |
37 | 37 … | var p = Cardinal.getCurvePoints(points.reduce(function (a, b) { |
38 | 38 … | return a.concat(b) |
39 | 39 … | }), tension, sides) |
40 | 40 … | |
@@ -50,12 +50,12 @@ | ||
50 | 50 … | function smooth (points, step, tension) { |
51 | 51 … | step = step || 1 |
52 | 52 … | var smoothX = m.snapY(smooth2D(points.map(function (e) { |
53 | 53 … | return [e[0],e[1]] |
54 | - }), tension), step) | |
54 … | + }), tension, 10), step) | |
55 | 55 … | var smoothZ = m.snapY(smooth2D(points.map(function (e) { |
56 | 56 … | return [e[2],e[1]] |
57 | - }), tension), step) | |
57 … | + }), tension, 10), step) | |
58 | 58 … | |
59 | 59 … | return smoothX.map(function (e, i) { |
60 | 60 … | return [e[0],e[1], smoothZ[i][0]] |
61 | 61 … | }) |
Built with git-ssb-web