# What kinds of gaps/tolerances should I use when designing pieces that fit together?

Let's say I'm modeling a simple box with a lid. Just as an example, we'll say the outer edge along the top of the box is 50mm x 50mm. With 3D modeling software, it's easy to build a lid for this box to surround the top with an inner edge size of also exactly 50mm x 50mm ...but this seems like a bad idea. Surely I'll want some kind of of gap, to ensure an easy on/off. An exact fit seems like it's asking for trouble.

• How much gap do we leave for this kind of thing?
• Is it related to nozzle size?
• I suppose it also matters how tightly you want to fit, though I expect in cases where a tight fit matters some kind of snap or clip would be used.
• Are draft prints with larger layer sizes useful for figuring this, or do the rough layers make things seem tighter than they'll be in a final print?
• There's always the "print and then file to fit" approach, but I wouldn't recommend it – Carl Witthoft Aug 7 '18 at 12:45
• 0.4 mm is enough to fit the parts, 0.6 to get disassembled easily. – Fernando Baltazar Apr 27 '19 at 5:45

## 7 Answers

I use my clearance values according to my rule of thumb: 0.1mm - to fit with some force, 0.2mm - just fit edge to edge without force.

Examples:

1) 3mm metal cylinder to be pressed into plastic part needs 3mm+0.1mm*2=3.2mm diameter printed hole (clearance from two sides)

2) 3mm screw to fit into plastic part needs hole bigger than 3mm+0.2mm*2=3.4mm that is 3.5mm will be already good.

This is fully experimental but always worked for me on three different printers and both on PLA and ABS.

• While I agree with the numerical values, you need to keep in mind that printer's tollerance. Thicker Extrusion needs more tollerance. – Trish Sep 7 '18 at 4:51

Short version: basically, this depends on your printer, make, model, type, state of maintenance, extruder, slicer settings, belt tension, play, friction, etc.

Long version: Basically your printer determines how accurate it prints; you can influence the accuracy a little by calibrating and fine tuning the printer. What regularly is done is to print calibration cubes of fixed size. Before you do that, you should read "How do I calibrate the extruder of my printer?"; this explains to calibrate the extruder. With a fine tuned extruder you could print those XYZ calibration cubes, or in your case create a box of e.g. 50 x 50 x 15 mm. When you measure the length and the width with a caliper, you will know how much the tolerances are for this print size. Eventually, you could change this by re-adjusting the steps per mm in the firmware of the printer, but this is not always a recommendation (as your steps per mm should be related to the mechanical layout of the used mechanism, e.g. the belt size and pitch in combination with the pulley and the stepper resolution).

Please also look into the answer of "How to make moving parts not stick together?"; this answer hints to printing a tolerance calibration model that uses diabolic shapes set apart from the outer object by several values for the offset between the pieces. When you print this you can find out what sort of tolerance works for you. Please do note that the tolerances on smaller parts may be different than the tolerances on larger parts.

The answer on your question thus depends on your 3D printing machine, but usually the tolerance values range in the few tenths of a millimeter. To enable a lid on top of a box like in your example, you need to keep the tolerance in mind when designing the lid. Usually an extra few tenths of a millimeter will do the trick, but if you make some test prints first you will know exactly.

To answer the question what the influence is of layer height on tolerance, I quote:

Load a 25 mm cube into your slicer and set the infill to 0%, perimeters to 1, and top solid layers to 0. You’ll also want to print it at a fine resolution – I chose 0.15 mm and it actualy did make a small (0.02 mm) difference in the wall thickness as opposed to 0.3 mm.

So yes the layer height has an effect, it is very little though.

An interesting read is "A Guide to Understanding the Tolerances of Your 3D Printer" from "matterhackers".

Yes, some clearance is necessary. Even if you were machining perfect metal parts, you would want a clearance gap (and make an allowance for mis-alignment along the Z axis too, long joints can bind quite easily).

In addition to this, you need to make a small allowance for the walls bulging slightly under the extrusion pressure (layer height being less than the nozzle diameter).

Other factors to take into account are layer-change ooze (which often makes a small seam appear), and ripple effects resulting from acceleration. This means that even once you have tested the gap that a specific model requires on your printer, you can't rely on the same gap working perfectly when you design another model. If you require rotational symmetry in your fit, it will be harder to get a good tight joint to be reliable.

Sometimes a print-in-place design can give you a similar effect to a clip together design, but permitting a more positive retention

Before we get into nozzle sizes and snap fits, let's start with the bigger picture. We need to use common language for defining the parts.

• Allowance is a planned difference between a nominal or reference value and an exact value.
• Clearance is an allowance defining the intentional space between two parts.
• Interference is an allowance defining the intentional overlap between two parts.
• Tolerance is the amount of random deviation or variation permitted for a given dimension. How much error can the part tolerate and still function?

Let's use an example. We want a 5mm pin to go into a 5mm hole, and we want a loose fit between them.

We've said 5mm, but which 5mm is more important -- the 5mm hole or the 5mm pin? Let's say other people have 5mm pins they want to use with our hole. In this case the pin dimension is out of our control, and therefore is more important for interoperability.

The loose fit is calling for clearance. Let's specify 0.2mm so they're free to turn. We could add the 0.2mm allowance to the hole, giving a 5.2mm hole with a 5.0mm pin; we could subtract the 0.2mm allowance from the pin, giving a 5.0mm hole with a 4.8mm pin; or split the difference in any way we want, such as a 5.1mm hole and a 4.9mm pin. Because we specified the pin is more important, we'll add the allowance to the hole.

Now that we have defined our part, let's define other terms important to helping us understand the manufacturing process:

• Accuracy is the maximum dimensional variation between parts. (Another word might be repeatability.) Note that a machine cannot produce parts with a tighter tolerance than its accuracy.
• Precision is the size of the steps a machine is capable of. Precision is often confused with accuracy, but they are not the same thing.

Now we need to understand our machine's accuracy. The printer could print the pin larger than 5mm or smaller than 5mm. Or it could print the hole larger than 5mm or smaller than 5mm. To determine the printer's accuracy, we'll need to print some 5mm pins and 5mm holes and measure the differences between what we defined and what we printed. The difference between the largest and smallest measurements is our machine's accuracy. Be sure to measure the accuracy in the X, Y, and Z dimensions; a printer might have a difference between the X and Y axes that would affect the roundness of the parts. (If it's off, this can usually be adjusted in the machine's firmware through a calibration process.) Furthermore, we should test round parts, round holes, square parts, and square holes, as each printer can be different in how repeatable those parts are.

Let's say that the printer's measured accuracy for both round holes and round pins is +/- 0.2mm.

Then, we move to clearance. What is the minimum gap between parts and still do the job, and what is the maximum acceptable gap? As the designer, it's up to you to decide. In this example we said we want a loose fit, so let's define a clearance of at least 0.2mm between the pin and hole; but no more than 1.0mm or the parts will fall out.

Since the machine's accuracy is +/-0.2mm, the pin will be anywhere between 5.2mm and 4.8mm. The hole must therefore be 5.2mm plus clearance plus the accuracy of the hole. That gives the hole dimension as 5.6mm +/-0.2mm. The minimum tolerance condition would be an minimum sized hole (5.4mm) and a maximum sized pin (5.2mm), giving a 0.2mm clearance; the maximum tolerance would be a maximum sized hole (5.8mm) and a minimum sized pin (4.8mm) giving a 1.0mm clearance.

Note that a clearance of 1.0 mm is really sloppy. It might seem too loose for our application. We might think to tighten the tolerances to 0.05mm in order to reduce the clearance. But we've noted that a machine can't produce a tolerance tighter than its accuracy. If the printer can't produce a part that meets our specified tolerances, we would need to find a different way to manufacture or finish the parts.

In the metalworking world a common way to do this is specify the parts to be initially manufactured with intentionally maximal material. This lets us start with a smaller hole and use a bore or a drill bit to open it up to a more precise and round hole. We can do the same thing with a pin, by starting with a thicker rod and turning or grinding it down to make it more smooth and round.

In the FDM 3D printing world, we can do the same kind of thing at the workbench. First, print the parts with an extra wall layer (or two). The extra thickness gives more material to remove while drilling it out, or grinding it down, without weakening the part too badly. After printing, run a drill bit through the hole to clean it up. Or spin the pin in a drill motor's chuck and grind it down with a loop of sandpaper.

Of course any time you add a finishing operation, it's more labor intensive and therefore more expensive. So this isn't something we want to do on every part, but we can consider it.

Notice that when you define parts this way you aren't starting with the nozzle diameter or layer height. Instead, you're allowing the nozzle diameter, layer height, and the sum of all the causes of variations, to show up in the measured accuracy of the machine. Smaller nozzles, thinner layers, heated beds, or cooling fans may each contribute to improved accuracy, but it's best to factor in the cumulative impact of all the machine options.

Since you said nozzle, I expect you mean FDM 3d printing. Typically you would use one (1) outline of gap between the parts. An outline is usually equal to the size of the nozzle. The corners of a 3d printed square object are rounded. The radius of that rounding would be half your nozzle diameter (i.e. the nozzle's radius). Also if there was any over extrusion occurring on the outline it the two parts would not fit within each other. This is of course assuming that they are being designed to easily come apart. Otherwise you can make them an exact fit if you intend to friction fit them together.

• 1 is playing it Safe. 0.5 nozzles is doable on a not too well calibrated printer. 0.25 nozzles is achieveable, 0.125 nozzles a wet dream with a 0.4mm nozzle. The 0.05mm gap ist a pain to get with a 0.2 mm nozzle, but just a PITA – Trish Sep 7 '18 at 4:57

I usually print a test cube with different wall thicknesses and calculate the average deviation. This I use as tolerance. However, I do not believe that many belt driven cartesian printers can perform much better than +/- 0.1 to 0.25 mm along the XY-axis. Consequently, I would suggest to use something between 0.1 to 0.25 mm. If it is more than 0.5 mm you have an issue with the mechanics.

• I have achieved a 0.05 with a 0.2mm nozzle on a straight line. With a 0.1mm nozzle, this would be a trivial task. – Trish Sep 27 '18 at 17:09
• Try it in a rect-wave pattern. This tests the mechanics. – dgrat Sep 28 '18 at 8:26

After printing 4 months, I've learned an answer for at least two situations, based on the geometry of the filament and nozzle. For this discussion, I'm using .1mm layers with a .4mm nozzle.

First is the basic box and lid, from my question. It's important to remember the shape of the nozzle opening in a circle, and therefore when extruding to open air you get a cylinder. But we don't extrude to open air. We subtly press the extruded filament into the build surface or previous layer. In that case, using my best ascii art, a cross section of an extruded line of filament has rounded edges that only approximate that .4mm nozzle size, like this:

(    )


And as you lay down several layers, the exterior edge of a printed part should look more like this:

(
(
(
(


where the outer edge of the curve actually protrudes slightly from the planned dimensions of the part. The question is, "how much"? My experience so far has been as much .05mm. And remember, you need to account for that for both the box part and the lid part. Additionally, when designing the lid, you need to account for this gap on both ends of each dimensional axis. That means a gap of as much .2mm could still be a nice, snug fit.

For the second scenario, let's say you have a pair of prints that will fit together. The base print includes an upward-pointing rod or cylinder, like a Lego piece, that will slot into a paired opening.

Now you need to create the matching cylinder opening in the upper part, and you need to know how big. The concern is the top of the opening, which has nothing but air below it to hold up the filament. For small gaps you might bridge the distance. For larger gaps you might use support material or hemisphere top.

Let's say you find those options difficult for this scenario, or perhaps other factors have you printing this part laying sideways. so instead of an opening for a cylinder sitting like a can of soup, you print the part as is the cylinder were laying on it's side.

Now we can consider the geometry of how the filament is laid down. With my example nozzle and layer dimensions, we realize your opening is not the precise circle indicated by the model. Instead, you have a grid pattern, like old 8-bit computer art. Worse, the width of each "pixel" is up to 4 times greater than the height.

With that in mind, the minimum extra space you need will be 1/2 of that .1mm height, and the wrong situation could extend this to as much as 1/2 of the .4mm filament width. And since this goes all the way around the part (on both sides) you need these distances twice. This is in addition to the ridging effect discussed for the box earlier. The result means your rounded part should look for between a gap between .3mm and .5mm, with additional gap space if you're designing a part you may want to scale at some point. Remember, though, that plastic is pliable and if push comes to (literal) shove, sandable. In practice I've done well near the lower end of that range.