Created
April 3, 2016 15:11
-
-
Save ednisley/e1d4f0a03bf4ec11a3622cbcbcaa9eed to your computer and use it in GitHub Desktop.
OpenSCAD source code: Thinwall and solid boxes for 3D printer calibration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple calibration boxes | |
// Thin wall open box - verify Extrusion Multiplier | |
// Solid box - verify infill settings | |
// Ed Nisley - KE4ZNU | |
// http://softsolder.com/ | |
Layout = "Open"; // Open Solid | |
Texting = "Text!"; // text message on solid box or empty string to suppress | |
//------- | |
//- Extrusion parameters must match reality! | |
ThreadThick = 0.25; | |
ThreadWidth = 0.40; | |
Protrusion = 0.1; // make holes end cleanly | |
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit); | |
//------- | |
// Dimensions | |
WallThick = 1.0 * ThreadWidth; | |
echo(str("Wall thickness: ",WallThick)); | |
BoxSize = 20.0; | |
echo(str("Overall size: ",BoxSize)); | |
NominalHeight = 3.0; | |
echo(str("Nominal height: ",NominalHeight)); | |
Height = IntegerMultiple(NominalHeight,ThreadThick); | |
echo(str("Actual height: ",Height)); | |
Rotation = 0; // 45 to exercise X and Y axis motors at same time | |
CornerRadius = 2.0; | |
CornerSides = 8*4; | |
//-------- | |
module Solid() { | |
difference() { | |
hull() | |
for (i=[-1,1], j=[-1,1]) | |
translate([i*(BoxSize - 2*CornerRadius)/2,j*(BoxSize - 2*CornerRadius)/2,0]) | |
cylinder(r=CornerRadius,h=Height,$fn=CornerSides); | |
if (len(Texting)) | |
translate([0,0,-Protrusion/2]) | |
linear_extrude(height=3*ThreadThick + Protrusion) | |
mirror([1,0,0]) | |
text(text=Texting,size=6,spacing=1.05,font="ITC Zapf Chancery:style=Italic",halign="center",valign="center"); | |
} | |
} | |
module Thinwall() { | |
difference() { | |
Solid(); | |
hull() | |
for (i=[-1,1], j=[-1,1]) | |
translate([i*(BoxSize - 2*CornerRadius)/2,j*(BoxSize - 2*CornerRadius)/2,-Protrusion]) | |
cylinder(r=(CornerRadius - WallThick),h=(Height + 2*Protrusion),$fn=CornerSides); | |
} | |
} | |
//------- | |
rotate(Rotation) | |
if (Layout == "Open") | |
Thinwall(); | |
else | |
Solid(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More details on my blog at http://wp.me/poZKh-5Ns