wobblyhead hg > 3dprints > hinged_box
annotate README.md @ 11:7bef1d0cb914 default tip
updated defaults, added render shell script
| author | ark |
|---|---|
| date | 2026-11-18 02:35 +0100 |
| parents | a7a1b12fd6bf |
| children |
| 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 |
|
10
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
4 latch at the front. Further latches can go on the left and right sides, |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
5 and a latch can replace the hinge for a removable lid. The box is sized |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
6 by its inner dimensions. The default of 92 x 92 x 92 mm holds a stack of |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
7 90 mm notepad paper standing on edge. |
| 0 | 8 |
| 9 See also https://www.wobblyhead.net/projects/hinged_box.html | |
| 10 | |
| 3 | 11 ## Design |
| 12 | |
|
10
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
13 The box has three printed parts: body, lid and latch, plus one more |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
14 latch for each further latched side. Pieces of filament serve as pins: |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
15 one for the hinge and two for each latch. |
| 3 | 16 |
| 17 The body is the lower part. The inner part of its wall rises above the | |
| 18 seam as a lip, which fits into a recess in the lid and keeps the lid in | |
| 19 place when closed. | |
| 20 | |
| 21 Body and lid share a row of hinge knuckles at the back, with the outer | |
|
10
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
22 ones on the body. One filament pin runs through all of them. With a |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
23 latch at the back instead, the lid has no hinge and comes off once all |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
24 latches are open. |
| 3 | 25 |
|
10
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
26 Each latch hangs from two lid knuckles on a pin of its own. Two body knuckles |
|
8
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
27 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
|
28 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
|
29 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
|
30 the latch snaps over the bar when closed. |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
31 |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
32 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
|
33 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
|
34 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
|
35 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
|
36 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
|
37 rounded and sloped profile as the body knuckles. It reaches from the |
|
10
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
38 latch knuckle down past the hook, and its back lies along the box face. |
|
8
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
39 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
|
40 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
|
41 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
|
42 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
|
43 The block prints standing on its side. |
| 3 | 44 |
| 45 Wall, floor and knuckle sizes are set in extrusions and layers. The model | |
| 46 converts them with the line width and layer height from the print | |
| 47 settings. | |
| 48 | |
| 49 ## Use | |
| 50 | |
| 11 | 51 Open `main.scad` in OpenSCAD and set the parameters in the Customizer. |
| 52 Several presets are stored in `main.json`. | |
| 3 | 53 |
| 54 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
|
55 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
|
56 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
|
57 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
|
58 anything else. |
| 3 | 59 |
| 60 The console lists the derived sizes: wall thickness, outer size, body and | |
| 61 lid height, pin hole diameter, knuckle length, latch detent and the | |
| 6 | 62 clearance of the lid over the content when it opens. The last echo |
| 3 | 63 line is a file name that encodes the main parameters, for example |
| 11 | 64 `hinged_box_w920d920h920b85_lw40lh20`. The inner sizes are given in |
| 65 tenths of a millimetre. With a single part selected, the name includes | |
| 66 the part, as in `hinged_box_lid_w920d920h920b85_lw40lh20`. The latch | |
| 67 name adds its style: `plate`, `plate-middle` or `block`, as in | |
| 68 `hinged_box_latch_block_w920d920h920b85_lw40lh20`. A box with more than | |
| 69 one cell adds the column and row count, as in | |
| 70 `hinged_box_c3r2_w920d920h920b85_lw40lh20`. A latch middle share other | |
| 71 than .33 adds `lm` and the share in percent after the body ratio, as in | |
| 72 `hinged_box_w920d920h920b85lm50_lw40lh20`. A latch layout other than a | |
|
10
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
73 front latch with the back hinge adds `l` and the latched sides, from |
| 11 | 74 front, back, left and right, as in |
| 75 `hinged_box_lfblr_w920d920h920b85_lw40lh20` for a removable lid latched | |
| 76 on all four sides. | |
| 3 | 77 |
|
10
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
78 After printing, push filament through the hinge knuckles, and the latch |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
79 and bar knuckles of each latched side. The pin holes are the filament |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
80 diameter plus clearance on each side. |
| 3 | 81 |
| 82 ## Main parameters | |
| 83 | |
| 84 The Customizer comments describe every parameter, including edge radius, | |
| 85 lip size, chamfer and the preview options. The ones below set the box. | |
| 86 | |
| 87 `inner_depth`, `inner_width` and `inner_height` give the inner size in mm, | |
| 88 front to back, left to right and floor to lid ceiling. For a paper stack, | |
| 89 `inner_width` is the thickness of the stack. | |
| 90 | |
| 6 | 91 `columns` and `rows` divide the body into cells, columns left to right and |
| 92 rows front to back as seen from the top front. `inner_width` and | |
| 93 `inner_depth` are then the size of one cell, and the box grows by the | |
| 94 cells and the divider walls between them. The dividers are | |
| 95 `divider_lines` extrusions thick and reach from the floor to the top of | |
| 96 the lip. The preview mockup puts the content in each cell, and the lid | |
| 97 sweep check uses the front row. | |
| 98 | |
| 99 `content_depth`, `content_width` and `content_height` give the size of | |
| 100 what goes into one cell, such as a paper stack. The preview mockup shows | |
| 101 it with `preview_content`, and the lid sweep check uses depth and height. | |
| 102 Nothing else uses them. A size larger than the cell or the inner height | |
| 103 is reduced to fit, and the console prints a warning with the size | |
| 104 actually used. | |
| 105 | |
| 3 | 106 `body_ratio` is the share of the inner height taken by the body. The lid |
| 107 needs enough height for the latch knuckles and the lip recess. If the | |
| 108 ratio leaves less, the body is made lower and the console prints a | |
| 109 warning with the ratio actually used. | |
| 110 | |
| 111 Walls are `wall_lines` extrusions thick. Floor and lid top are | |
| 112 `floor_layers` layers. | |
| 113 | |
| 114 For the hinge, set `filament_diameter` to the filament used for pins and | |
| 115 bar. `hinge_knuckles` is the number of hinge knuckles, an odd number. | |
| 116 | |
|
10
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
117 `back_side` puts the hinge or a latch on the back. `latch_front`, |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
118 `latch_left` and `latch_right` add latches on the other sides, left and |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
119 right as seen from the front. Without the hinge, the lid sweep check is |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
120 left out. With the hinge, open the side latches before opening the lid. |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
121 |
|
8
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
122 `latch_style` selects the plate or the block latch. `latch_width` is the |
|
10
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
123 width of the latches in mm, the same for all of them. If it is wider |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
124 than the narrowest latched face, all latches are narrowed to fit and the |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
125 console prints a warning with the width actually used. The console also |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
126 gives the number of latches to print. `latch_middle_ratio` is the share |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
127 of that width taken by the middle slot with the latch knuckle; the two |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
128 outer slots share the rest. A ratio that leaves any slot narrower than |
|
a7a1b12fd6bf
latch: latches on any side, back latch for a removable lid
ark
parents:
8
diff
changeset
|
129 two extrusions is clamped, with a warning. |
|
8
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
130 |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
131 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
|
132 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
|
133 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
|
134 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
|
135 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
|
136 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
|
137 |
|
ac8f2ecb6c18
latch: block style, middle knuckle share, middle-width plate
ark
parents:
6
diff
changeset
|
138 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
|
139 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
|
140 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
|
141 larger of `latch_hook_lines` and `hinge_lines`. |
| 3 | 142 |
| 143 `line_width` and `layer_height` are the extrusion width and layer height | |
| 144 the walls are built from. `clearance` is the gap between moving parts and | |
| 145 around the pins. | |
| 146 | |
| 147 ## Checks | |
| 148 | |
| 149 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
|
150 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
|
151 the inner height leaves no room for the body. |
