1 Locations, angles, etc.
3 Key type is a `loc', which is a named location (absolute, 2D) and
4 direction (at the location). Angles are generally positive
5 anticlockwise; bearings are angles measured from East. The origin is
11 -<identifier> reverse the sense (ie, 180 degrees off)
13 <identifier> simply the named location
14 -<identifier> reverse the sense (ie, 180 degrees off)
15 O![-]<identifier> the location from the specified object
16 in whatever coordinate system that object
18 ^O![-]<identifier> the same, but the object is flipped
19 N-S first (see `part' and `objflip')
20 Quantity (length/angle)
22 Angle units: d (degrees,default) r (radians)
23 Length units: mm (default) cm m
24 Identifiers (of locs and objects) start with lc letter, then
25 alphanums and underscores
30 Defines loc P given coordinates (distances) and absolute bearing
33 Defines loc T: start at loc F, go forward L, translate right R,
34 turn left A (defaults are all 0).
36 extend F T len L [R] length L
37 extend F T upto U [R] s.t. perpendicular at T passes through U
38 extend F T ang A R subtending directionally A
39 extend F T uptoang A R s.t. direction at T is A
40 extend F T parallel U R s.t. direction at T is same as at U
41 Draws an arc or line from loc F, defining the other end as loc T.
42 If length R specified, draws an arc of radius R; R +ve curves to the
43 right; R -ve to the left.
46 Joins one existing loc, F, to another, T. F's direction points to
47 the new track; T's away - ie the added track leaves F in F's
48 direction and arrives at T in T's direction. R is the minimum curve
49 radius allowed. S selects from the available solutions, and may be
51 long prefer longer length solution
52 short prefer shorter length solution
53 right|left prefer mostly bending to the left resp. right
54 beginright|beginleft prefer first bend to the right
55 endright|endleft prefer final bend to the right
56 [!]twoarcs prefer [not] two circular arcs of equal radius
57 [!]arcline prefer [not] one line and an arc of max radius
58 [!]arcsline prefer [not] line between two arcs of min radius
59 if this doesn't resolve, will pick the shortest.
64 Defines the object or part O. Inside the definition, the commands
65 do not draw when the object is being defined. The object has its
66 own coordinate space and its own location namespace. `defpart'
67 defines a `part', which is like an object except that:
68 * showlibrary lists only parts, not objects
69 * the -e and -E command line options distinguish parts and objects
71 part N [^]O [F [A]] [FR AR ...]
73 Places an instance of object or part O. The loc defined inside O as
74 F (`formal parameter', F must be just <identifier>) is placed at
75 existing loc A (`actual parameter').
77 Both objects (defined with defobj) and parts (defined with defpart)
78 may be placed with either command ! Whether it's a part or an obj
79 depends on the definition, not on the use - the use is just
80 different syntaxes for the same kind of operation, and where the
81 features offered by both `part' and `obj[flip]' overlap the
82 behaviour is identical.
84 If `part N ^O' or `objflip' is used, rather than `part N O' or
85 `obj', then the object is placed with object-space y coordinates
86 negated (ie, it is mirrored so that the object's North exchanges
89 For `part', each FR (`formal result') and AR (`actual result')
90 specifies that the loc FR inside O is exported into the global
91 namespace as a new loc AR. Either FR or AR may start with `-'.
92 Also, each loc L inside O is exported into the global namespace as a
93 new loc N_L (unless N_L already exists). If A is not specified then
96 For `obj[flip]' if prefix P (syntax is that of an identifier) is
97 specified, each other loc L inside O is exported into the global
98 namespace as a new loc PL (unless PL already exists). P may be `='
99 to indicate an empty prefix (default is not to export locs).
103 -D turn on debug (level 1) } currently only debug levels are
104 -Dnnn set debug level to nnn } 0 (none) and 1 (some)
107 Turn on and off drawing of elements in groups.
108 These are abbreviations for various -E... options.
112 S rails and sleepers only aRSc
113 C centrelines only arsC
114 c swept area and ticks only Arsc
116 L label top-level locs (turns on bars for them too) LM
117 l do not label any locs l
118 bars at locs (thick lines perp to track dir'n)
119 M bars for top-level locs only Mno
120 N bars for top-level locs and those in obj's MNo
121 O bars for everything, including those inside parts MNO
122 m no bars (turns off labelling too) mnol
124 -E[ARSCLMNOarsclmno]...
125 enable (capitals) or disable (lowercase) drawing of
127 A draw track swept area, with ticks
129 S draw track sleepers
130 C draw track centrelines
132 M mark locs with a bar
133 N mark locs with a bar in objs
134 O mark locs with a bar in parts
136 -q quiet: do not print info to stderr
137 (default: prints bounding box, at the moment)
139 Default is -d0, -EaRscLMNo, not quiet.
141 Special comments in PostScript:
144 a command C with args A is read for execution in scope S
146 point L in scope S has coords X Y and angle A
147 %L bbox width W (L..R)
148 %L bbox height H (B..T)
149 bounding box, giving width W, height H, left L, right R,
150 bottom B and top T. Includes full swept area of track,
151 but only at locs (so curves which bend outside bounding
152 box don't get counted)
153 %L bbox no locs, no bbox
154 there were no locs, so there is no bounding box
155 usu because input file was just obj defns and showlibrary
158 O! when defining object or part O
159 N:T scope T but inside part (introduced with `part') N } when
160 O::T scope T but inside obj (introduced with `obj[flip]') O } placing