KeithFromCanada

OpenSCAD Header

Nov 15th, 2018
247
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //--------------------------------
  2. // {Project Name}
  3. // {Creator Name}
  4. // CC 2018
  5. // OpenSCAD
  6. //--------------------------------
  7.  
  8. // Thingiverse Customizer Docs: http://customizer.makerbot.com/docs
  9.  
  10. // OpenSCAD uses millimeters (mm) for units.
  11. // Distance functions are both for conversion and to state plainly that a number is a
  12. //    measurement, not just a value.
  13. // Fractions are interpreted as formulas: '1 3/4' = '1+3/4' = 1.75
  14. function mm(x = 1)     = x *    1.00000;
  15. function cm(x = 1)     = x *   10.00000;
  16. function m(x = 1)      = x * 1000.00000;
  17. function inches(x = 1) = x *   25.40000;  
  18. function feet(x = 1)   = x *   25.40000 * 12;  
  19. function yards(x = 1)  = x *   25.40000 * 12 * 3;  
  20.  
  21. function twice(x = 1)  = x *    2.00000;
  22. function half(x = 1)   = x *    0.50000;
  23.  
  24. // OpenSCAD uses degrees (deg) for units.
  25. // Angle functions are both for conversion and to state plainly that a number is a
  26. //    measurement, not just a value.
  27. _pi   = 3.14159265359;
  28. _ease = 1.0155;  // Multiply holes by this to counteract shrinkage in 3d printed parts.
  29.  
  30. function deg(x = 1) = x;
  31. function rad(x = 1) = x * (180 / _pi);
  32.  
  33. quality = 72; // [12:6:360]
  34. smoothness=$preview ? 12 : quality; // (Circles are divided in $fn line segments.)
  35. echo($preview,smoothness);
  36. $fn = smoothness;
  37.  
  38. //--------------------------------------------------------------------------------------------
RAW Paste Data