One killer application for 3D printing is building enclosures for electronics prototypes. Many hobbyists use tools like TinkerCAD to build simple project boxes that are held together using screws.
A more elegant solution is to use snapfit enclosures that consist of two parts that can be snapped together with a satisfying click and without the need for additional parts or tools. Depending on how these snap-fits are designed, pulling the parts apart can be very easy to next to impossible.
- The part must not be under stress after being snapped together. PLA slowly deforms over time if it is under pressure for a prolonged period of time. Hence avoid "friction fits" where to parts are joined simply due to the friction betwee them
- Always use clearance, at least in x and y dimensions. 0.1mm for a well-tuned FDM printer to 0.2mm for larger nozzles and/or faster printing situations
- Never type in any numbers for dimensions directly, always make a habit of using variables. This makes your design consistent and configurable
- Remember three shortcuts that are huge time-savers in Onshape: s to bring up a context menu with the most commonly used tools next to the mouse pointer, n to rotate the workspace normal to the selected sketch or surface, and Alt+c to search for tools by name
- Click "Create" and create a new document
- Create a Sketch by pressing s, clicking on the first icon, and clicking on the Top plane. Press n to make the view normal to that plane. Press r and draw a corner point rectangle by clicking on the center point, then dragging outward. Enter
#x
and press Enter to create a new variable calledx
. As the value, enter40
. Press Enter three times. Repeat for#y
with value30
. Make sure the sketch is black; if it is blue, then something is unconstrained (random). Confirm the sketch with the green checkmark. - Extrude by pressing s, clicking on the second icon, clicking on the rectangle. Enter
#z
with a value20
. Select "symmetric". Confirm with the green checkmark. - Split the shape by pressing Alt+c, typing
split
, Enter, clicking on the body, clicking on "Entity to split with", clicking on the Top plane. Confirm with the green checkmark. - Hide Part 2.
- Extrude the top face of the lower half by pressing s, clicking on the second icon, and clicking on the top surface of the lower half. Enter
#shell*3
as the value for Depth, with#shell
having the value of0.8
(twice the nozzle size). Confirm with the green checkmark. - Fillet all edges of the upper and the lower part by pressing s, clicking on the first icon in the lower row, and then each relevant edge. Unhide Part 1 to apply the fillets there, too. As the Radius enter
#radius
with a value of2
. Confirm with the green checkmark. - Hide Part 2 again.
- Shell the part by pressing Alt+c, typing
shell
, Enter, clicking on the underside of the upper part, and entering#shell
as the Shell Thickness. Confirm with the green checkmark. - Create a Sketch by pressing s, clicking on the first icon, and clicking on the longer vertical inner side of the top part. Press n to make the view normal to that plane. Press r and draw a corner point rectangle by clicking on the center point of the bottom edge, then dragging outward. Enter
#x/2
and press Enter. Enter#shell*4
and press Enter. Confirm with the green checkmark. - Extrude the top one of the resulting rectangles by pressing s, clicking on the second icon, and clicking on the top rectangle. Select "New", check "Draft", Click on the rotation symbol so it changes to counter-clickwise, enter 45 for the degrees. Confirm with the green checkmark.
- Mirror the snap we just created by pressing Alt+c, typing
mirror
, Enter, clicking on the snap, clicking on "Mirror plane", cliking on the Front plane. Confirm with the green checkmark. - Perform a Boolean operation by by pressing Alt+c, typing
bool
, Enter, clicking on "Subtract", clicking on the top part, clicking on "Targets", clicking on "Part 1" in the sidebar, checking "Offset", "Offset all", and "Keep tools". Enter#clearance
under "Offset distance" with a value of0.1
. Confirm with the green checkmark. - Hide Part 2, show Part 1 (the lower part).
- Shell the part by pressing Alt+c, typing
shell
, Enter, clicking on the top side of the lower part, and entering#shell
as the Shell Thickness. Confirm with the green checkmark. - Richt-click on the underside of the lower part, select "Section view..." and move the arrow a bit to the inside of the box so that you don't see the bottom shell anymore. Confirm with the green checkmark.
- Apply a Chamfer to the part that would be unprintable due to overhangs by pressing s, clicking on the second icon in the second row, and clicking on the edge betwee the wall and the overhanging surface. Unter "Distance" enter
#shell+#clearance
. Confirm with the green checkmark. - Since we don't need the clearance in z direction, Extrude the outer section of the lower part by pressing s, clicking on the second icon, and clicking on the outer section of the lower part. Enter
#clearance
under "Depth". Confirm with the green checkmark. - Apply a Chamfer to the outer side of the lip by pressing s, clicking on the second icon in the second row, and clicking on the outer side of the lip. Unter "Distance" enter
#shell/2
. Confirm with the green checkmark.
Done!
Now, to bring a PCB into the box, switch to the "Assembly 1" tab and import a PCB, e.g., a NodeMCU board. Also bring in the two parts we created above. Join them together in a suitable way. The details of this still need to be written down.
Use "Edit in place" to adjust the enclosure until it fits the PCB perfectly. Don't forget to use #clearance
.
Great instructions, thank you! I printed this on an Ender 3v2 in PLA and the top fits fairly loosely to the bottom. Any suggestions for improving how tight the "snap" is?