Snap-fit parametric box
tolerance-driven plastic-part design
Tolerance-driven snap features: wedges on the box wall, dimples in the lid skirt.
What it is
A tray-style box with a press-on lid. The box has small wedge protrusions on its long walls; the lid’s downward skirt has matching dimples cut into its inner face. With the lid closed (lidLifted = 0), the wedges sit inside the dimples. With the lid lifted, the parts separate so the snap features are visible.
Why visual feedback matters
Snap-fit design is all tolerance. clearance between the box outer wall and the lid skirt inner wall determines whether the lid jams, snaps cleanly, or rattles. Wedge depth and dimple depth set the engagement force. None of this is intuitable from numbers in a table — render-and-twiddle is the design loop.
Screenshots
Exploded view shows the wedge on the box’s long wall (bump near the top of the box’s front face) and the matching dimple on the inside of the lid’s skirt.
Parameters
Parameters 12
| Name | Default | Description |
|---|---|---|
width | — mm | Outer box width. |
depth | — mm | Outer box depth. |
height | — mm | Outer box height. |
wallThickness | — mm | Box wall thickness. |
floorThickness | — mm | Floor thickness. |
lidThickness | — mm | Lid top thickness. |
lidSkirtHeight | — mm | How far down the lid skirt extends. |
snapZ | — mm | Wedge height above floor. |
snapWidth | — mm | Wedge along-wall width. |
snapDepth | — mm | Wedge protrusion depth. |
clearance | — mm | Radial gap between box outer wall and lid skirt. |
lidLifted | — mm | Z offset for the exploded view (0 = closed). |
Try it
- Open in your browser → openjscad.xyz, bundled single-file
- Source on GitHub →
- Full walkthrough on GitHub →