Added curves.scad, includes helix_curve() ATM

This commit is contained in:
Elmom 2010-07-25 18:03:04 +03:00
parent fd06f8e648
commit 2edbc11b1d

17
curves.scad Normal file
View file

@ -0,0 +1,17 @@
include <constants.scad>
use <math.scad>
/* A circular helix of radius a and pitch 2πb is described by the following parametrisation:
x(t) = a*cos(t),
y(t) = a*sin(t),
z(t) = b*t
*/
function b(pitch) = pitch/(TAU);
function t(pitch, z) = z/b(pitch);
function helix_curve(pitch, radius, z) =
[radius*cos(deg(t(pitch, z))), radius*sin(deg(t(pitch, z))), z];