wobblyhead hg > 3dprints > hinged_box
annotate README.md @ 8:ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
Add latch_style with a new block latch: a solid piece in the middle slot
with the profile of the body knuckles, extended below the hook by
latch_grip. Between knuckle and hook only the knuckle ring and the front
wall remain; below the bar the opening follows the hook tip line to the
back face. A notch at the bottom of the back face takes a fingernail.
Add latch_middle_ratio for the share of the latch width taken by the
middle knuckle, clamped with a warning so no slot is narrower than two
extrusions.
Add latch_plate_full. Without it the plate is only as wide as the middle
slot, and the latch exports standing on its side with the plate
thickness rounded up to whole extrusions. The block also prints on its
side.
The latch file name gets the style, and all names get the middle share
when it is not .33. Extrude slabs with convexity 4 so the preview shows
the block profile correctly. README updated.
| author | ark |
|---|---|
| date | 2026-11-17 12:32 +0100 |
| parents | f2694e49cec1 |
| children | a7a1b12fd6bf |
| rev | line source |
|---|---|
| 3 | 1 # Hinged box |
| 0 | 2 |
| 3 | 3 A parametric OpenSCAD box with a filament hinge at the back and a hinged |
| 4 latch at the front. The box is sized by its inner dimensions. The default | |
| 5 of 92 x 92 x 92 mm holds a stack of 90 mm notepad paper standing on edge. | |
| 0 | 6 |
| 7 See also https://www.wobblyhead.net/projects/hinged_box.html | |
| 8 | |
| 3 | 9 ## Design |
| 10 | |
| 11 The box has three printed parts: body, lid and latch. Three pieces of | |
| 12 filament serve as pins. | |
| 13 | |
| 14 The body is the lower part. The inner part of its wall rises above the | |
| 15 seam as a lip, which fits into a recess in the lid and keeps the lid in | |
| 16 place when closed. | |
| 17 | |
| 18 Body and lid share a row of hinge knuckles at the back, with the outer | |
| 19 ones on the body. One filament pin runs through all of them. | |
| 20 | |
| 21 The latch hangs from two lid knuckles on a second pin. Two body knuckles | |
|
8
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
22 below it hold the third piece of filament as a bar. The latch itself |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
23 sits in the slot between these knuckles. The hook at the bottom of the |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
24 latch wraps around this bar, and its tip reaches slightly past it, so |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
25 the latch snaps over the bar when closed. |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
26 |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
27 The latch comes in two styles. The plate style joins knuckle and hook |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
28 with a plate in front of the outer knuckles, and a grip tab below the |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
29 hook gives a finger hold. The plate either spans the full latch width |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
30 and prints flat, or is only as wide as the middle slot and prints |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
31 standing on its side. The block style is a solid piece with the same |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
32 rounded and sloped profile as the body knuckles. It reaches from the |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
33 latch knuckle down past the hook, and its back lies along the box front. |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
34 Between knuckle and hook, only the knuckle ring and the front wall |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
35 remain. Below the bar, the cut-out on the wall side runs from the hook |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
36 tip straight down to the back face, so the bar can leave when the latch |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
37 opens. A notch at the bottom edge of the back face takes a fingernail. |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
38 The block prints standing on its side. |
| 3 | 39 |
| 40 Wall, floor and knuckle sizes are set in extrusions and layers. The model | |
| 41 converts them with the line width and layer height from the print | |
| 42 settings. | |
| 43 | |
| 44 ## Use | |
| 45 | |
| 46 Open `main.scad` in OpenSCAD and set the parameters in the Customizer. Two | |
| 47 presets are stored in `main.json`: "cardbox 45" and "calling cards box". | |
| 48 | |
| 49 Select the part to export with the `part` setting. For export, the lid is | |
|
8
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
50 turned upside down, and the latch is laid flat or stood on its side as |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
51 its style needs, both ready to print. The body prints as it stands. All |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
52 parts use the same parameters, so export all three without changing |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
53 anything else. |
| 3 | 54 |
| 55 The console lists the derived sizes: wall thickness, outer size, body and | |
| 56 lid height, pin hole diameter, knuckle length, latch detent and the | |
| 6 | 57 clearance of the lid over the content when it opens. The last echo |
| 3 | 58 line is a file name that encodes the main parameters, for example |
| 59 `hinged_box_w92d92h92b85_lw40lh20`. With a single part selected, the name | |
|
8
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
60 includes the part, as in `hinged_box_lid_w92d92h92b85_lw40lh20`. The |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
61 latch name adds its style: `plate`, `plate-middle` or `block`, as in |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
62 `hinged_box_latch_block_w92d92h92b85_lw40lh20`. A box with more than one |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
63 cell adds the column and row count, as in |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
64 `hinged_box_c3r2_w92d92h92b85_lw40lh20`. A latch middle share other than |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
65 .33 adds `lm` and the share in percent after the body ratio, as in |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
66 `hinged_box_w92d92h92b85lm50_lw40lh20`. |
| 3 | 67 |
| 68 After printing, push filament through the hinge knuckles, the latch | |
| 69 knuckles and the bar knuckles. The pin holes are the filament diameter | |
| 70 plus clearance on each side. | |
| 71 | |
| 72 ## Main parameters | |
| 73 | |
| 74 The Customizer comments describe every parameter, including edge radius, | |
| 75 lip size, chamfer and the preview options. The ones below set the box. | |
| 76 | |
| 77 `inner_depth`, `inner_width` and `inner_height` give the inner size in mm, | |
| 78 front to back, left to right and floor to lid ceiling. For a paper stack, | |
| 79 `inner_width` is the thickness of the stack. | |
| 80 | |
| 6 | 81 `columns` and `rows` divide the body into cells, columns left to right and |
| 82 rows front to back as seen from the top front. `inner_width` and | |
| 83 `inner_depth` are then the size of one cell, and the box grows by the | |
| 84 cells and the divider walls between them. The dividers are | |
| 85 `divider_lines` extrusions thick and reach from the floor to the top of | |
| 86 the lip. The preview mockup puts the content in each cell, and the lid | |
| 87 sweep check uses the front row. | |
| 88 | |
| 89 `content_depth`, `content_width` and `content_height` give the size of | |
| 90 what goes into one cell, such as a paper stack. The preview mockup shows | |
| 91 it with `preview_content`, and the lid sweep check uses depth and height. | |
| 92 Nothing else uses them. A size larger than the cell or the inner height | |
| 93 is reduced to fit, and the console prints a warning with the size | |
| 94 actually used. | |
| 95 | |
| 3 | 96 `body_ratio` is the share of the inner height taken by the body. The lid |
| 97 needs enough height for the latch knuckles and the lip recess. If the | |
| 98 ratio leaves less, the body is made lower and the console prints a | |
| 99 warning with the ratio actually used. | |
| 100 | |
| 101 Walls are `wall_lines` extrusions thick. Floor and lid top are | |
| 102 `floor_layers` layers. | |
| 103 | |
| 104 For the hinge, set `filament_diameter` to the filament used for pins and | |
| 105 bar. `hinge_knuckles` is the number of hinge knuckles, an odd number. | |
| 106 | |
|
8
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
107 `latch_style` selects the plate or the block latch. `latch_width` is the |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
108 width of the latch in mm. If it is wider than the hinge span, the latch |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
109 is narrowed to the span and the console prints a warning with the width |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
110 actually used. `latch_middle_ratio` is the share of that width taken by |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
111 the middle slot with the latch knuckle; the two outer slots share the |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
112 rest. A ratio that leaves any slot narrower than two extrusions is |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
113 clamped, with a warning. |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
114 |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
115 For the plate style, `latch_plate_full` makes the plate span the full |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
116 latch width, printed flat. Without it, the plate is as wide as the |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
117 middle slot and the latch prints on its side. `latch_layers` sets the |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
118 plate thickness in layers. On its side, that thickness is rounded up to |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
119 whole extrusions. `latch_grip` is the length of the grip tab below the |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
120 hook, or for the block style, how far the block reaches below the hook. |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
121 |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
122 The hook tip has to pass `latch_detent` mm of overlap at the bar. With 0 |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
123 the latch swings freely. `latch_hook_lines` sets the hook wall around |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
124 the bar in extrusions. On the block, the wall in front of the bar is the |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
125 larger of `latch_hook_lines` and `hinge_lines`. |
| 3 | 126 |
| 127 `line_width` and `layer_height` are the extrusion width and layer height | |
| 128 the walls are built from. `clearance` is the gap between moving parts and | |
| 129 around the pins. | |
| 130 | |
| 131 ## Checks | |
| 132 | |
| 133 The model stops with an error if the hinge knuckles get too short, the | |
|
5
fdd022a1bfb1
reworked latch hook reinforcement, now a simple line count
ark
parents:
4
diff
changeset
|
134 detent is too large for the bar, the chamfer is higher than the floor, or |
|
fdd022a1bfb1
reworked latch hook reinforcement, now a simple line count
ark
parents:
4
diff
changeset
|
135 the inner height leaves no room for the body. |
