 Translate.
 When you “translate” an object, you’re really just moving it, that’s all. And, you can move it in any combination of the three dimensions at the same time. For the sake of simplicity, let’s take a basic sphere with a radius of 5.
 “sphere(5);”
 Now, let’s move it around in the X dimension.
 “translate([10,0,0]) sphere(5);”
 Now, just the Y dimension.
 “translate([0,20,0]) sphere(5);”
 Now, just the Z dimension.
 “translate([0,0,30]) sphere(5);”
 Now, all three at once.
 “translate([10,20,30]) sphere(5);”
 As you can see, it’s really just a matter of using the “translate()” command, inserting a set of distances to move an object in each of the three dimensions, and then saying what object you’d like to move. This same system works equally well with any of the other 3D forms we described. Very quickly, here’s how you can move any of them in the same fashion. ((I can see how this might be a little repetitive for you, but sometimes it’s nice to have it spelled out explicitly.))
 Here we go with a cylinder, cube, tapered cylinder, cone, and rectangular box:
 “translate([10,20,30]) cylinder(20,5,5);”
 “translate([10,20,30]) cube(5);”
 “translate([10,20,30]) cylinder(20,5,10);”
 “translate([10,20,30]) cylinder(20,5,0);”
 “translate([10,20,30]) cube([4,8,16]);”
 When you “translate” an object, you’re really just moving it, that’s all. And, you can move it in any combination of the three dimensions at the same time. For the sake of simplicity, let’s take a basic sphere with a radius of 5.
 Rotate.
 Rotating an object is easy once you get the “translate” command. Just as with “translate” above, all you have to do is specify how much you want (in degrees) to rotate an object around the X, Y, and Z axis. Let’s rotate a rectangular box in each of the three directions. First, just the box.”cube([4,8,16]);”
 Now, let’s rotate it 90 degrees around the X axis.
 “rotate([90,0,0]) cube([4,8,16]);”
 As promised, the way we use the command “rotate” is really similar to the “translate” command. Now let’s rotate that same box around the Y axis by 90 degrees.
 “rotate([0,90,0]) cube([4,8,16]);”
 Now, the same box around the Z axis by 90 degrees.
 “rotate([0,0,90]) cube([4,8,16]);”
 Now, the same box rotated around the X, Y, and Z axes by 90 degrees each.

 “rotate([90,90,90]) cube([4,8,16]);”
 Now, the same box rotated around the X axis by 45, Y axis by 90, and Z axis by 135 degrees.

 “rotate([45,90,135]) cube([4,8,16]);”
 Pro Tip: I tend to get disoriented very quickly when rotating an object in 3D space in OpenSCAD. Since it’s easy to render the changes by hitting “F5,” if I need to make a change to the way something is being rotated in 3D space I just make a change to one of the axes in “rotate,” render, then try another axis if I got it wrong.
 For the same of completeness, let’s spin each of our basic forms in the same manner. Here’s a rotated sphere, cylinder, cube, tapered cylinder, cone, and rectangular box in that order:

 “rotate([45,90,135]) sphere(5);”
 “rotate([45,90,135]) cylinder(20,5,5);”
 “rotate([45,90,135]) cube(5);”
 “rotate([45,90,135]) cylinder(20,5,10);”
 “rotate([45,90,135]) cylinder(20,5,0);”
 “rotate([45,90,135]) cube([4,8,16]);”
 You now have the power to create any basic sphere, cylinder, cube, taper cylinder, cone, or rectangular box of any size you wish, move them to any place in 3D space you wish, and then rotate them in any way you wish. It has been just four short tutorials to this point – but you now have the ability to make almost anything you want. Savor the moment!
 But, while we’re here… why not learn just one more simple command?
 Scale.
 Just as “translate” let you specify how to move an object in each of the three dimensions and “rotate” let you rotate an object around any of the three axes, “scale” will let you scale (or, really, stretch) an object in any of the three dimensions. However, instead of using a distance (as with “translate”) or degrees (as with “rotate”), with scale we specify the percentage to scale a dimension up or down in decimals. A decimal of “1” will effect no change in that dimension, a decimal of “2” will double the size of the object in that dimension, and a decimal of “0.5” will halve the size of the object in that dimension.
 My favorite thing to scale is a sphere because they just look cool when stretched or squished. First, our trusty basic sphere with a radius of 5:
 “sphere(5);”
 Now, to scale it to 200% in the X axis:
 “scale([2,1,1]) sphere(5);”
 Now, scaling it to 50% in the X axis:
 “scale([0.5,1,1]) sphere(5);”
 Now, let’s scale it 200% in the Y axis:
 “scale([1,2,1]) sphere(5);”
 Now, let’s scale it 200% in the Z axis:
 “scale([1,1,2]) sphere(5);”
 Now, let’s scale it 50% in the X axis, 150% in the Y axis, and 200% in the Z axis:
 “scale([0.5,1.5,2]) sphere(5);”
 For the same of completeness, let’s scale each of our basic forms in the same manner. Here’s a scaled sphere, cylinder, cube, tapered cylinder, cone, and rectangular box in that order:
 “scale([0.5,1.5,2]) sphere(5);”
 “scale([0.5,1.5,2]) cylinder(20,5,5);”
 “scale([0.5,1.5,2]) cube(5);”
 “scale([0.5,1.5,2]) cylinder(20,5,10);”
 “scale([0.5,1.5,2]) cylinder(20,5,0);”
 “scale([0.5,1.5,2]) cube([4,8,16]);”
OpenSCAD Basics: Manipulating Forms
With the first three OpenSCAD tutorials I showed you how the basics of the OpenSCAD interface works, how to make a 2D form, and how to make some basic 3D forms. ((The above image is a derivative of the CSG forms from Zottie)) As you know from playing with Legos, you can build almost anything if you have a few different shaped blocks of various sizes. Armed with the knowledge of how to make a sphere, cylinder, cube, tapered cylinder, cone, and rectangular box of any size in OpenSCAD now gives you the ability to design almost anything! Not bad for just three tutorials, eh? Unfortunately, although we know how to make those forms, they are all attached to the XYZ origin at [0,0,0] which doesn’t do us much good.
Not to worry! That changes today! I’ll show you how to take any of those forms, and move them around in 3D space at will!
Manipulating forms is not that difficult as soon as you remember the lesson of the “cube” command. As you recall, the cube was formed by specifying the dimensions as X, then Y, then Z to say how long, how deep, and how tall an object is supposed to be. When you can spin a model around in your computer, the concepts of long, deep, and tall being a little disorienting. So, it’s best to learn to think of these objects in terms of the actual dimensions themselves. This last rectangular box was written as “cube([4,8,16]);” to achieve a cube with an X dimension of 4, Y dimension of 8, and Z dimension of 16.