chiark / gitweb /
signed segments
[trains.git] / layout / parts.i4
1 define(`def_thing_l_r',`
2 dnl OBJNAME-EXCLUDING-L
3  defpart $1r
4   abs c 200 200 0
5   objflip $1l c c =
6  enddef
7 ')
8
9 # Conventionally, points' toes are c, the straight through is a
10 # and the curve is b.  Segments run from c towards a and b.
11 #
12 # Crossings (including slips) run `vertically' and have
13 # tl, tr, bl, br.  Segments run from b* to t*.
14
15 define(`def_point_ord',`
16 dnl OBJNAME-EXCLUDING-PT-L ANGLE STRAIGHT-L CURVE-LONGER CURVE-DIVERGE-Y MIN-R
17  defpart pt_$1l
18   abs c 200 200 0
19   segment /P0
20   extend c a len $3
21   rel a b $4 -$5 $2
22   segment /P1
23   join c b $6
24  enddef
25  def_thing_l_r(`pt_$1')
26 ')
27
28 define(`def_point_curve',`
29 dnl OBJNAME-EXCLUDING-PT-L TIGHT-ANG TIGHT-RECT TIGHT-DIVERGE-Y SHALLOW.. MIN-R
30  defpart pt_$1l
31   abs c 200 200 0
32   rel c a $6 -$7 $5
33   rel c b $3 -$4 $2
34   segment /P0
35   join c a $8
36   segment /P1
37   join c b $8
38  enddef
39  def_thing_l_r(`pt_$1')
40 ')
41
42 define(`def_point_y',`
43 dnl OBJNAME-EXCLUDING-PT HALF-ANG RECT HALF-DIVERGE-Y MIN-R
44  defpart pt_$1
45   abs c 200 200 0
46   rel c l $3 -$4  $2
47   rel c r $3  $4 -$2
48   segment /P0
49   join c l $5
50   segment /P1
51   join c r $5
52  enddef
53 ')
54
55 define(`def_crossing',`
56 dnl OBJNAME-EXCLUDING-CROSS HALF-ANG HALF-LENGTH
57  defpart cross_$1
58   abs m 200 200 0
59   rel m ml 0 0 $2
60   rel m mr 0 0 -$2
61   segment F
62   extend mr tr len $3
63   segment -F
64   extend mr bl len -$3
65   segment B
66   extend ml tl len $3
67   segment -B
68   extend ml br len -$3
69  enddef
70 ')
71
72 def_point_ord(`peco_s', 22.5, 87,  -0.5, 17,    200) # not minr 230 ?
73 def_point_ord(`peco_m', 14,  126.5,-1.55,13.21, 315) # not minr 457 ?
74 def_point_ord(`peco_l',  8,  160,  -0.4, 13.21, 914)
75  # catalogue says 123.7 for STRAIGHT-L ?!
76
77 def_point_curve(`peco_c',  10, 154.4, 13.8,  3, 156.0, 0.8, 457)
78  dnl 163.2-  } dist to markings on paper cribsheet from c
79  dnl 32.8-   }
80
81 def_point_y(`peco_y', 4, 127, 8.4, 800) # not minr 762 ?
82
83 #def_crossing(`mythical',7,   80)
84 def_crossing(`peco_l',  4,   93.75)
85 def_crossing(`peco_s', 12.5, 46)
86 def_crossing(`pecof_s', 10,  51.85)
87
88
89 def_crossing(`atlas_15',   7.5, 64)
90 def_crossing(`atlas_15m',  7.5, 61)
91 def_crossing(`atlas_90',  45,   62.4)
92 def_crossing(`atlas_90m', 45,    8.5)
93 def_crossing(`atlas_30',  15,   32.9)
94 def_crossing(`atlas_30m', 15,   30.9)
95 def_crossing(`atlas_60',  30,   48.5)
96 def_crossing(`atlas_60m', 30,   14.5)
97 def_crossing(`atlas_20',  10,   63.5)
98 def_crossing(`atlas_20m', 10,   46.0)
99 def_crossing(`atlas_45',  22.5, 50.9)
100 def_crossing(`atlas_45m', 22.5, 19.5)
101
102 define(`def_point_shino',`
103 dnl OBJNAME-EXCLUDING-PT-L($1) A($2) B($3) Q($4)
104 dnl not R($5)
105  defpart pt_$1l
106   abs c 200 200 0
107   layer s
108   rel c strintersect $3 0 $4
109   rel strintersect strbackanal -$3
110   layer =
111   rel strbackanal b $2
112   segment /P1
113   join c b 240 arcline
114   segment /P0
115   extend c a len $2
116  enddef
117  def_thing_l_r(`pt_$1')
118 ')
119
120 def_point_shino(`shino_4', 136, 45, 14.25)
121 def_point_shino(`shino_6', 177, 49,  9.50)
122 def_point_y(`shino_y', 7.125, 140, 10.9, 750) # not minr 500 ?
123
124 defpart pt_shino_x3
125   abs c 200 200 0
126   layer s
127   rel c strintersectc  74 0   9.5
128   rel c strintersectb 103 0 -12
129   layer =
130   rel strintersectc l 141
131   rel strintersectb r 112
132   segment /P1
133   extend c m len 215
134   segment /P0
135   join c l 315 arcline
136   segment /P2
137   join c r 315 arcline
138 enddef
139
140 define(`def_slip2',`
141 dnl OBJNAME-EXCLUDING-SLIP2 HALF-LEN HALF-ANG
142  defpart slip2_$1
143   # configurations:  bl-tl 0  bl-tr 1  br-tl 2  br-tr 3
144   abs m 200 200 0
145   rel m ml 0 0  $3
146   rel m mr 0 0 -$3
147   segment /S2
148   extend ml tl len $2
149   segment -/S2
150   extend ml br len -$2
151   segment /S1
152   extend mr tr len $2
153   segment -/S1
154   extend mr bl len -$2
155   segment /S0
156   join bl tl 500
157   segment /S3
158   join br tr 500
159  enddef
160 ')
161
162 def_slip2(`shino', 114, 4.75)
163 def_slip2(`pecof',  77, 5.00)
164
165 define(`def_scis',`
166 dnl OBJNAME-EXCLUDING-SCIS HALF-LENGTH HALF-SPACING HALF-ANG MIN-R
167  defpart scis_$1
168   abs bl 200 200 0
169   rel bl m $2 $3
170   rel m br -$2 $3
171   extend bl ml len $2
172   extend ml tl len $2
173   extend br mr len $2
174   extend mr tr len $2
175   layer s
176   rel m mxl 0 0 $4
177   rel m mxr 0 0 -$4
178   layer =
179   join bl mxr $5
180   join mxr tr $5
181   join br mxl $5
182   join mxl tl $5
183  enddef
184 ')
185
186 def_scis(`pecof', 135.42, 13.5,  10, 315)
187 def_scis(`shino', 154,    13.5, 9.5, 315)
188
189 define(`tt_do_circle',`
190  layer s
191  rel mid forcirc0$2 0 $1 0
192  rel mid forcirc1$2 0 -$1 180
193  layer l
194  join forcirc0$2 forcirc1$2 0
195  join forcirc1$2 forcirc0$2 0
196  layer =
197 ')
198
199 defpart tt_peco
200  layer =
201  abs mid 200 200 0
202  extend mid out len 80
203  extend -mid -in len 80
204
205  tt_do_circle(80, `')
206 enddef
207
208 define(`tt_atlas_out',`
209  layer s
210  rel mid mid$1 0 0 $1
211  layer =
212  rel mid$1 out$1 109 0
213 ')
214
215 defpart tt_atlas
216  layer =
217  abs mid 200 200 0
218  extend mid out len 109
219  extend -mid -in len 109
220
221  tt_atlas_out(`0')
222  tt_atlas_out(`15')
223  tt_atlas_out(`30')
224  tt_atlas_out(`45')
225  tt_atlas_out(`60')
226  tt_atlas_out(`75')
227  tt_atlas_out(`90')
228  tt_atlas_out(`105')
229  tt_atlas_out(`120')
230  tt_atlas_out(`135')
231  tt_atlas_out(`150')
232  tt_atlas_out(`165')
233  tt_atlas_out(`180')
234  tt_atlas_out(`195')
235  tt_atlas_out(`210')
236  tt_atlas_out(`225')
237  tt_atlas_out(`240')
238  tt_atlas_out(`255')
239  tt_atlas_out(`270')
240  tt_atlas_out(`285')
241  tt_atlas_out(`300')
242  tt_atlas_out(`315')
243  tt_atlas_out(`330')
244  tt_atlas_out(`345')
245
246  tt_do_circle(95.25, i)
247  tt_do_circle(109, `')
248 enddef
249
250 defpart tt_atlas_motor
251  abs cout 200 200 0
252  layer p
253  rel cout bl -40 -40
254  rel cout br -40  40
255  extend bl tl len 100
256  extend br tr len 100
257  join tl -tr 0.1
258 enddef