-
Notifications
You must be signed in to change notification settings - Fork 2
/
readme.txt
134 lines (104 loc) · 4.62 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
Module: alpha.scad
Author: Chris Lott
Description: Implement text in OpenSCAD using the simple technical
lettering styles used in drafting. This is a vector-style
of "font".
I'm using the following two modules:
1. arc.scad
by Alex Franke (codecreations), March 2012
http://www.theFrankes.com
Licenced under Creative Commons Attribution - Non-Commercial - Share Alike 3.0
Modified by rclott 2015-01 to extrude square or circular cross sections
2. ascii.scad
ASCII lookup table and other utility functions
from user MichaelAtOz
date 16 Jun 2013
on OpenSCAD github, issue #116 discussion thread:
https://github.com/openscad/openscad/issues/116
Detailed Notes:
===============
Technical Lettering used in Drafting
see Wikipedia:
http://en.wikipedia.org/wiki/Engineering_drawing#Technical_lettering
Historical (pre-computers) technical lettering styles can be found
in various references:
http://p3cdn4static.sharpschool.com/UserFiles/Servers/Server_926913/Image/Migration/vertical_lettering.jpg
http://1.bp.blogspot.com/_nm98fXNhUco/TDHJMNGx9lI/AAAAAAAAAGM/JcZuvE6f_g8/s1600/Picture8.jpg
http://3.bp.blogspot.com/_nm98fXNhUco/TDHIM8VktBI/AAAAAAAAAF8/CSbxvOlo8pk/s1600/Picture5.jpg
In modern era,
European standards specify ISO-3098
American standards specify ANSI-Y14.5M-2009
An interesting discussion on this FreeCAD discussion forum:
http://forum.freecadweb.org/viewtopic.php?f=8&t=4349
from which we find the following ttf fonts, specifically designed
to follow these technical lettering drafting standards
1. Micronus / Y14.5M-2009
http://www.fontspace.com/micronus/y145m-2009
2. osifont / ISO-3098
http://code.google.com/p/osifont/
This OpenSCAD module uses the pre-computer styles, which in turn
seem to have been the model for the ANSI standard. Furthermore, an
approximation is made for some letters to avoid the missing ellipse
extrusion capability in OpenSCAD.
Wikipedia notes that ISO standards implemented certain features to
improve legibility (except for the "one" glyph, I don't see these
features in the osifont ISO-look-alike font):
(a) serifed "one"
(b) barred "seven"
(c) open "four", "six" and "nine"
(d) rounded top "three"
I have implemented these, except "d" which I don't understand.
And furthemore, I chose to add the following for legibility reasons:
(e) a diagonal bar through my zero glyph
(f) a bar on the "Z"
Each letter is descibed by a combination of line and circular
segments (some letters actually require elliptical segments,
for which I substituted ovals instead).
Each line segment is described by two points, beginning and ending,
in a vector as follows:
[x0,y0, x1,y1]
Each cicular segment is described by a center point, radius,
and beginning and ending angle in a vector as follows:
[x0,y0, rad, abeg,aend]
Each letter is described in a vector whose elements are as follows:
[
ascii_code,
name,
width,
vector_of_line_segments,
vector_of_circular_segments
]
The diagrams available to me seemed to use the following grid.
Not sure if this is spelled out in the two standards or not, but
it's easy enough to scale these letters to any desired size.
Uppercase letters are all constructed in a grid which is 6 units tall,
and most characters are either 5 or 6 units wide. Lowercase letters
are typically 4 units tall, with a few letters being 6 units tall.
Those letters with descenders extend two units below the baseline.
(per the referenced lettering charts shown above).
Stroke thickness should be 10% of character height.
I've assigned the arbitrary coordinate system to the grid:
0 1 2 3 4 5 6 7 8 9
6 + + + + + + + + + +
5 + + + + + + + + + +
4 + + + + + + + + + +
3 + + + + + + + + + +
2 + + + + + + + + + +
1 + + + + + + + + + +
0 + + + + + + + + + +
-1 + + + + + + + + + +
-2 + + + + + + + + + +
0 1 2 3 4 5 6 7 8 9
Letters are drawn by extruded squares or circles. It would be
straightforward to draw the with any arbitrary extruded polygon
with only minor changes to the code.
One note on the "end caps" of the lines. For circular letters,
it's easy to make all end caps a sphere. But for rectangular
cross section letters, a similar cap of a truncated pyramid
doesn't look as good when line segments join. To properly join
such line segments as a bigger headache than I wanted to endure.
I compromised by making circular segments have truncated
pyramidal endcaps, but line segments have half a cube (the line
segment is essentially extended by half the cross section length).
This is an adequate compromise, and frankly I liked the circular
cross section letters best, so I didn't pursue this further.