A snap-fit box lid is a flat plate with a skirt (the lip) that drops inside the box wall with 0.20 to 0.25 mm of clearance per side, 0.40 to 0.50 mm across. Make the skirt 1.35 mm thick and at least 4 mm tall, and give it a bump that catches 0.3 to 0.5 mm in a groove cut into the wall.
How do you design a snap-fit lid for a 3D printed box?
A snap-fit lid for a 3D printed box is a plate with an inner skirt 1.2 to 1.35 mm thick and at least three times as tall, set 0.20 to 0.25 mm per side inside the box wall. A bump on the skirt, 0.5 to 0.7 mm proud, catches 0.3 to 0.5 mm in a matching groove.
These are the numbers to model for PLA (polylactic acid) or PETG (glycol-modified polyethylene terephthalate), printed with a 0.4 mm nozzle at 0.2 mm layers:
| Feature | Value to model | Source |
|---|---|---|
| Skirt to box wall | 0.20 to 0.25 mm per side (0.40 to 0.50 mm total) | QIDI |
| Skirt thickness | 1.35 mm, three 0.45 mm lines; at least 1.2 mm in PLA, 0.8 to 1.0 mm in PETG | Prusa, QIDI |
| Skirt height | at least 3 × its thickness: 4 mm for a 1.35 mm skirt | QIDI |
| Box wall, floor and lid plate | 2 mm minimum; 2.25 mm is five 0.45 mm lines | Hubs, Prusa |
| Catch depth (undercut) | 0.5 mm; 0.3 mm on a lid you open every day | Sovol, Bayer |
| Bump height on the skirt | catch depth + clearance: 0.5 + 0.20 = 0.7 mm | arithmetic |
| Bump lead-in face | 25 to 35° from the direction the lid moves | Sovol |
| Bump back face | 45 to 70° to stay removable, 90° to lock for good | Sovol |
| Bump length along the wall | at least 5 mm | Hubs |
The catch is the bump height minus the gap. The skirt already stands 0.20 mm off the wall, so a 0.5 mm bump only hooks 0.3 mm of wall. Model the bump as the catch you want plus the clearance, and cut the groove as deep as the bump is tall. At rest the bump then sits with the same 0.20 mm gap as the rest of the skirt.
Wall and skirt thickness in whole lines
Make every wall a whole number of extrusion lines, so the slicer doesn’t leave a gap or a thin line of infill. Prusa’s table for a 0.4 mm nozzle (0.45 mm lines in PrusaSlicer) gives 0.9 mm for two perimeters, 1.35 mm for three and 1.8 mm for four. Hubs sets a 2 mm minimum for enclosure walls, which a five-line 2.25 mm box wall clears. Check your slicer’s line width before you round.
The skirt is the part that flexes, so it stays thinner than the wall. QIDI’s minimum snap-hook thickness is 1.2 mm in PLA and 0.8 to 1.0 mm in PETG, which three 0.45 mm lines (1.35 mm) clear in both.
How big to make the catch, and where
Sovol’s starting undercut for hooks on desktop fused deposition modeling (FDM) printers is 0.5 to 1.2 mm. A lid skirt is a short arm, so start at the bottom of that range.
Bayer’s snap-fit guide (Bayer’s plastics business is now Covestro) gives the catch a straight arm can take as 0.67 × strain × length² ÷ thickness, so a taller or thinner skirt takes a deeper catch. For parts taken apart and rejoined often, the same guide says to use about 60% of the single-assembly strain. That turns a 0.5 mm catch into 0.3 mm for a lid you open daily.
Put the bumps in the middle of the long sides, not around the corners. A wall bends most in the middle of its span, and the next wall braces each corner. For a lid you will open, give the back face of each bump 45° (Sovol puts 45 to 70° for removable clips). That angle also prints without supports.
The skirt and the box wall both bend across their layer lines, which is the weak direction. Formlabs reports that elongation at break drops by about 50% when an FDM cantilever is built along Z. QIDI rates PLA acceptable only for snap joints assembled once, and PETG as the default for joints that open repeatedly. Print a lid you’ll open often in PETG.
To get the lid off again, cut a notch in the box rim at the middle of a short side, where a fingernail can lift the plate. The catches on the long sides then release one at a time.
Snap, press-fit or drop-in lid: clearance per side
| Lid | Per side | Total across | Inches, per side | Source |
|---|---|---|---|---|
| Snap lid with a catch | 0.20 to 0.25 mm | 0.40 to 0.50 mm | 0.008 to 0.010 in | QIDI |
| Press-fit lid, friction only | 0.10 to 0.15 mm | 0.20 to 0.30 mm | 0.004 to 0.006 in | UAL lab, Bambu H2D Pro |
| Drop-in lid, no latch | 0.30 to 0.50 mm | 0.60 to 1.00 mm | 0.012 to 0.020 in | QIDI |
The tolerance calculator defaults to 0.20 mm per side for a snap or friction lid and 0.40 mm for a drop-in lid. For a press-fit lid with no bump, the 0.10 to 0.15 mm row is the University of the Arts London lab’s alignment-peg fit on its Bambu H2D Pro. The same lab uses 0.2 mm for that fit on its UltiMaker S7, so test on your own printer before printing the whole box. QIDI says a lid perimeter needs about twice a single face’s allowance, because two printed walls stack their errors.
QIDI’s values are for PLA and PETG. For ABS (acrylonitrile butadiene styrene) or ASA (acrylonitrile styrene acrylate), add 0.05 to 0.10 mm per side. For unfilled nylon, add 0.10 to 0.20 mm.
A cover that fits over the box
For a cover that fits over the outside of the box, the clearance goes on the cover’s inside: a box 80 mm wide outside takes a snap cover 80.40 mm wide inside. Put the bump on the outside of the box wall and the groove inside the cover’s skirt.
Which way up to print the box and the lid
Print the box upright with its floor on the bed. Print the lid upside down, plate on the bed and skirt pointing up, so the skirt rises straight off the plate with nothing to support. The bump’s 45° back face and the groove’s 45° roof sit inside the overhang range Prusa says prints cleanly (45 to 60°).
Both orientations keep the mating faces away from the first layer, where elephant’s foot (first layers squashed wider than the rest) widens the part. The lid’s plate edge and the box’s bottom edge can flare without touching the fit.
ESP32 snap-fit case: a worked example
The ESP32-DevKitC V4 is Espressif’s own development board. Espressif’s dimension drawing gives the board as 48.26 × 27.94 mm, with the ESP32-WROOM-32E module’s antenna sticking 6.04 mm past one short edge. The drawing shows no mounting holes.
- Board outline: 48.26 + 6.04 = 54.30 mm long, 27.94 mm wide.
- Cavity: Hubs asks for 0.5 mm around every internal component, so 55.30 × 28.94 mm. Formlabs suggests 1.5 to 2.0 mm for FDM parts that warp, so use the larger gap in ABS or on a large box.
- Box outside: 2.25 mm walls add 4.50 mm to each side, for 59.80 × 33.44 mm.
- Lid plate: the same 59.80 × 33.44 mm, 2 mm thick.
- Skirt: 0.20 mm per side inside the cavity gives 54.90 × 28.54 mm outside. At 1.35 mm thick it measures 52.20 × 25.84 mm inside. Make it 5 mm tall.
- Catches: one 10 mm bump in the middle of each long side of the skirt, 0.7 mm proud, for a 0.5 mm catch. On a lid you open daily, make it 0.5 mm proud for a 0.3 mm catch. Each bump has a 30° lead-in toward the skirt’s tip and a 45° back. Cut a matching groove 0.7 mm deep in each long wall, and make it 0.4 mm (two layers) taller than the bump.
- Depth: the skirt overlaps the board’s edge, so its tip must stop above the tallest part. The module is 3.1 mm tall, so on a standard 1.6 mm board its top sits 4.7 mm above the board’s underside. Leave 0.4 mm (two 0.2 mm layers) under the skirt tip, then add the 5 mm skirt. The rim sits 10.1 mm above the board’s underside, plus whatever is under the board, such as header pins.
- USB port: cut the opening for the micro-USB plug’s body plus 1 mm per side (Hubs).
The header rows sit on 25.40 mm centers, 1.27 mm in from each long edge. That leaves little bare board along a long edge for a hook to grip. Rest the board on ledges under its two short ends, or on its header strips. Then give the lid a rib that stops 0.4 mm above the module’s top, so the board can’t lift.
How do you snap a PCB into a 3D printed case?
Snap a printed circuit board (PCB) into a 3D printed case with cantilever clips that hook over the board edge. For a standard 1.6 mm board, put the hook’s underside 1.8 mm above the support ledge and let it reach 0.5 to 1.2 mm over the board. Boards with mounting holes can use split-pin plugs or screws instead.
JLCPCB calls 1.6 mm (0.062 in) the most common board thickness, the IPC-2221 standard value. Its capabilities page allows ±10%, so a 1.6 mm board can measure 1.44 to 1.76 mm. A 1.8 mm seat clears the thickest board and matches QIDI’s 0.10 to 0.20 mm gap on a latch face. Measure a thinner board with calipers and lower the seat to match.
| Clip feature | Value | Source |
|---|---|---|
| Hook underside above the ledge | 1.8 mm for a 1.6 mm board | JLCPCB, QIDI |
| Hook reach over the board’s top face | 0.5 to 1.2 mm | Sovol |
| Hook lead-in | 25 to 35° | Sovol |
| Arm thickness | 1.2 mm in PLA, 0.8 to 1.0 mm in PETG | QIDI |
| Arm length | 8 to 10 × thickness in PLA, 5 to 8 × in PETG | Sovol |
| Clip width | at least 5 mm | Hubs |
| Root fillet | at least 0.5 × arm thickness | Sovol, Hubs |
| Gap from board edge to wall | 0.5 mm | Hubs |
A clip that grows up from the floor flexes across its layers, and Sovol warns that an arm printed upright can split at the root. Keep the reach at the low end, print the clips in PETG, or follow Sovol’s alternative: print the clip arms flat as separate pieces that slide into dovetail slots in the case. Put clips on opposite edges so the board can’t slide out from under a single hook.
Snap-in mounting plugs through the PCB’s holes
A plug for a mounting hole is a split pin with a barb. The two halves squeeze together to pass through the hole and spring out under the board. Size it from the hole:
shank = hole - 0.20 mm (0.10 mm per side)
barb = hole + 2 × catch (catch 0.5 mm per side)
slot ≥ 2 × catch (so the halves close through the hole)
prong = (shank - slot) ÷ 2 = (hole - 1.2) ÷ 2
barb underside: 1.8 mm above the standoff top
The prongs have to meet QIDI’s minimum hook thickness. In PLA (1.2 mm) that takes a hole of at least 3.6 mm. In PETG (0.8 mm) it takes at least 2.8 mm.
A Raspberry Pi 4 has four 2.7 mm holes on a 58 × 49 mm pattern, each 3.5 mm in from the edges with a 6 mm clear area around it. Its prongs would come out 0.75 mm thick, below both minimums, so screw a Pi down instead.
Where the hole is big enough, give the barb the same 25 to 35° lead-in as a clip and a 45° back if the board has to come out again.
Screws instead of snaps
For an M2.5 thread-forming screw into ABS, Würth gives a 0.8 × d pilot hole, a 2 × d boss and 2 × d of thread depth, where d is the screw’s diameter. That means a 2.0 mm hole, 5 mm deep, in a 5 mm standoff that fits inside the Pi’s 6 mm clear area.
To screw the lid down instead of snapping it, put a 3.4 mm clearance hole in the lid for an M3 screw (ISO 273 medium). Below it, put a 2.4 mm pilot in a 6 mm corner boss. The screw hole size calculator gives the holes for metric and US screws in each plastic.
If the lid is too tight or falls off
- Too tight everywhere: print a 20 mm calibration cube first. QIDI says to fix flow before touching the CAD if the cube measures over 20.1 mm. If the cube is right, add skirt clearance 0.05 mm per side at a time.
- Too tight only at the catch: the groove is too shallow or too short. Cut it as deep as the bump and two layers taller.
- Falls off: deepen the catch before tightening the gap. QIDI notes that a deeper hook with a generous gap holds better than a shallow hook with no gap. If you do tighten the gap, go down in 0.05 mm steps.
- Skirt cracks along a layer line: reprint in PETG, or make the skirt taller so it bends further before it breaks.
- Not sure yet: print only the top 10 mm of the box and the lid. That tests the real fit in a fraction of the time and filament.
Written by 3D Calculators Team· Published · Figures last checked
Sources
- QIDI, 3D Printed Interlocking Parts: Clearance & Fit Guide (accessed 2026-10-26)
- Sovol, 3D Printed Snap-Fit Joints: How to Design Clips That Work (accessed 2026-10-26)
- Protolabs Hubs, How do you design enclosures for 3D printing? (accessed 2026-10-26)
- Protolabs Hubs, How do you design snap-fit joints for 3D printing? (accessed 2026-10-26)
- Prusa Knowledge Base, Modeling with 3D printing in mind (perimeter widths and overhangs) (accessed 2026-10-26)
- Bayer MaterialScience (now Covestro), Snap-Fit Joints for Plastics: A Design Guide (copy hosted by SparkFun) (accessed 2026-10-26)
- Formlabs, How to Design and 3D Print Snap-Fit Joints for Enclosures, Boxes, Lids, and More (accessed 2026-10-26)
- UAL Creative Computing Institute wiki, Design the clearance and tolerance (accessed 2026-10-26)
- Espressif, ESP32-DevKitC V4 user guide (accessed 2026-10-26)
- Espressif, ESP32-DevKitC V4 dimensions drawing (PDF) (accessed 2026-10-26)
- Espressif, ESP32-WROOM-32E and ESP32-WROOM-32UE datasheet v2.1 (module dimensions) (accessed 2026-10-26)
- JLCPCB, PCB Thickness Guide: Standard Layers, Impedance and JLCPCB Capabilities (accessed 2026-10-26)
- JLCPCB, PCB manufacturing capabilities (board thickness tolerance) (accessed 2026-10-26)
- Raspberry Pi Ltd, Raspberry Pi 4 Model B mechanical drawing (accessed 2026-10-26)
- Würth Industrie Service, DINO technical part, chapter 9: Direct screwing into plastics and metal (accessed 2026-10-26)
- Bureau of Indian Standards, IS 1821:1987 Dimensions for clearance holes for bolts and screws, identical with ISO 273:1979 (Public.Resource.Org copy) (accessed 2026-10-26)