for(i=[-0:1/160:1])translate([i,0])square([1/160, ( ( smooth2(i) )) ]);
function smooth2(x,k=5,n=4) =1- (exp( -k*pow(x,n) ));
Compared to smooth step
for(i=[-0:1/160:1])translate([i,0])square([1/160, ( ( smooth2(i) )) ]);
function smooth2(x,k=5,n=4) =1- (exp( -k*pow(x,n) ));
for(i=[-0:1/160:1])translate([i,0])square([1/160, (smooth( (i),2/3,0.1))]);
function smooth (a) =let (b = clamp(a))(b * b * (3 - 2 * b));
function clamp(a, b = 0, c = 1) = min(max(a, b), c)
function smooth_curve(a) =
let (b = clamp(a))(b * b * (3 - 2 * b));
function clamp(a, b = 0, c = 1) = min(max(a, b), c);
function gauss(x) =
x + (x - smooth_curve(x));
