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.
Wednesday, August 30, 2017
Wrap number
Wraps numbers inside boundaries Usage:
function wrap(x,x_max=1,x_min=0) =
(((x-x_min)%(x_max-x_min))+(x_max-x_min))%(x_max-x_min)+x_min;
// wraps numbers inside boundaries
No comments:
Post a Comment