|
0
|
1 # House number
|
|
|
2
|
|
2
|
3 3D-printed house numbers, or any other text, to fix to a wall. Each glyph
|
|
0
|
4 is a separate flat piece with two countersunk screw holes. Distance washers
|
|
2
|
5 behind the holes keep it off the wall and take up unevenness. Instead of
|
|
|
6 screws, magnets pressed into the washers can hold the glyph. The glyphs
|
|
0
|
7 print face down. A two-colour look with an outline band is possible on a
|
|
|
8 single-colour printer by changing filament once.
|
|
|
9
|
|
|
10 The work is split in three steps:
|
|
|
11
|
|
|
12 1. `make_preview.py` renders the text in every installed font, to choose
|
|
|
13 one.
|
|
|
14 2. `make_glyphs.py` turns the text in the chosen font into glyph outlines,
|
|
|
15 works out the largest printable size and places the screw holes.
|
|
|
16 3. `main.scad` builds the printable parts in OpenSCAD, and a drilling
|
|
|
17 template, which `make_template.py` splits into printable pages.
|
|
|
18
|
|
|
19 ## Requirements
|
|
|
20
|
|
|
21 - Python 3 with fontTools, Pillow and numpy. `make_template.py` needs only
|
|
|
22 the standard library.
|
|
|
23 - fontconfig's `fc-list`, which the scripts use to find fonts.
|
|
|
24 - An OpenSCAD development snapshot. The model uses features newer than the
|
|
|
25 2021.01 release.
|
|
|
26
|
|
|
27 ## Choosing a font
|
|
|
28
|
|
|
29 ./make_preview.py --text 24
|
|
|
30
|
|
|
31 writes one PNG per font into `preview/`. Each image shows the text as it
|
|
|
32 will be printed, drawn from the same outlines as the model. The caption
|
|
|
33 gives family, style, PostScript name, weight, classification and the
|
|
|
34 largest printable size. The file name is the font's PostScript name, so the
|
|
|
35 image can be passed to `make_glyphs.py` as it is. Named instances of
|
|
|
36 variable fonts, such as the weights of SF Pro, count as separate fonts.
|
|
|
37 Fonts that lack a character of the text are skipped.
|
|
|
38
|
|
|
39 On the development machine, all installed fonts took about 2 minutes and
|
|
|
40 244 MB. Filters narrow the selection:
|
|
|
41
|
|
|
42 ./make_preview.py --text 24 --family 'helvetica|futura' --weight-min 600
|
|
|
43 ./make_preview.py --text 24 --class serif --no-italic
|
|
|
44
|
|
|
45 `--family` and `--name` take regular expressions, matched against the
|
|
|
46 family and the PostScript name. `--italic`, `--mono` and their `--no-`
|
|
|
47 forms select by style. `--class serif` or `--class sans` keeps only fonts
|
|
|
48 that classify themselves that way; many fonts carry no classification and
|
|
|
49 appear only without this filter. `--list` prints the matching fonts
|
|
|
50 without rendering.
|
|
|
51
|
|
|
52 To see the two-colour look, give the band width in mm:
|
|
|
53
|
|
|
54 ./make_preview.py --text 24 --band 4 --fill '#202020' --outline '#c03030' --background '#e8e4dc'
|
|
|
55
|
|
|
56 The band is scaled to each font's largest print size in the single-glyph
|
|
|
57 layout, or in the whole-text layout with `--layout text`.
|
|
|
58
|
|
|
59 ## Glyph data
|
|
|
60
|
|
|
61 ./make_glyphs.py preview/Futura-Bold.png 24
|
|
|
62 ./make_glyphs.py Futura-Bold 24
|
|
|
63
|
|
|
64 The font is given by PostScript name or preview image. The script writes
|
|
|
65 `glyphs.scad`, which `main.scad` includes, and a directory
|
|
|
66 `generated/<font>_<text>/` with an SVG outline and a check image per glyph.
|
|
|
67 It prints the largest sizes and the hole positions; warnings go to standard
|
|
|
68 error.
|
|
|
69
|
|
|
70 ### Size
|
|
|
71
|
|
|
72 Size is the height of the tallest glyph, in mm. The usable area is the bed
|
|
|
73 (300 mm) minus its margin (10 mm) and the frame of the two-colour print:
|
|
|
74 280 mm minus 4 line widths. Two layouts fit differently:
|
|
|
75
|
|
|
76 - text: the whole text in one print, spaced as the font spaces it.
|
|
|
77 - glyph: one glyph per print, all glyphs at the same size.
|
|
|
78
|
|
|
79 For both, the script reports the largest size unrotated and at the best
|
|
|
80 angle between 0 and 90 degrees. In Helvetica Bold, "24" reaches 189 mm in
|
|
|
81 the text layout and 278 mm per glyph; rotation gains nothing. In SF Extra
|
|
|
82 Compressed Thin, turning the glyphs by 45 degrees raises the size per glyph
|
|
|
83 from 278 to 325 mm.
|
|
|
84
|
|
|
85 The holes are placed for one size, by default the largest unrotated size in
|
|
|
86 the glyph layout. `--layout`, `--angle` (-1 for the best) and `--size`
|
|
|
87 choose another. OpenSCAD can scale to any size later; it then checks that
|
|
|
88 the screw heads still fit.
|
|
|
89
|
|
|
90 ### Screw holes
|
|
|
91
|
|
|
92 Each glyph gets two holes, one near its upper and one near its lower end:
|
|
|
93
|
|
|
94 1. Only points where the screw head (8 mm, `--head-d`) plus a wall of 2
|
|
|
95 line widths (`--wall-lines`) fits inside the glyph are considered.
|
|
|
96 2. The glyph's main axis is found from its inked area. It follows the slant
|
|
|
97 of italic and script fonts and turns sideways for wide glyphs.
|
|
|
98 `--vertical-axis` forces it upright.
|
|
|
99 3. Along the axis, the holes aim at 85% and 15% of the glyph length
|
|
|
100 (`--target`). Distance from the axis is penalised (`--side-weight`);
|
|
|
101 sitting in the middle of the stroke is rewarded (`--centre-weight`).
|
|
|
102 4. Where no point has room for the head, the hole goes to the thickest
|
|
|
103 point of that half, and the script warns.
|
|
|
104
|
|
2
|
105 For magnets, pass the magnet diameter as `--head-d`, so the holes go where
|
|
|
106 the magnet plus the wall fits.
|
|
|
107
|
|
0
|
108 The check images show the glyph in grey, the area with room for the head in
|
|
|
109 green, the axis in blue and the holes in red, orange where the head does not
|
|
|
110 fit.
|
|
|
111
|
|
|
112 ### Glyphs of several parts
|
|
|
113
|
|
|
114 Glyphs such as "i", "รค" or "%" consist of separate parts. The script
|
|
|
115 reports them and works out a backing that connects them, see below. A hole
|
|
|
116 can land in a separate part when the target position lies there, such as
|
|
|
117 the dot of "i".
|
|
|
118
|
|
|
119 ### Fonts with overlapping outlines
|
|
|
120
|
|
|
121 Many fonts, variable fonts in particular, draw glyphs from overlapping or
|
|
|
122 self-crossing contours. OpenSCAD's SVG import would turn the overlaps into
|
|
|
123 holes. The script splits and groups the contours so the imported shape
|
|
|
124 matches the font, and compares the result with the font's own filling. Both
|
|
|
125 scripts report a difference.
|
|
|
126
|
|
|
127 ## The model
|
|
|
128
|
|
|
129 Open `main.scad` in OpenSCAD and set the parameters in the customizer. The
|
|
|
130 console shows the size, thicknesses, warnings and a file name for the
|
|
|
131 export.
|
|
|
132
|
|
|
133 ### Parts
|
|
|
134
|
|
|
135 - `all`: the glyphs as they hang on the wall, with the washers behind them.
|
|
|
136 - `body`: the glyph in print orientation, face on the bed. In single-colour
|
|
|
137 mode this is the whole print.
|
|
|
138 - `decal`: the outline band of the two-colour print.
|
|
2
|
139 - `washer`: one distance washer. Make copies in the slicer. With magnets,
|
|
|
140 print one first to test the fit.
|
|
0
|
141 - `template`: the drilling template, 2D.
|
|
|
142
|
|
|
143 ### Layout and size
|
|
|
144
|
|
|
145 `layout` chooses between the whole text and one glyph per print.
|
|
|
146 `glyph_index` picks the glyph, counted from 0 without spaces. `size` 0 uses
|
|
|
147 the largest size that fits, `angle` -1 the best angle. `bed_size` and
|
|
|
148 `bed_margin` describe the printer.
|
|
|
149
|
|
|
150 ### Glyph
|
|
|
151
|
|
|
152 `glyph_layers` sets the thickness, 6 layers by default: 1.2 mm at 0.2 mm
|
|
|
153 layers. `backing` adds `backing_layers` (4 by default) behind the glyph,
|
|
|
154 covering its outline. For glyphs of several parts the backing is the outline
|
|
|
155 grown and shrunk back, so the parts join; where that does not work, it fills
|
|
|
156 the convex hull. The gaps between parts are bridged and may need supports.
|
|
|
157
|
|
|
158 ### Screws
|
|
|
159
|
|
|
160 `screw_d` (4 mm) and `head_d` (8 mm) set the hole and the countersink, each
|
|
|
161 widened by `clearance` on both sides. The countersink is 90 degrees and
|
|
|
162 opens towards the bed. With thin glyphs it is deeper than the glyph: at the
|
|
|
163 defaults 2 mm against 1.2 mm. The washer then continues the cone.
|
|
|
164
|
|
2
|
165 `fit_wall_lines` (2) is the material required around the screw head, or
|
|
|
166 around the magnet, in line widths. Where a hole position from
|
|
|
167 `glyphs.scad` has less room at the print size, the console shows a warning.
|
|
|
168
|
|
|
169 ### Magnets
|
|
|
170
|
|
|
171 With `attachment` set to `magnet`, the glyph has no holes. Each washer
|
|
|
172 holds a magnet in a pocket at its wall end instead.
|
|
|
173
|
|
|
174 `magnet_d` and `magnet_h` set the pocket diameter and depth in steps of
|
|
|
175 0.05 mm. They are used as given, without `clearance`, so the press fit can
|
|
|
176 be tuned directly. Print a single washer to test the fit before printing
|
|
|
177 the glyphs. An open pocket of the magnet's height leaves the magnet flush
|
|
|
178 with the washer end.
|
|
|
179
|
|
|
180 `seal_magnets` closes each pocket with two layers. The pocket depth is
|
|
|
181 rounded up to whole layers, with a warning. The console gives the height
|
|
|
182 and layer number after which to pause the print. Insert the magnets in the
|
|
|
183 pause, then let the print finish over them.
|
|
|
184
|
|
0
|
185 ### Washers
|
|
|
186
|
|
|
187 The washer wall is `washer_wall_lines` line widths around the hole, 8 by
|
|
2
|
188 default, around the screw hole or the magnet pocket. `washer_height`
|
|
|
189 defaults to 10 mm and is rounded to whole layers. It is raised, with a
|
|
|
190 warning, to the part of the countersink or the magnet pocket inside the
|
|
|
191 washer plus 4 layers. A washer for screws prints with the glyph side up, a
|
|
|
192 washer for magnets with the pocket up. A separate magnet washer is glued
|
|
|
193 to the back of the glyph.
|
|
0
|
194
|
|
|
195 With `washers_on_body`, the washers are part of the body instead, standing
|
|
2
|
196 on the glyph's back, with the magnet pockets at their top. Where a washer
|
|
|
197 is wider than the glyph at that point, it is cut back to the outline so it
|
|
|
198 does not overhang, and a warning is shown.
|
|
0
|
199
|
|
|
200 ### Two-colour print
|
|
|
201
|
|
|
202 With `two_colour`, the glyph is split into a body and a decal:
|
|
|
203
|
|
3
|
204 - The decal is a band of `band_width` (4 mm) along the glyph outline,
|
|
|
205 `decal_layers` thick (2, at most 10). It is limited to the glyph
|
|
|
206 thickness less 2 layers.
|
|
|
207 - The band is `band_width` wide on the face and narrows by one layer height
|
|
|
208 per layer at its inner edge. The edge slopes away from the body, so the
|
|
|
209 nozzle can reach the body's lower layers next to the decal. How many
|
|
|
210 layers the nozzle clears depends on its shape; test it on your printer.
|
|
|
211 A warning is shown when the top layer of the band is narrower than a
|
|
|
212 line width.
|
|
|
213 - The body fills the decal layers inside the band, with no gap to the
|
|
|
214 decal.
|
|
0
|
215 - Both contain the same frame, one layer high and one line width wide,
|
|
|
216 around the glyphs. It makes the slicer place both parts in the same spot.
|
|
|
217
|
|
|
218 To print:
|
|
|
219
|
|
1
|
220 1. Slice decal and body with the same settings, but add a Z-hop to the body.
|
|
0
|
221 2. Print the decal.
|
|
|
222 3. Change filament. Remove the skirt, if any, and the frame.
|
|
|
223 4. Print the body on top.
|
|
|
224
|
|
|
225 Where a stroke is too narrow to leave body material between the bands, the
|
|
|
226 face shows only the decal colour.
|
|
|
227
|
|
|
228 ### Export
|
|
|
229
|
|
|
230 Render (F6) and export the 3D parts as STL. The file name echoed in the
|
|
|
231 console carries font, text, glyph, options, size, angle and print settings,
|
|
|
232 for example
|
|
|
233
|
|
3
|
234 house_number_body_Futura-Bold_24_g0_2cd2_cs_s2780a0t6_lw40lh20.stl
|
|
0
|
235
|
|
|
236 ## Drilling template
|
|
|
237
|
|
|
238 The holes do not line up with each other, so a full-size template shows
|
|
|
239 where to drill. Set `part` to `template`, render and export as SVG. The
|
|
|
240 template uses the same size as the print and shows:
|
|
|
241
|
|
|
242 - the glyph outlines where they hang on the wall, spaced as the font spaces
|
|
|
243 them, also when the glyphs are printed one at a time;
|
|
2
|
244 - a circle of the hole or magnet diameter at each hole, with a cross
|
|
|
245 reaching past the washer;
|
|
0
|
246 - a level line along the baseline;
|
|
|
247 - a 100 mm scale bar with 10 mm ticks.
|
|
|
248
|
|
|
249 Then
|
|
|
250
|
|
|
251 ./make_template.py house_number_template_Futura-Bold_24_s2780_lw40lh20.svg
|
|
|
252
|
|
|
253 writes a PDF of the same name, split over A4 pages, portrait or landscape,
|
|
|
254 whichever needs fewer. Print it at 100% and check the scale bar.
|
|
|
255 Neighbouring pages overlap by 10 mm. A dashed line with crosses every 50 mm
|
|
|
256 runs through the middle of each overlap. Trim one sheet along the line, lay
|
|
|
257 it over its neighbour so line and crosses match, and tape it. Each page
|
|
|
258 names its row and column in the bottom margin.
|
|
|
259
|
|
|
260 `--paper` (a4, a3, letter, legal), `--margin` (unprintable edge, 6 mm) and
|
|
|
261 `--overlap` change the page layout.
|
|
|
262
|
|
|
263 ## Files
|
|
|
264
|
|
|
265 - `make_preview.py`, `make_glyphs.py`, `make_template.py`: the scripts.
|
|
|
266 Each lists its options with `--help`.
|
|
|
267 - `fontlib.py`: code shared by the first two.
|
|
|
268 - `main.scad`: the model.
|
|
|
269 - `glyphs.scad`, `generated/`: written by `make_glyphs.py`.
|
|
|
270 - `preview/`: written by `make_preview.py`.
|