Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------
- // {Project Name}
- // {Creator Name}
- // CC {Year}
- // OpenSCAD
- //--------------------------------
- // Thingiverse Customizer Docs: http://customizer.makerbot.com/docs
- // OpenSCAD uses millimeters (mm) for units.
- // Distance functions are both for conversion and to state plainly that a number is a
- // distance measurement, not just a value.
- // Fractions are interpreted as formulas: '1 3/4' = '1+3/4' = 1.75
- function mm(x = 1) = x * 1.00000;
- function cm(x = 1) = x * 10.00000;
- function m(x = 1) = x * 1000.00000;
- function inches(x = 1) = x * 25.40000;
- function feet(x = 1) = x * 25.40000 * 12;
- function yards(x = 1) = x * 25.40000 * 12 * 3;
- function twice(x = 1) = x * 2.00000;
- function half(x = 1) = x * 0.50000;
- // Segments used for circles/cylinders have their *endpoints* on the radius. This means that
- // cylinders used for holes will be too small; the *midpoints* need to be on the radius,
- // not the *endpoints*. This function returns properly sized radii for holes.
- function midpoint_radius (endpoint_radius, num_facets) = endpoint_radius / cos(360/(num_facets*2));
- // OpenSCAD uses degrees (deg) for units.
- // Angle functions are both for conversion and to state plainly that a number is a
- // angle measurement, not just a value.
- _pi = 3.14159265359 * 1.0; // (Made into an equation so that Customizer won't pick it up.)
- function deg(x = 1) = x;
- function rad(x = 1) = x * (180 / _pi);
- // Creates a vector that points from the origin to a specific point in space.
- function rotateto(x=1,y=1,z=1) = [0,acos(z/norm([x,y,z])),atan2(y,x)];
- // Sets different curve smoothnesses for draft <F5> and render <F6> views
- draft_quality = 12; // [12:6:360]
- final_quality = 72; // [12:6:360]
- smoothness =$preview ? draft_quality : final_quality; // (Circles are divided in $fn line segments.)
- // echo($preview,smoothness);
- $fn = smoothness;
- //--------------------------------------------------------------------------------------------
- /*/
- //*/
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement