OpenSCAD is great. You assemble your model with code, not drawings, and can be very efficient, if you think that way. I am working on a project to make LED clocks of various types. The most common part I print is a cylinder with 60 holes (or 120 as is the case in the code below). These holes are evenly-spaced radially around the height-center of the cylinder.
To make these 60 holes could take quite a bit of time with SketchUp or similar... With OpenSCAD, it's a simple FOR-Loop.
In making these cylinders, I also wanted to be able to vary certain attributes, say, cylinder height... Well, if I make the cylinder 20mm taller, the height-center changes by 10mm. By building the code around variables, one can alter a CYLINDER_HEIGHT variable, and that not only re-calculates the cylinder height, but could also re-calculate the height of the holes, without changing the diameter or radial spacing.
check it out... This is a part I make...
And this is the code that generates it (everything that follows a "//" is a comment)
MyR = 44; // sets outside radius of ring
MyH = 36; // sets height of ring
MyLeds = .8; // sets diameter of holes
MyQuarters = 1; // -- unused --
MyHours = 1; // -- unused --
difference() // subtract from the first object, every object that follows
{
rotate ([0,0,3]) cylinder (h=MyH, r=MyR, $fa=6, center=true); // make main cyl (outer wall)
rotate ([0,0,3]) cylinder (h=MyH+4, r=MyR-2, $fa=6, center=true); // subtract neg space (inner wall)
for ( i = [0 : 59] ) // loops 60 times to make a circle of horiz. mini-cylinders to subtract
{
rotate( i * 6, [0, 0, 3]) // rotate 6 degrees on X axis every time ( 6 x 60 = 360 )
translate ([MyR,0,1.5]) // shift removal cylinders by MyR (radius) and up from Vert. Center
rotate([0,90,0]) // rotate cylinder 90 deg. on Y axis to make Horiz.
cylinder (h=8, r=MyLeds, center=true); // Top Hole
rotate( i * 6, [0, 0, 3]) // same as above cluster
translate ([MyR,0,-1.5]) // shift removal cylinders by MyR (radius) and up from Vert. Center
rotate([0,90,0])
cylinder (h=8, r=MyLeds, center=true); // Bottom Hole
} // ends loop
} // ends difference
Post's attachmentsMiniRing.png
MiniRing.png 16.69 kb, 4 downloads since 2013-01-06
You don't have the permssions to download the attachments of this post.