You may have seen some 3D printed objects that feature mechanical systems that are printed in 1 piece and require no assembly. Since printers build layer-by-layer, they are capable of in building complex mechanics into a part.
A few exampled of this are:
While theses designs may seem simple, it is deceptively difficult to make the pieces work correctly.
This tutorial is intended for people who are familiar with CAD (loft and chamfer functions are used) and is for fused filament printers like a Makerbot. I use Autodesk inventor (which is incidentally a very tricky program to use for this) as well as a more conventional program called MoI.
Step 1: Things You Need to Know
The biggest difficulty in making these successfully is parts fusing. A certain amount of play is necessary to keep this from happening. Without any overhangs, this play is about .1-.2 mm on most printers, but the vertical precision is usually a lot less, and overhangs usually cause material to sag. The higher the overhang angle you use, the more play you will need. A 45 degree overhang will fuse with a slope .1 mm away, but probably won't fuse with one .3 mm away, but a 60 degree one probably will. Generally, angles less than 45 degrees are used, but 45 degrees works pretty well.
Also note, these parts are all very similar. This tutorial uses one relatively easy system for making hinges (and sliders), but several others exist.
Step 2: Conceptualize Your Design
This is probably obvious, but to make something you need a conceptual idea of what it is. I highly recommend figuring out the entire design before making it on CAD, even drawing it on paper if need be. It is very hard to make this sort of thing without knowing how it will work beforehand.
Step 3: Create the Base Profile
Create the 2D base for you part. Most of the geometry of the part will be dependent on this.
Step 4: Extrude the Base
Don't leave space for the angled bits, we will add those with camfer.
Step 5: Chamfer the Base
Chamfer can usually be found under fillet. It is like a fillet, but straight. Chamfer the parts that need to be angled.
Step 6: Create the Profile for the Other Part.
This should be based on the inside of the chamfer. For hinges, I use a pointed shape to minimize the chances of the parts fusing. A pointed shape probably works the best. With a slider, this part should be the outside, the profile of which should be upright.
Step 7: Scale and Copy This Profile
Create copies of the inside profile, then scale some of them up to the outside of the chamfer. Take each profile and scale it down to about 95 (scale factor .95) percent to add play. Do NOT scale all profiles at once (unless your CAD program has a 2d scale option) as this will move the profiles in z. This step may not be necessary for some designs.
Note that programs like Autodesk Inventor will not allow you to scale or copy a profile that is based on reference geometry, you will have to create all profiles individually and make them at a smaller scale. There may be an easier way to do this, but I do not know it.
Step 8: Loft the Profile Together
Use loft to connect all these profiles. Select the option to make the loft "straight". (If you do not have this, loft sets of profiles together, only selection two profiles at a time).
Step 9: Attach Pieces for Usability
Small hinges will not move easily without a connection to some sort of handle. Make sure the connection to this handle is solid, if the part fuses you can use this handle to break it apart, but the handle can break before hinge does.
Step 10: Print It!
Print the part. Make sure to turn supports off, and this should probably be printed without a loft. Use the highest quality print settings. The best materials for these mechanisms are probably ABS or HIPS, but PLA worked fine for me.
Step 11: Separate Any Fused Parts
There is a high chance that parts will stick together, and there are several ways to break them. First, try just moving the part the way it is supposed to move, parts will often separate easily. If a hinge is stuck, try using the flat edge of an Exacto knife to twist the part. If this does not work, try using pliers to break the part.