verts = Math.max(2, Math.floor(effect("Vertices")("Slider"))); // number of points
l = effect("Length")("Slider"); // total line length in px
amplitude = effect("Amplitude")("Slider"); // zig-zag height in px
seg = l / (verts - 1);
half = l / 2;
pts = [];
inT = [];
outT = [];
for (i = 0; i < verts; i++) {
x = -half + seg * i;
y = (i % 2 === 0) ? amplitude : -amplitude;
pts.push([x, y]);
inT.push([0, 0]);
outT.push([0, 0]);
}
createPath(pts, inT, outT, false);