|
0
|
1 # House number
|
|
|
2
|
|
2
|
3 3D-printed house numbers, or any other text, to fix to a wall. Each glyph
|
|
4
|
4 is a separate flat piece with 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
|
|
4
|
80 angle between 0 and 90 degrees. Rotation helps narrow fonts: in SF Extra
|
|
|
81 Compressed Thin, 45 degrees raises the size per glyph from 278 to 325 mm.
|
|
0
|
82
|
|
|
83 The holes are placed for one size, by default the largest unrotated size in
|
|
|
84 the glyph layout. `--layout`, `--angle` (-1 for the best) and `--size`
|
|
|
85 choose another. OpenSCAD can scale to any size later; it then checks that
|
|
|
86 the screw heads still fit.
|
|
|
87
|
|
4
|
88 ### Mounting points
|
|
0
|
89
|
|
4
|
90 The script looks for the best mounting points on each glyph: spread wide,
|
|
|
91 so the glyph sits firmly on its washers and does not tip, and each in the
|
|
|
92 middle of a stroke with room for the screw head (8 mm, `--head-d`) plus a
|
|
|
93 wall of 2 line widths (`--wall-lines`). For magnets, pass the magnet
|
|
|
94 diameter as `--head-d`.
|
|
0
|
95
|
|
4
|
96 By default each glyph gets two holes, near its upper and lower end.
|
|
|
97 `--holes` sets the most holes per glyph, up to 6. Three holes make a glyph
|
|
|
98 sit flat; more are used only where they clearly improve the hold. In
|
|
|
99 Futura Bold, "W" and "H" get four, most glyphs three, and "I" two. The
|
|
|
100 script prints the number of holes per glyph, and why it stayed below the
|
|
|
101 maximum. It warns where a head does not fit.
|
|
0
|
102
|
|
4
|
103 Further options tune the placement, see `--help`. The comments in
|
|
|
104 `make_glyphs.py` describe the method.
|
|
2
|
105
|
|
0
|
106 The check images show the glyph in grey, the area with room for the head in
|
|
4
|
107 green, the axis or the hole polygon and the centre in blue, and the holes in
|
|
|
108 red, orange where the head does not fit.
|
|
0
|
109
|
|
|
110 ### Glyphs of several parts
|
|
|
111
|
|
|
112 Glyphs such as "i", "ä" or "%" consist of separate parts. The script
|
|
|
113 reports them and works out a backing that connects them, see below. A hole
|
|
4
|
114 can land in a separate part, such as the dot of "i".
|
|
0
|
115
|
|
|
116 ### Fonts with overlapping outlines
|
|
|
117
|
|
|
118 Many fonts, variable fonts in particular, draw glyphs from overlapping or
|
|
|
119 self-crossing contours. OpenSCAD's SVG import would turn the overlaps into
|
|
4
|
120 holes. The scripts correct this and report where the result still differs
|
|
|
121 from the font's own filling.
|
|
0
|
122
|
|
|
123 ## The model
|
|
|
124
|
|
|
125 Open `main.scad` in OpenSCAD and set the parameters in the customizer. The
|
|
|
126 console shows the size, thicknesses, warnings and a file name for the
|
|
|
127 export.
|
|
|
128
|
|
|
129 ### Parts
|
|
|
130
|
|
|
131 - `all`: the glyphs as they hang on the wall, with the washers behind them.
|
|
|
132 - `body`: the glyph in print orientation, face on the bed. In single-colour
|
|
|
133 mode this is the whole print.
|
|
|
134 - `decal`: the outline band of the two-colour print.
|
|
2
|
135 - `washer`: one distance washer. Make copies in the slicer. With magnets,
|
|
|
136 print one first to test the fit.
|
|
0
|
137 - `template`: the drilling template, 2D.
|
|
|
138
|
|
|
139 ### Layout and size
|
|
|
140
|
|
|
141 `layout` chooses between the whole text and one glyph per print.
|
|
|
142 `glyph_index` picks the glyph, counted from 0 without spaces. `size` 0 uses
|
|
|
143 the largest size that fits, `angle` -1 the best angle. `bed_size` and
|
|
|
144 `bed_margin` describe the printer.
|
|
|
145
|
|
|
146 ### Glyph
|
|
|
147
|
|
|
148 `glyph_layers` sets the thickness, 6 layers by default: 1.2 mm at 0.2 mm
|
|
|
149 layers. `backing` adds `backing_layers` (4 by default) behind the glyph,
|
|
4
|
150 covering its outline. For glyphs of several parts the backing also fills
|
|
|
151 the gaps between the parts, or, where they lie far apart, the convex hull.
|
|
|
152 The gaps are bridged and may need supports.
|
|
0
|
153
|
|
|
154 ### Screws
|
|
|
155
|
|
|
156 `screw_d` (4 mm) and `head_d` (8 mm) set the hole and the countersink, each
|
|
|
157 widened by `clearance` on both sides. The countersink is 90 degrees and
|
|
|
158 opens towards the bed. With thin glyphs it is deeper than the glyph: at the
|
|
|
159 defaults 2 mm against 1.2 mm. The washer then continues the cone.
|
|
|
160
|
|
2
|
161 `fit_wall_lines` (2) is the material required around the screw head, or
|
|
|
162 around the magnet, in line widths. Where a hole position from
|
|
|
163 `glyphs.scad` has less room at the print size, the console shows a warning.
|
|
|
164
|
|
|
165 ### Magnets
|
|
|
166
|
|
|
167 With `attachment` set to `magnet`, the glyph has no holes. Each washer
|
|
|
168 holds a magnet in a pocket at its wall end instead.
|
|
|
169
|
|
|
170 `magnet_d` and `magnet_h` set the pocket diameter and depth in steps of
|
|
|
171 0.05 mm. They are used as given, without `clearance`, so the press fit can
|
|
|
172 be tuned directly. Print a single washer to test the fit before printing
|
|
|
173 the glyphs. An open pocket of the magnet's height leaves the magnet flush
|
|
|
174 with the washer end.
|
|
|
175
|
|
|
176 `seal_magnets` closes each pocket with two layers. The pocket depth is
|
|
|
177 rounded up to whole layers, with a warning. The console gives the height
|
|
|
178 and layer number after which to pause the print. Insert the magnets in the
|
|
|
179 pause, then let the print finish over them.
|
|
|
180
|
|
0
|
181 ### Washers
|
|
|
182
|
|
|
183 The washer wall is `washer_wall_lines` line widths around the hole, 8 by
|
|
2
|
184 default, around the screw hole or the magnet pocket. `washer_height`
|
|
|
185 defaults to 10 mm and is rounded to whole layers. It is raised, with a
|
|
|
186 warning, to the part of the countersink or the magnet pocket inside the
|
|
|
187 washer plus 4 layers. A washer for screws prints with the glyph side up, a
|
|
|
188 washer for magnets with the pocket up. A separate magnet washer is glued
|
|
|
189 to the back of the glyph.
|
|
0
|
190
|
|
|
191 With `washers_on_body`, the washers are part of the body instead, standing
|
|
2
|
192 on the glyph's back, with the magnet pockets at their top. Where a washer
|
|
|
193 is wider than the glyph at that point, it is cut back to the outline so it
|
|
|
194 does not overhang, and a warning is shown.
|
|
0
|
195
|
|
|
196 ### Two-colour print
|
|
|
197
|
|
|
198 With `two_colour`, the glyph is split into a body and a decal:
|
|
|
199
|
|
3
|
200 - The decal is a band of `band_width` (4 mm) along the glyph outline,
|
|
4
|
201 `decal_layers` thick: 2 by default, at most 10 and at most the glyph
|
|
3
|
202 thickness less 2 layers.
|
|
4
|
203 - The band narrows towards the back, so the nozzle can reach the body's
|
|
|
204 first layers next to the decal. How many decal layers the nozzle clears
|
|
|
205 depends on its shape; test it on your printer. A warning is shown when
|
|
|
206 the band's top layer gets narrower than a line width.
|
|
0
|
207 - Both contain the same frame, one layer high and one line width wide,
|
|
|
208 around the glyphs. It makes the slicer place both parts in the same spot.
|
|
|
209
|
|
|
210 To print:
|
|
|
211
|
|
1
|
212 1. Slice decal and body with the same settings, but add a Z-hop to the body.
|
|
0
|
213 2. Print the decal.
|
|
|
214 3. Change filament. Remove the skirt, if any, and the frame.
|
|
|
215 4. Print the body on top.
|
|
|
216
|
|
|
217 Where a stroke is too narrow to leave body material between the bands, the
|
|
|
218 face shows only the decal colour.
|
|
|
219
|
|
|
220 ### Export
|
|
|
221
|
|
|
222 Render (F6) and export the 3D parts as STL. The file name echoed in the
|
|
4
|
223 console carries font, text, glyph, options, size, angle and print settings.
|
|
|
224 A maximum hole count other than 2 adds `h` and the count after the
|
|
|
225 attachment, such as `cs_h3_`. For example:
|
|
0
|
226
|
|
3
|
227 house_number_body_Futura-Bold_24_g0_2cd2_cs_s2780a0t6_lw40lh20.stl
|
|
0
|
228
|
|
|
229 ## Drilling template
|
|
|
230
|
|
|
231 The holes do not line up with each other, so a full-size template shows
|
|
|
232 where to drill. Set `part` to `template`, render and export as SVG. The
|
|
|
233 template uses the same size as the print and shows:
|
|
|
234
|
|
|
235 - the glyph outlines where they hang on the wall, spaced as the font spaces
|
|
|
236 them, also when the glyphs are printed one at a time;
|
|
2
|
237 - a circle of the hole or magnet diameter at each hole, with a cross
|
|
|
238 reaching past the washer;
|
|
0
|
239 - a level line along the baseline;
|
|
|
240 - a 100 mm scale bar with 10 mm ticks.
|
|
|
241
|
|
|
242 Then
|
|
|
243
|
|
|
244 ./make_template.py house_number_template_Futura-Bold_24_s2780_lw40lh20.svg
|
|
|
245
|
|
|
246 writes a PDF of the same name, split over A4 pages, portrait or landscape,
|
|
|
247 whichever needs fewer. Print it at 100% and check the scale bar.
|
|
|
248 Neighbouring pages overlap by 10 mm. A dashed line with crosses every 50 mm
|
|
|
249 runs through the middle of each overlap. Trim one sheet along the line, lay
|
|
|
250 it over its neighbour so line and crosses match, and tape it. Each page
|
|
|
251 names its row and column in the bottom margin.
|
|
|
252
|
|
|
253 `--paper` (a4, a3, letter, legal), `--margin` (unprintable edge, 6 mm) and
|
|
|
254 `--overlap` change the page layout.
|
|
|
255
|
|
|
256 ## Files
|
|
|
257
|
|
|
258 - `make_preview.py`, `make_glyphs.py`, `make_template.py`: the scripts.
|
|
|
259 Each lists its options with `--help`.
|
|
|
260 - `fontlib.py`: code shared by the first two.
|
|
|
261 - `main.scad`: the model.
|
|
|
262 - `glyphs.scad`, `generated/`: written by `make_glyphs.py`.
|
|
|
263 - `preview/`: written by `make_preview.py`.
|