This is my notepad where i collect the useful snippets of OpenSCAD code that i use over and over. Some better curated than others, some formatted for clarity some for efficiency.
Showing posts with label Smooth and Gaussian Curve. Show all posts
Showing posts with label Smooth and Gaussian Curve. Show all posts
Takes a linear 0-1 value and apply an S-function.
Gauss is the inverse of that S-function.
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));