Goal#
Create a small project box for a 60 mm x 40 mm circuit board, with a base, a lid, four PCB standoffs, a USB-style cutout on one short wall and two cantilever snap hooks that let the lid click on and off without screws. The outside is about 66.6 mm x 46.6 mm (the parameters below drive it) and 22 mm tall when closed: the base is 20 mm tall and the lid is 5 mm tall, a 2 mm plate plus a 3 mm rim that overlaps the top of the base. The design is for FDM printing in PLA, PETG or ABS, and every critical clearance is a named parameter so you can retune it for your own printer.
If your board is different, change four parameters and the whole box regenerates. That is the real lesson of this tutorial: build the box around parameters, not around constants.
What you'll learn#
- Planning a two-part enclosure as two components in one design.
- Using shell versus extruding walls, and why shell is the better first move for a box.
- Building a lip and groove so lid and base register to each other.
- Designing a cantilever snap hook with correct length, thickness, and lead-in angle.
- Placing standoffs from a sketch and mirroring features.
- Creating connector cutouts that follow the board position.
- Checking fit with Interference analysis and a section view.
- Printing orientation and tolerance advice.
Prerequisites#
- Tutorial 1 (parameters, sketches, extrude, fillet).
- Basic idea of components and joints from the Components and Assemblies section.
- A printer with 0.4 mm nozzle (the numbers assume it).
Parameters#
Open Modify > Change Parameters and create these user parameters. Spaces in names are not allowed, so use underscores.
| Name | Value | Purpose |
|---|---|---|
pcb_l | 60 mm | PCB length |
pcb_w | 40 mm | PCB width |
pcb_t | 1.6 mm | PCB thickness |
wall | 2 mm | Wall thickness |
clear | 0.3 mm | Gap on each side between PCB and wall |
fit | 0.2 mm | Print clearance between lid and base mating faces |
base_h | 20 mm | Base height |
lid_h | wall + 3 mm (5 mm) | Lid plate plus rim height |
stand_h | 5 mm | Standoff height |
stand_d | 6 mm | Standoff outer diameter |
screw_d | 2.5 mm | Pilot hole for M3 self-tapping screws, or 2.2 for heat-set (verify for your insert) |
in_l | pcb_l + 2*clear | Inner cavity length |
in_w | pcb_w + 2*clear | Inner cavity width |
out_l | in_l + 2*wall | Outer length (about 66.6 mm) |
out_w | in_w + 2*wall | Outer width (about 46.6 mm) |
With these values the outer size is 66.6 x 46.6 mm; the parameter-driven result is authoritative.
Steps#
Part A: Base body#
- Create the design. File > New Design, save as
Enclosure. Enter the parameters above. - Make components. Right-click the root in the browser, choose New Component, name it
Base, and keep Activate selected. Later you will addLidthe same way. Working in separate components lets you move and joint them independently. See Components vs Bodies. - Sketch the outer outline. Create a sketch on XY. Choose Create > Rectangle > Center Rectangle (R is the 2-Point Rectangle). Click the origin, then drag out, and type
out_landout_w. Press Tab between fields. - Corner radius. Use the sketch Fillet tool. Set each of the four corners to 4 mm. Constrain with one radius and set the others Equal.
- Extrude. Press E, distance
base_h, Operation New Body (or Join inside the component). OK. - Shell. Choose Modify > Shell. Select the top face, set Inside Thickness to
walland the direction to Inside. OK. The box now has a floor and four walls of 2 mm. Shell is robust because it follows later changes to outer shape. - Floor check. The floor equals
wallas well. If you want a thicker floor (3 mm), change it later with Press Pull on the inner floor face.
Part B: Lip for the lid#
- Sketch the lip step. The lip is a thin ridge that sits inside the lid rim. Select the top face of the wall and sketch. Use Offset (O) on the inside edge of the wall loop with an offset of
wall/2. The offset curves are 1 mm into the wall. - Cut the outer half. Select the region between the outer wall edge and the new loop. Extrude Cut with distance 3 mm downwards. The wall now has a stepped top: inner half stays tall, outer half is lowered 3 mm. This is the lip that registers the lid.
- Add clearance. The lid groove will be made
fitlarger, so you do not add clearance here.
Part C: Standoffs and screw pilot#
- Mark board position. Create a sketch on the floor top (the inside bottom face). Draw a Center Rectangle
pcb_lxpcb_wfrom the origin and convert it to construction geometry (X toggles construction for the selected geometry). The floor top is at Z =wall(2 mm). - Place four points. Assume the board's mounting holes are 3.5 mm in from each corner (check your board). Draw four points and dimension each to the corner of the construction rectangle: 3.5 mm in both directions (the points land at X = +/-26.5 mm, Y = +/-16.5 mm). Use Mirror for the other corners.
- Draw circles. Create > Circle > Center Diameter at each point with diameter
stand_d. - Extrude standoffs. Press E, select the four circles, distance
stand_h, Operation Join. Then add holes: press H, Placement From Sketch, select the points on the standoff tops, diameterscrew_d, depth 4 mm (the standoff is 5 mm tall on a 2 mm floor, so a deeper hole would break through the floor). - Fillet the standoff roots. Press F, select the bottom circular edges, radius 0.8 mm. This reduces stress concentration at the standoff roots.
Part D: Connector cutout#
- Sketch on the outer short wall. Choose the outside face at the -X end. Create a sketch.
- Draw the opening. A micro-USB port is about 8 mm wide and 3 mm tall; leave extra: rectangle 12 mm x 7 mm. The PCB top surface is
wall + stand_h + pcb_t(8.6 mm) above the outer bottom edge. Constrain the bottom of the rectangle towall + stand_h + pcb_t - 1 mm(7.6 mm), so the opening starts 1 mm below the PCB top surface and extends 7 mm above that line. Center it horizontally on the face or offset by the real port location. - Cut. Extrude Cut through the wall, Extent
wall + 1 mmor To Object (the inner cavity).
Part E: Snap-fit hooks in the lid#
The hooks live on the lid. Two hooks go on the long sides so the lid flexes along its short span.
- Create the Lid component. Activate the root, New Component named
Lid. - Lid plate. Sketch on a plane at the top of the base: use Offset Plane at distance
base_hfrom XY (Construct > Offset Plane). Draw the same rounded rectangle (out_l,out_w, radius 4 mm). Extrude upwardwallas New Body inside Lid. - Rim. On the lid underside, sketch an offset loop inward from the outline by
wall/2 - fit(0.8 mm). The band between the outline and this loop is the rim: it hangs from the plate underside and sits over the lowered outer half of the base lip (the tall inner half, 1 mm thick, staysfitclear of it). Select that band and extrude it 3 mm downward (the depth of the lip step) with Operation Join. - Hook geometry. The cantilever hook sketch is drawn on the XZ plane (side view). Dimensions (general snap-fit guidance, not Autodesk data): arm thickness 1.2 mm, arm length 10 mm, hook protrusion 0.8 mm, lead-in angle 30 degrees, return face 90 degrees (flat) for strong retention. Draw this as a closed profile: arm rectangle 1.2 x 10, plus a triangular barb at the free end.
- Position. Locate the arm hanging from the plate underside, just inside the base's inner wall face (leave
fitclearance) and centered along the long wall, with the barb pointing outward. Width of the arm 8 mm (extrude the profile 8 mm symmetric). - Join and mirror. Use Create > Mirror (Pattern Type Features) on the hook about the XZ plane to put a hook on the opposite long side. Add a second pair near each end if you want four (parameters: positions at +/-18 mm).
- Catch windows in the base. Back in Base, sketch on the outer long wall and cut a rectangular window 9 mm wide and 1.4 mm tall at the height where the barb lands when the lid is seated: the barb is at the free end of the 10 mm arm, so the window bottom is at
base_h - 10 mm(10 mm above the outer bottom); check with a section. Cut depthwall(through the wall thickness only).
Part F: Fit check#
- Assemble. The lid body was built in place, so its position already matches. Use Inspect > Interference with both components selected. Expect zero interference; if the barb intersects the wall, check the position of the catch windows.
- Section analysis. Inspect > Section Analysis through the long side (a plane normal to Y). You should see a gap of
fitall around the rim. - Appearance. Assign a matte plastic appearance in two colors (for example black for the base and white for the lid) for readability.
Checkpoints#
- With
pcb_lchanged to 70 mm, both components resize and the standoffs stay on the corners; if they do not, your standoff points were dimensioned from the wrong reference. - Hook arm thickness at the root: 1.2 mm. Strain check (general engineering guidance): for a cantilever the permissible deflection is roughly
0.67 * strain_limit * L^2 / t; for PETG with a 2 percent limit, 10 mm length, 1.2 mm thickness this gives 1.1 mm, comfortably above the 0.8 mm barb. Verify numbers against your material. - Interference result is empty.
- The USB cutout aligns with the board when you place a 1.6 mm slab (a fake PCB) on the standoffs.
Printing notes#
- Print the base open side up and the lid with its plate on the bed so hooks print vertically as seen in the Z direction: the arm layers run along its length, which maximizes strength. If hooks print with layer lines across the arm they snap at the root.
- Use 3 perimeters and 30 percent infill.
- Print at 0.2 mm layer height; clearance
fitof 0.2 mm works on tuned printers. If the lid is tight, increasefitto 0.3 mm and regenerate.
Variations#
- Replace snap hooks with two screw bosses in the lid.
- Add ventilation slots: a 1.5 mm x 12 mm slot pattern using Rectangular Pattern.
- Add an LED light pipe: a 3 mm hole in the lid with a 0.8 mm counterbore.
- Add a label recess: Emboss or a 0.4 mm deep cut for a sticker.
- Make an injection-mold version using draft 1.5 degrees and uniform 2 mm wall; see the plastic rules page.
Troubleshooting#
| Symptom | Cause | Fix |
|---|---|---|
| Shell fails | Face selected is open or fillets too tight | Reduce corner radius or shell thickness |
| Hooks snap while assembling | Too thick or too short | Raise arm length or reduce thickness |
| Hooks too loose | Barb protrusion small | Raise to 1.0 mm |
| Cutout misses the port | Wrong datum for height | Measure from the board top, not the base floor |
| Components move as one | Both bodies in same component | Move each body into its own component with drag and drop |
| Parameters show red | Unit missing | Add mm after numbers |
Related#
- Lip, Groove and Snap Fit explains the hook formulas in more depth.
- Shell, Draft and Scale describes shell options.
- Mirror and Patterns for placing hooks.
- Tutorial 7 builds a PCB-aware version of this enclosure.