Print a snap-fit electronics enclosure
ActivitiesProjects
Print a box and lid that click together repeatedly while leaving the cable opening clear.
Making a snap-fit electronics enclosure means building a custom two-part shell around a real circuit board, with built-in catches that hold the halves together. A snap-fit closure can be designed for repeated opening, though whether it releases depends on the catch geometry and release force. Before anything goes to the printer, the work starts with calipers and a CAD model: the finished housing has to clear every component on the board and line up cleanly with every port.
Measuring the board and planning clearances
Start by measuring the board and its tallest parts, then build a simple CAD stand-in using basic box shapes for the components. Modeling the space the electronics actually occupy lets you wrap the bottom and top shells around the board and spot collisions before you print.
Leave room around the assembly and cut openings for connectors with enough space for the plug body, not just the port itself. General enclosure starting points are a minimum wall thickness of 2 mm, 0.5 mm of clearance around internal components, and 2 mm of total clearance at ports (1 mm on each side). Those figures are starting points for the shell rather than universal rules or snap-hook clearances—the right allowance depends on your printer technology, calibration, and the actual board and plugs in front of you.
Cantilever catches and alignment lugs
A common way to lock the two halves together is a cantilever snap: a flexible arm with a projecting catch at its free end. When you press the halves closed, the arm bends past the mating feature and springs back toward its resting shape, engaging the catch inside an internal cavity. Internal catches can sit on opposite sides of the shell, though PCB pins can limit the room available for the joints.
How easily the enclosure comes back apart depends on the shape of the catch's undercut and the force required to flex the arm. Snap dimensions are specific to each layout rather than a universal formula; in one illustrated enclosure, each side uses a 20 mm-long cantilever with a 1.2 mm engagement protrusion, with 2 mm or more noted as a firmer lock where interior space allows.
Keep alignment separate from latching. Adding small lugs—short tabs that slide inside the mating half—locates the two pieces and limits sideways movement, leaving the catches to hold the halves closed.
Material, orientation, testing, and finishing
A latch geometry that flexes well in one material may need adjustment in another, so the tab dimensions and print material have to be chosen together. If you plan to open the enclosure often, pick a wear-resistant material; a case that stays closed most of the time puts less wear demand on the joint. On a fused deposition modeling (FDM) printer, part strength depends on print direction, so orienting the halves to keep the flexing tabs strong across the XY plane rather than along the Z axis is a key slicing decision.
Because no single set of snap-fit dimensions fits every material, joint size, and use case, the practical way to dial in the closure is to print a prototype using your intended process and material, test how it snaps shut and releases, and adjust the model if the fit is off.
Finishing steps depend on the printing process and can change how tightly the halves mate. Stereolithography (SLA) prints may require removing supports, washing, and curing, while selective laser sintering (SLS) parts need loose powder cleared out and may be media blasted or polished. Coatings and other post-processing can shift tolerances enough to alter a snap joint, so check the final fit after all finishing is done.
