List: discuss@lists.openscad.org
From: jazzjohn
Re: [OpenSCAD] Easy way to accumulate a sum?
Mon, Mar 20, 2017 5:48 PM
add(v, i+1,r + sqrt( (v[i+1][0]-v[i][0]) * (v[i+1][0]-v[i][0])
+(v[i+1][1]-v[i][1]) * (v[i+1][1]-v[i][1]) )
) : r;
pts = [ [0,0],[100,100],[200,0],[300,100] ];
out = add(pts);
echo(out);
ECHO: 424.264
--
View this message in context: http://forum.openscad.org/Easy-way-to-accumulate-a-sum-tp20963p20966.html
Sent from the OpenSCAD mailing list archive