Debian Codegraph @

texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex

raw
1 % Copyright 2018-2026 by Romano Giannetti
2 % Copyright 2015-2026 by Stefan Lindner
3 % Copyright 2013-2026 by Stefan Erhardt
4 % Copyright 2007-2026 by Massimo Redaelli
5 %
6 % This file may be distributed and/or modified
7 %
8 % 1. under the LaTeX Project Public License and/or
9 % 2. under the GNU Public License.
10 %
11 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
12
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14 %% Monopoles
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 %%%%%%%%%%%%%
18 %% Grounds
19 %%%%%%%%%%%%%
20
21
22 % grounds and power supplies%<<<1
23
24 \ctikzset{monopoles/.is family}
25 \ctikzset{monopoles/ground/width/.initial=.25}
26 \ctikzset{monopoles/ground/connectionthickness/.initial=1}
27 \ctikzset{monopoles/ground/thickness/.initial=2}
28 \ctikzset{monopoles/rground/thickness/.initial=2}
29 \ctikzset{monopoles/tground/thickness/.initial=3}
30 \ctikzset{monopoles/vcc/width/.initial=.2}
31 \ctikzset{monopoles/vcc/arrow/.initial=legacy}
32 \ctikzset{monopoles/vee/arrow/.initial=legacy}
33 \ctikzset{monopoles/match/width/.initial=.4}
34 \ctikzset{monopoles/chassis/width/.initial=.25}
35 \ctikzset{monopoles/alternative chassis/width/.initial=.25}
36 \ctikzset{monopoles/equipotentiality/width/.initial=.25}
37 \ctikzset{monopoles/antenna/width/.initial=.25}
38 \ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
39 \ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
40 \ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
41 \ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
42 \ctikzset{monopoles/txantenna/width/.initial=.25}
43 \ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
44 \ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
45 \ctikzset{monopoles/rxantenna/width/.initial=.25}
46 \ctikzset{monopoles/bareantenna/width/.initial=.25}
47 \ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
48 \ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
49 \ctikzset{monopoles/dinantenna/width/.initial=.2}
50 \ctikzset{monopoles/dinantenna/height/.initial=.6}
51 \ctikzset{monopoles/waves/width/.initial=0.5}%
52 \ctikzset{monopoles/harmonics/width/.initial=0.5}%
53 %>>>
54
55 %% Node shapes for grounds and power supply%<<<
56
57 %% Ground symbol
58 % #1 -> name
59 % #2 -> width
60 % #3 -> depth
61 % #4 -> code
62 \long\def\pgf@circ@declareground#1#2#3#4{
63 \pgfdeclareshape{#1}{
64 \savedmacro{\ctikzclass}{\edef\ctikzclass{grounds}} % class of these components
65 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
66 \savedanchor{\southeast}{
67 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
68 \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
69 \pgf@x=#2\pgf@x
70 \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
71 \pgf@y=-#3\pgf@y
72 }
73 \anchor{north}{\pgfpointorigin}
74 \anchor{north east}{\southeast\pgf@y=0pt\relax}
75 \anchor{east}{\southeast\pgf@y=.5\pgf@y}
76 \anchor{south east}{\southeast}
77 \anchor{south}{\southeast\pgf@x=0pt\relax}
78 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
79 \anchor{west}{\southeast\pgf@y=.5\pgf@y\pgf@x=-\pgf@x}
80 \anchor{north west}{\southeast\pgf@y=0pt\pgf@x=-\pgf@x}
81 \anchor{left}{\pgfpointorigin}
82 \anchor{right}{\pgfpointorigin}
83 \anchor{center}{\pgfpointorigin}
84 \pgf@circ@draw@component{
85 \pgf@circ@scaled@Rlen=\scaledRlen
86 \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
87 \pgfscope
88 \pgfstartlinewidth=\pgflinewidth
89 #4
90 \endpgfscope
91 }
92 }
93 }
94
95
96 \pgf@circ@declareground{ground}{0.6}{1.6}{
97 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
98 \pgfpathmoveto{\pgfpointorigin}
99 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
100 \pgfusepath{draw}
101 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
102 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
103 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
104 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
105 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
106 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
107 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
108 \pgfusepath{draw}
109 }
110
111 \pgf@circ@declareground{tlground}{0.6}{0.4}{
112 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
113 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
114 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
115 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
116 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
117 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
118 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
119 \pgfusepath{draw}
120 }
121
122
123 \pgf@circ@declareground{rground}{0.6}{1}{
124 \pgfpathmoveto{\pgfpointorigin}
125 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
126 \pgfusepath{draw}
127
128 \pgfstartlinewidth=\pgflinewidth
129 \pgf@circ@setlinewidth{monopoles/rground}{\pgfstartlinewidth}
130
131 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
132 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
133 \pgfsetroundcap\pgfusepath{draw}
134 }
135
136 \pgf@circ@declareground{tground}{0.6}{0}{
137 \pgfpathmoveto{\pgfpointorigin}
138 \pgfusepath{draw}
139
140 \pgfstartlinewidth=\pgflinewidth
141 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
142
143 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
144 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
145 \pgfusepath{draw}
146 }
147
148 \pgf@circ@declareground{sground}{0.6}{1.8}{
149 \pgfpathmoveto{\pgfpointorigin}
150 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
151 \pgfusepath{draw}
152
153 \pgfstartlinewidth=\pgflinewidth
154 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
155
156 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
157 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
158 \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
159 \pgfpathclose
160 \pgf@circ@draworfill
161 }
162
163 % noiseless ground
164 \pgf@circ@declareground{nground}{0.9}{1.6}{
165 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
166 \pgfpathmoveto{\pgfpointorigin}
167 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
168 \pgfusepath{draw}
169 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
170 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
171 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
172 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
173 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
174 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
175 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
176 \pgfusepath{draw}
177 \pgfpathmoveto{\pgfpoint{0.9\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
178 \pgfpatharc{0}{180}{0.9\pgf@circ@res@step}
179 \pgfusepath{draw}
180 }
181
182 % protective ground
183 \pgf@circ@declareground{pground}{0.9}{1.8}{
184 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
185 \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
186 \pgf@circ@draworfill
187 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
188 \pgfpathmoveto{\pgfpointorigin}
189 \pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
190 \pgfusepath{draw}
191 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
192 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
193 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
194 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
195 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
196 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
197 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
198 \pgfusepath{draw}
199 }
200
201 % chassis ground
202 \pgf@circ@declareground{cground}{1}{2}{
203 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
204 \pgfpathmoveto{\pgfpointorigin}
205 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
206 \pgfusepath{draw}
207 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
208 \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
209 \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
210 \pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
211 \pgfpathlineto{\pgfpoint{ 0.50\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
212 \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
213 \pgfpathlineto{\pgfpoint{-0.25\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
214 \pgfusepath{draw}
215 }
216
217 % Contributed by @fotesan https://github.com/fotesan
218 % european ground
219 \pgf@circ@declareground{eground}{1.1}{1.7}{
220 \pgfpathmoveto{\pgfpointorigin}
221 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
222 \pgfusepath{draw}
223
224 \pgfstartlinewidth=\pgflinewidth
225 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
226
227 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
228 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
229 \pgfusepath{draw}
230
231 \pgfsetlinewidth{\pgfstartlinewidth}
232 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
233 \pgfpathlineto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
234 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
235 \pgfpathlineto{\pgfpoint{-.1\pgf@circ@res@step}{-1\pgf@circ@res@step}}
236 \pgfpathmoveto{\pgfpoint{-.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
237 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
238 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
239 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
240 \pgfusepath{draw}
241 }
242
243 \pgf@circ@declareground{eground2}{1.1}{1.7}{
244 \pgfpathmoveto{\pgfpointorigin}
245 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
246 \pgfusepath{draw}
247
248 \pgfstartlinewidth=\pgflinewidth
249 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
250
251 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
252 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
253 \pgfusepath{draw}
254
255 \pgfsetlinewidth{\pgfstartlinewidth}
256 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
257 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
258 \pgfpathmoveto{\pgfpoint{-.45\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
259 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1\pgf@circ@res@step}}
260 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
261 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
262 \pgfusepath{draw}
263 }
264
265 %%%%%%%%%%%%%%%%%%
266 %% Power supplies
267 %%%%%%%%%%%%%%%%%%
268
269 % Vcc
270 \pgfdeclareshape{vcc}{
271 \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
272 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
273 \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
274 \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
275 \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
276 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
277 }
278 \savedanchor{\northeast}{%
279 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
280 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
281 \pgf@x=.5\pgf@circ@res@step
282 \pgf@y=3\pgf@x%
283 }
284 \anchor{north}{\northeast\pgf@x=0cm\relax}
285 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
286 \anchor{south}{\pgfpointorigin}
287 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
288 \anchor{north east}{\northeast}
289 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
290 \anchor{south east}{\northeast\pgf@y=0pt\relax}
291 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
292 \anchor{center}{\pgfpointorigin}
293 \anchor{left}{\pgfpointorigin}
294 \anchor{right}{\pgfpointorigin}
295 \savedanchor{\textanchor}{
296 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
297 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
298 %% this moves simply extends the bounding box. Clunky, but cannot be removed for compatibility
299 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
300 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}\pgf@x=0pt
301 \pgf@y=2\pgf@circ@res@step
302 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
303 \pgf@x=-.5\wd\pgfnodeparttextbox
304 }
305 \anchor{text}{\textanchor}
306 \pgf@circ@draw@component{
307 \pgf@circ@scaled@Rlen=\scaledRlen
308 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
309 \pgfscope
310 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
311 \ifx\pgf@temp\pgf@circ@temp
312 \pgfstartlinewidth=\pgflinewidth
313 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
314
315 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
316 \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
317 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
318 \pgfusepath{draw}
319
320 \pgfsetlinewidth{\pgfstartlinewidth}
321 \else
322 \pgfsetarrowsend{\pgf@circ@temp}
323 \fi
324 \pgfpathmoveto{\pgfpointorigin}
325 \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
326 \pgfusepath{draw}
327 \endpgfscope
328 }
329 }
330
331 % Vee
332 \pgfdeclareshape{vee}{
333 \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
334 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
335 \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
336 \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
337 \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
338 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
339 }
340 \savedanchor{\northeast}{%
341 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
342 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
343 \pgf@x=.5\pgf@circ@res@step
344 \pgf@y=-3\pgf@x%
345 }
346 \anchor{south}{\northeast\pgf@x=0cm\relax}
347 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
348 \anchor{north}{\pgfpointorigin}
349 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
350 \anchor{south east}{\northeast}
351 \anchor{south west}{\northeast\pgf@x=-\pgf@x}
352 \anchor{north east}{\northeast\pgf@y=0pt\relax}
353 \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
354 \anchor{center}{\pgfpointorigin}
355 \anchor{left}{\pgfpointorigin}
356 \anchor{right}{\pgfpointorigin}
357 \savedanchor{\textanchor}{
358 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
359 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
360 %% this moves simply extends the bounding box. Clunky, but cannot be removed for compatibility
361 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
362 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}\pgf@x=0pt
363 \pgf@y=-2\pgf@circ@res@step
364 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
365 \pgf@x=-.5\wd\pgfnodeparttextbox
366 }
367 \anchor{text}{\textanchor}
368 \pgf@circ@draw@component{
369 \pgf@circ@scaled@Rlen=\scaledRlen
370 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
371 \pgfscope
372 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
373 \ifx\pgf@temp\pgf@circ@temp
374
375 \pgfstartlinewidth=\pgflinewidth
376 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
377
378 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
379 \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
380 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
381 \pgfusepath{draw}
382 \pgfsetlinewidth{\pgfstartlinewidth}
383 \else
384 \pgfsetarrowsend{\pgf@circ@temp}
385 \fi
386 \pgfpathmoveto{\pgfpointorigin}
387 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
388 \pgfusepath{draw}
389 \endpgfscope
390 }
391 }% %>>>
392
393
394 %% This are strange, and probably wrong FIXME
395 % \compattikzset{vdd/.style = {\comnpatname vcc = #1}}
396 % \compattikzset{vss/.style = {\comnpatname vee = #1}}
397 \pgfcirc@style@to@style{vcc}{vdd}
398 \pgfcirc@style@to@style{vee}{vss}
399
400
401 %%%%%%%%%%%%%%
402 %% RF bipoles and monopoles
403 %%%%%%%%%%%%%%
404
405 %% RF bipoles and monopoles settings %<<<1
406 \ctikzset{bipoles/mstline/height/.initial=0.3}
407 \ctikzset{bipoles/mstline/width/.initial=1.2}
408 \pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
409 \ctikzset{monopoles/msport/width/.initial=.5}
410 \ctikzset{monopoles/msrstub/height/.initial=1.0}
411 \ctikzset{monopoles/msrstub/width/.initial=0.6}%
412 % suggested by the TeX-SX answer https://tex.stackexchange.com/a/757589/38080
413 \ctikzset{monopoles/msrstub/radius/.initial=0.25}% public, thanks to @cis suggestion!
414 %>>>
415
416 %% Node shapes for RF bipoles%<<<
417 \ctikzset{bipoles/tline/height/.initial=.3}
418 \ctikzset{bipoles/tline/width/.initial=.6}
419 \newif\ifpgf@circ@bare@tline
420 \ctikzset{bipoles/tline/bare/.is if=pgf@circ@bare@tline}
421 \pgfcircdeclarebipolescaled{RF}
422 {
423 \savedmacro{\recessright}{\edef\recessright{\ifpgf@circ@bare@tline -0.4\else 0.0\fi}}
424 \anchor{center right}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@y=0pt}
425 \anchor{top right}{\northeast \advance\pgf@x by -0.4\pgf@y}
426 \anchor{bottom right}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@y=-\pgf@y}
427 \anchor{center left}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@x=-\pgf@x\pgf@y=0pt}
428 \anchor{top left}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@x=-\pgf@x}
429 \anchor{bottom left}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
430 \anchor{right}{\northeast \advance\pgf@x by \recessright\pgf@y\pgf@y=0pt}
431 }
432 {\ctikzvalof{bipoles/tline/height}}
433 {tline}
434 {\ctikzvalof{bipoles/tline/height}}
435 {\ctikzvalof{bipoles/tline/width}}
436 {
437 \pgf@circ@res@step=.4\pgf@circ@res@up % the size of the ellipsis is proportional to the height
438 \pgfscope
439 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
440 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
441 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
442 \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
443 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
444 \pgfpatharc{-90}{90}{\pgf@circ@res@step and \pgf@circ@res@up}
445 \pgf@circ@draworfill
446 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
447 \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
448 \pgfusepath{stroke}
449 \endpgfscope
450 \ifpgf@circ@bare@tline\else
451 \pgfsetlinewidth{\pgfstartlinewidth}
452 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
453 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
454 \pgfusepath{stroke}
455 \fi
456 }
457
458 % microstrip transmission line
459 \pgfcircdeclarebipolescaled{RF}
460 {}
461 {\ctikzvalof{bipoles/mstline/height}}
462 {mstline}
463 {\ctikzvalof{bipoles/mstline/height}}
464 {\ctikzvalof{bipoles/mstline/width}}
465 {
466 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
467 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
468 \pgf@circ@draworfill
469 }% %>>>
470
471 %% Path definitions for RF path objects%<<<
472 \pgfcirc@activate@bipole@simple{l}{mstline}
473 \pgfcirc@activate@bipole@simple{l}{tline}
474 \pgfcirc@style@to@style{tline}{transmission line}
475 \pgfcirc@style@to@style{tline}{TL}
476 % %>>>
477
478 %% Node shapes for RF monopoles%<<<
479
480 % Legacy tlinestub
481 % Contributed by Leonardo Azzinnari
482 \pgfdeclareshape{tlinestub}{
483 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
484 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
485 \savedanchor{\northeast}{%
486 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
487 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
488 \pgf@x=1.2\pgf@circ@res@step
489 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
490 \pgf@y=.2\pgf@circ@res@step%
491 }
492 % the center is on the left side of the shape for facility of usage
493 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
494 \anchor{east}{\northeast\pgf@y=0cm\relax}
495 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0.5\pgf@x\relax}
496 \anchor{west}{\pgfpointorigin}
497 \anchor{north east}{\northeast}
498 \anchor{north west}{\northeast\pgf@x=0cm\relax}
499 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
500 \anchor{south west}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y}
501 \anchor{center}{\pgfpointorigin}
502 % this is not exact, but it's better than nothing
503 % corrected for stable text; probably should take into account depth
504 \savedanchor{\textoffset}{%
505 \pgfpoint{-.5\wd\pgfnodeparttextbox}
506 {-.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox}%
507 }
508 \anchor{text}{\pgfextractx{\pgf@xa}{\textoffset}\pgfextracty{\pgf@ya}{\textoffset}%
509 \northeast\pgf@x=0.8\pgf@x\advance\pgf@x by \pgf@xa
510 \advance\pgf@y by \pgf@ya
511 }
512 \pgf@circ@draw@component{
513 \pgfstartlinewidth=\pgflinewidth
514
515 \pgf@circ@scaled@Rlen=\scaledRlen
516 \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width}\pgf@circ@scaled@Rlen
517
518 \pgfscope
519 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
520 \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
521 \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
522 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
523 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
524 \pgfpatharc{90}{-90}{-0.125\pgf@circ@res@step and -0.25\pgf@circ@res@step}
525 \pgf@circ@draworfill
526 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
527 \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
528 \pgfusepath{stroke}
529 \endpgfscope
530 \pgfpathmoveto{\pgfpointorigin}
531 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
532 \pgfusepath{draw}
533 }
534 }
535
536 %% New antennas without tails
537
538 % main body of antennas
539 \def\pgf@circ@antennabody{%
540 \pgfstartlinewidth=\pgflinewidth
541 \pgf@circ@scaled@Rlen=\scaledRlen
542 \pgf@circ@setcolor
543 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
544 \pgfscope
545 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
546 \pgfpathmoveto{\pgfpointorigin}
547 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{2\pgf@circ@res@step}}
548 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{2\pgf@circ@res@step}}
549 \pgfsetbeveljoin
550 \pgfpathclose
551 \pgf@circ@draworfill
552 \endpgfscope
553 \pgfsetlinewidth{\pgfstartlinewidth}
554 \pgfpathmoveto{\pgfpointorigin}
555 \pgfpathlineto{\pgfpoint{0pt}{2\pgf@circ@res@step}}
556 \pgfusepath{draw}
557 }
558
559 % Waves for the antennas.
560 \def\pgf@circ@antennawaves{%
561 \pgfscope
562 % define a triangle for clipping the waves
563 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@step}}
564 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{3\pgf@circ@res@step}}
565 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{-1\pgf@circ@res@step}}
566 \pgfpathclose
567 \pgfusepath{clip}
568 % ...and build the waves as clipped circles
569 \pgf@circ@count@a=8\pgf@circ@res@other=0.5\pgf@circ@res@step
570 \pgfmathloop%
571 \ifnum\pgf@circ@count@a>2
572 \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\pgf@circ@count@a*\pgf@circ@res@other}
573 \advance\pgf@circ@count@a-1\relax%
574 \repeatpgfmathloop
575 \pgfusepath{draw}
576 \endpgfscope
577 }
578
579 % additional shape with the waves
580 \pgfdeclareshape{waves}{
581 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
582 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
583 \anchor{center}{\pgfpointorigin}
584 \savedanchor{\northeast}{
585 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
586 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
587 \pgf@x=\pgf@circ@res@step
588 \pgf@y=\pgf@circ@res@step
589 }
590 \savedanchor{\textoffset}{%
591 \pgf@y=\dimexpr+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
592 }
593 \anchor{text}{\pgfextracty{\pgf@ya}{\textoffset}%
594 \northeast\advance\pgf@y by \pgf@ya
595 }
596 \anchor{top}{\northeast\pgf@x=0pt}
597 \anchor{right}{\northeast\pgf@y=0pt}
598 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
599 \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
600 \anchor{north}{\northeast\pgf@x=0pt}
601 \anchor{north east}{\northeast}
602 \anchor{east}{\northeast\pgf@y=0pt}
603 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
604 \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
605 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
606 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
607 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
608 \pgf@circ@draw@component{
609 \pgf@circ@scaled@Rlen=\scaledRlen
610 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
611 \pgf@circ@res@step=0.5\pgf@circ@res@step
612 \pgf@circ@setcolor
613 \pgfscope
614 % define a triangle for clipping the waves
615 \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
616 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{2\pgf@circ@res@step}}
617 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-2\pgf@circ@res@step}}
618 \pgfpathclose
619 \pgfusepath{clip}
620 % ...and build the waves as clipped circles
621 \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step
622 \pgfmathloop%
623 \ifnum\c@pgf@counta>1
624 \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other}
625 \advance\c@pgf@counta-1\relax%
626 \repeatpgfmathloop
627 \pgfusepath{draw}
628 \endpgfscope
629 }
630 }
631
632 \pgfdeclareshape{harmonics}{
633 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
634 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
635 \anchor{center}{\pgfpointorigin}
636 \savedanchor{\northeast}{
637 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
638 \pgf@circ@res@step=\ctikzvalof{monopoles/harmonics/width}\pgf@circ@scaled@Rlen
639 \pgf@x=\pgf@circ@res@step
640 \pgf@y=\pgf@circ@res@step
641 }
642 % text in the same position as waves
643 \savedanchor{\textoffset}{%
644 \pgf@y=\dimexpr+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
645 }
646 \anchor{text}{\pgfextracty{\pgf@ya}{\textoffset}%
647 \northeast\advance\pgf@y by \pgf@ya
648 }
649 \anchor{top}{\northeast\pgf@x=0pt}
650 \anchor{right}{\northeast\pgf@y=0pt}
651 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
652 \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
653 \anchor{north}{\northeast\pgf@x=0pt}
654 \anchor{north east}{\northeast}
655 \anchor{east}{\northeast\pgf@y=0pt}
656 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
657 \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
658 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
659 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
660 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
661 \pgf@circ@draw@component{
662 \pgf@circ@scaled@Rlen=\scaledRlen
663 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
664 \pgf@circ@res@step=0.5\pgf@circ@res@step
665 \pgf@circ@setcolor
666 \pgfscope
667 % define a triangle for clipping the waves
668 \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
669 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{1\pgf@circ@res@step}}
670 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-1\pgf@circ@res@step}}
671 \pgfpathclose
672 \pgfusepath{clip}
673 % ...and build the waves as clipped circles
674 \c@pgf@counta=32\pgf@circ@res@other=0.125\pgf@circ@res@step
675 \pgfmathloop%
676 \ifnum\c@pgf@counta>1
677 \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other}
678 \advance\c@pgf@counta-1\relax%
679 \repeatpgfmathloop
680 \pgfusepath{draw}
681 \endpgfscope
682 }
683 }
684
685 % the four types of antennas: simple, din, TX, RX. Notice that you can flip them...
686 %
687 \pgfdeclareshape{bareantenna}{
688 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
689 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
690 \anchor{center}{\pgfpointorigin}
691 \savedanchor{\northeast}{
692 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
693 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
694 \pgf@x=\pgf@circ@res@step
695 \pgf@y=2\pgf@circ@res@step
696 }
697 % stabilize all the factors in the text anchor position
698 \savedmacro{\labelxanchor}{\edef\labelxanchor{\ctikzvalof{monopoles/bareantenna/label/xanchor}}}
699 \savedmacro{\labelyanchor}{\edef\labelyanchor{\ctikzvalof{monopoles/bareantenna/label/yanchor}}}
700 \savedanchor{\textoffset}{%
701 \pgf@y=\dimexpr+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
702 }
703 \anchor{text}{\pgfextracty{\pgf@ya}{\textoffset}%
704 \northeast
705 \pgf@x=\labelxanchor\pgf@x
706 \pgf@y=\dimexpr\labelyanchor\pgf@y+\pgf@ya\relax
707 }
708 \anchor{top}{\northeast\pgf@x=0pt}
709 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
710 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
711 \anchor{bottom}{\pgfpointorigin}
712 \anchor{north}{\northeast\pgf@x=0pt}
713 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
714 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
715 \anchor{south}{\pgfpointorigin}
716 \anchor{north east}{\northeast}
717 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
718 \anchor{south east}{\northeast\pgf@y=0pt\relax}
719 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
720 \pgf@circ@draw@component{
721 \pgf@circ@antennabody
722 }
723 }
724 %
725 \pgfdeclareshape{dinantenna}{
726 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
727 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
728 \anchor{center}{\pgfpointorigin}
729 \savedanchor{\northeast}{
730 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
731 \pgf@circ@res@step=\ctikzvalof{monopoles/dinantenna/width}\pgf@circ@scaled@Rlen
732 \pgf@circ@res@other=\ctikzvalof{monopoles/dinantenna/height}\pgf@circ@scaled@Rlen
733 \pgf@x=\pgf@circ@res@step
734 \pgf@y=\pgf@circ@res@other
735 }
736 \savedanchor{\textoffset}{%
737 \pgf@y=\dimexpr+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
738 }
739 \anchor{text}{\pgfextracty{\pgf@ya}{\textoffset}%
740 \northeast
741 \pgf@y=\dimexpr.5\pgf@y+\pgf@ya\relax
742 }
743 \anchor{top}{\northeast\pgf@x=0pt}
744 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
745 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
746 \anchor{bottom}{\pgfpointorigin}
747 \anchor{north}{\northeast\pgf@x=0pt}
748 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
749 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
750 \anchor{south}{\pgfpointorigin}
751 \anchor{north east}{\northeast}
752 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
753 \anchor{south east}{\northeast\pgf@y=0pt\relax}
754 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
755 \pgf@circ@draw@component{
756 \pgfstartlinewidth=\pgflinewidth
757 \pgf@circ@scaled@Rlen=\scaledRlen
758 \pgf@circ@setcolor
759 \pgf@circ@res@right=\ctikzvalof{monopoles/dinantenna/width}\pgf@circ@scaled@Rlen
760 \pgf@circ@res@up=\ctikzvalof{monopoles/dinantenna/height}\pgf@circ@scaled@Rlen
761 \pgfscope
762 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
763 \pgfpathmoveto{\pgfpointorigin}
764 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
765 \pgfpathmoveto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
766 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@up}}
767 \pgfpathmoveto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
768 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
769 \pgfpathmoveto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
770 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
771 \pgfusepath{draw}
772 \endpgfscope
773 }
774 }
775
776 \pgfdeclareshape{bareTXantenna}{
777 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
778 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
779 \anchor{center}{\pgfpointorigin}
780 \savedanchor{\northeast}{
781 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
782 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
783 \pgf@x=\pgf@circ@res@step
784 \pgf@y=2\pgf@circ@res@step
785 }
786 \savedanchor{\savedwaves}{
787 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
788 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
789 \pgf@x=4.2\pgf@circ@res@step
790 \pgf@y=\pgf@circ@res@step
791 }
792 % stabilize all the factors in the text anchor position
793 \savedmacro{\labelxanchor}{\edef\labelxanchor{\ctikzvalof{monopoles/bareantenna/label/xanchor}}}
794 \savedmacro{\labelyanchor}{\edef\labelyanchor{\ctikzvalof{monopoles/bareantenna/label/yanchor}}}
795 \savedanchor{\textoffset}{%
796 \pgf@x=\wd\pgfnodeparttextbox
797 \pgf@y=\dimexpr+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
798 }
799 \anchor{text}{\pgfextractx{\pgf@xa}{\textoffset}\pgfextracty{\pgf@ya}{\textoffset}%
800 \northeast
801 \pgf@x=\dimexpr-\labelxanchor\pgf@x-\pgf@xa\relax
802 \pgf@y=\dimexpr\labelyanchor\pgf@y+\pgf@ya\relax
803 }
804 \anchor{waves}{\savedwaves}
805 \anchor{top}{\northeast\pgf@x=0pt}
806 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
807 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
808 \anchor{bottom}{\pgfpointorigin}
809 \anchor{north}{\northeast\pgf@x=0pt}
810 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
811 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
812 \anchor{south}{\pgfpointorigin}
813 \anchor{north east}{\northeast}
814 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
815 \anchor{south east}{\northeast\pgf@y=0pt\relax}
816 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
817 \pgf@circ@draw@component{
818 \pgf@circ@antennabody
819 \pgf@circ@antennawaves
820 }
821 }
822
823 \pgfdeclareshape{bareRXantenna}{
824 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
825 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
826 \anchor{center}{\pgfpointorigin}
827 \savedanchor{\northeast}{
828 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
829 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
830 \pgf@x=\pgf@circ@res@step
831 \pgf@y=2\pgf@circ@res@step
832 }
833 \savedanchor{\savedwaves}{
834 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
835 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
836 \pgf@x=-4.2\pgf@circ@res@step
837 \pgf@y=\pgf@circ@res@step
838 }
839 % stabilize all the factors in the text anchor position
840 \savedmacro{\labelxanchor}{\edef\labelxanchor{\ctikzvalof{monopoles/bareantenna/label/xanchor}}}
841 \savedmacro{\labelyanchor}{\edef\labelyanchor{\ctikzvalof{monopoles/bareantenna/label/yanchor}}}
842 \savedanchor{\textoffset}{%
843 \pgf@y=\dimexpr+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
844 }
845 \anchor{text}{\pgfextracty{\pgf@ya}{\textoffset}%
846 \northeast
847 \pgf@x=\labelxanchor\pgf@x
848 \pgf@y=\dimexpr\labelyanchor\pgf@y+\pgf@ya\relax
849 }
850 \anchor{waves}{\savedwaves}
851 \anchor{top}{\northeast\pgf@x=0pt}
852 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
853 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
854 \anchor{bottom}{\pgfpointorigin}
855 \anchor{north}{\northeast\pgf@x=0pt}
856 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
857 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
858 \anchor{south}{\pgfpointorigin}
859 \anchor{north east}{\northeast}
860 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
861 \anchor{south east}{\northeast\pgf@y=0pt\relax}
862 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
863 \pgf@circ@draw@component{
864 \pgf@circ@antennabody
865 \pgftransformxshift{-5.2\pgf@circ@res@step}
866 \pgf@circ@antennawaves
867 }
868 }
869
870 %%% dynodes (see https://github.com/circuitikz/circuitikz/issues/469)
871 \ctikzset{monopoles/dynode/width/.initial=0.4}
872 \ctikzset{monopoles/dynode/height/.initial=0.8}
873 \ctikzset{monopoles/dynode/arc pos/.initial=0.5}
874 \ctikzset{monopoles/dynode/arc angle/.initial=30}
875 \ctikzset{monopoles/dynode/top width/.initial=1.0}
876
877 \pgfdeclareshape{dynode}{
878 \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}}
879 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
880 \anchor{center}{\pgfpointorigin}
881 \savedanchor{\northeast}{
882 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
883 \pgf@x=\ctikzvalof{monopoles/dynode/width}\pgf@circ@scaled@Rlen
884 \pgf@x=0.5\pgf@x
885 \pgf@y=\ctikzvalof{monopoles/dynode/height}\pgf@circ@scaled@Rlen
886 }
887 \savedanchor{\arcpos}{% bottom part of the arc pos
888 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
889 \pgf@x=0pt
890 \pgf@y=\ctikzvalof{monopoles/dynode/height}\pgf@circ@scaled@Rlen
891 \pgf@y=\ctikzvalof{monopoles/dynode/arc pos}\pgf@y
892 }
893 \savedanchor{\topright}{%
894 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
895 \pgf@x=\ctikzvalof{monopoles/dynode/width}\pgf@circ@scaled@Rlen
896 \pgf@x=\ctikzvalof{monopoles/dynode/top width}\pgf@x
897 \pgf@x=0.5\pgf@x
898 \pgf@y=\ctikzvalof{monopoles/dynode/height}\pgf@circ@scaled@Rlen
899 }
900 \anchor{arc}{\arcpos}
901 \anchor{top right}{\topright}
902 \anchor{top left}{\topright\pgf@x=-\pgf@x}
903 \savedanchor{\textoffset}{%
904 \pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
905 }
906 \anchor{text}{\pgfextracty{\pgf@ya}{\textoffset}%
907 \northeast
908 \advance\pgf@x by 4pt\relax
909 \pgf@y=\dimexpr0.5\pgf@y+\pgf@ya\relax
910 }
911 \anchor{top}{\northeast\pgf@x=0pt}
912 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
913 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
914 \anchor{bottom}{\pgfpointorigin}
915 \anchor{north}{\northeast\pgf@x=0pt}
916 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
917 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
918 \anchor{south}{\pgfpointorigin}
919 \anchor{north east}{\northeast}
920 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
921 \anchor{south east}{\northeast\pgf@y=0pt\relax}
922 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
923 \pgf@circ@draw@component{
924 \pgfstartlinewidth=\pgflinewidth
925 \pgf@circ@scaled@Rlen=\scaledRlen
926 \pgf@circ@setcolor
927 \northeast
928 \pgf@circ@res@right=\pgf@x
929 \pgf@circ@res@up=\pgf@y
930 \arcpos
931 \pgf@circ@res@step=\pgf@y
932 % top
933 \pgfscope
934 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
935 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{monopoles/dynode/top width}*\pgf@circ@res@right}{\pgf@circ@res@up}}
936 \pgfpathlineto{\pgfpoint{\ctikzvalof{monopoles/dynode/top width}*\pgf@circ@res@right}{\pgf@circ@res@up}}
937 \pgfusepath{draw}
938 \endpgfscope
939 % arc
940 \edef\@@angle{\ctikzvalof{monopoles/dynode/arc angle}}
941 \ifnum90=\@@angle\else % avoid divisions by zero
942 % radius
943 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@res@right/cos(\@@angle)}
944 % start angle y position
945 \pgfmathsetlength{\pgf@circ@res@step}{\pgf@circ@res@step+\pgf@circ@res@other*(1-sin(\@@angle))}
946 \pgfsetlinewidth{\pgfstartlinewidth}
947 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@step}}
948 \pgfpatharc{-180+\@@angle}{-\@@angle}{\pgf@circ@res@other}
949 \fi
950 % tail
951 \pgfpathmoveto{\pgfpointorigin}
952 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
953 \pgfusepath{draw}
954 }
955 }
956 % Microstrip monopoles
957
958 \pgfdeclareshape{mslstub}{
959 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
960 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
961 \savedanchor{\southeast}{
962 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
963 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
964 \pgf@x=.5\pgf@x
965 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
966 \pgf@y=-.5\pgf@y
967 }
968 \savedanchor{\northwest}{
969 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
970 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
971 \pgf@x=-.5\pgf@x
972 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
973 \pgf@y=.5\pgf@y
974 }
975 \anchor{north}{\northwest\pgf@x=0pt\relax}
976 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
977 \anchor{east}{\southeast\pgf@y=0pt\relax}
978 \anchor{south east}{\southeast}
979 \anchor{south}{\southeast\pgf@x=0pt\relax}
980 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
981 \anchor{west}{\northwest\pgf@y=0pt\relax}
982 \anchor{north west}{\northwest}
983 %
984 \anchor{center}{\northwest\pgf@y=0pt\relax}
985 \anchor{left}{\northwest\pgf@y=0pt\relax}
986 \anchor{right}{\southeast\pgf@y=0pt\relax}
987 % put the node text above and centered
988 \savedanchor{\textoffset}{%
989 \pgfpoint{-.5\wd\pgfnodeparttextbox}%
990 {.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox}%
991 }
992 \anchor{text}{\pgfextractx{\pgf@xa}{\textoffset}\pgfextracty{\pgf@ya}{\textoffset}%
993 \pgfextracty{\pgf@circ@res@up}{\northwest}%
994 \pgfpoint{\pgf@xa}{\pgf@ya+\pgf@circ@res@up}%
995 }
996 \pgf@circ@draw@component{
997 \pgfextracty{\pgf@circ@res@up}{\northwest}
998 \pgfextractx{\pgf@circ@res@right}{\southeast}
999 \pgfextractx{\pgf@circ@res@left}{\northwest}
1000 \pgfextracty{\pgf@circ@res@down}{\southeast}
1001 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
1002 \pgfstartlinewidth=\pgflinewidth
1003 \pgfscope
1004 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
1005 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
1006 \pgf@circ@draworfill
1007 \endpgfscope
1008 }
1009 }
1010
1011 \pgfdeclareshape{msrstub}{
1012 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
1013 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
1014 \savedanchor{\southeast}{
1015 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
1016 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
1017 \pgf@x=.5\pgf@x
1018 \pgf@y=0pt\relax
1019 }
1020 \savedanchor{\northwest}{
1021 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
1022 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
1023 \pgf@x=-.5\pgf@x
1024 \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@scaled@Rlen
1025 \pgf@y=.5\pgf@y
1026 }
1027 \anchor{north}{\northwest\pgf@x=0pt\relax}
1028 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
1029 \anchor{east}{\southeast\pgf@y=0pt\relax}
1030 \anchor{south east}{\southeast}
1031 \anchor{south}{\southeast\pgf@x=0pt\relax}
1032 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
1033 \anchor{west}{\northwest\pgf@y=0pt\relax}
1034 \anchor{north west}{\northwest}
1035 %
1036 \anchor{center}{\pgfpointorigin}
1037 \anchor{left}{\pgfpointorigin}
1038 \anchor{right}{\pgfpointorigin}
1039 % put the node text above and centered
1040 \savedanchor{\textoffset}{%
1041 \pgfpoint{-.5\wd\pgfnodeparttextbox}%
1042 {.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox}%
1043 }
1044 \anchor{text}{\pgfextractx{\pgf@xa}{\textoffset}\pgfextracty{\pgf@ya}{\textoffset}%
1045 \pgfextracty{\pgf@circ@res@up}{\northwest}%
1046 \pgfpoint{\pgf@xa}{\pgf@ya+\pgf@circ@res@up}%
1047 }
1048 \pgf@circ@draw@component{
1049 \pgfextracty{\pgf@circ@res@up}{\northwest}
1050 \pgfextractx{\pgf@circ@res@right}{\southeast}
1051 \pgfextractx{\pgf@circ@res@left}{\northwest}
1052 \pgfextracty{\pgf@circ@res@down}{\southeast}
1053 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{monopoles/msrstub/radius}*\pgf@circ@res@up}
1054 \pgfstartlinewidth=\pgflinewidth
1055 \pgfscope
1056 \pgfpathmoveto{\pgfpointorigin}
1057 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
1058 \ifdim\pgf@circ@res@step>0pt
1059 % avoid drawing the smaller arc if the user selected 0!
1060 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@step}}
1061 \pgfusepath{draw}
1062 \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@step}}
1063 \pgfpatharc{135}{45}{\pgf@circ@res@step}
1064 \fi
1065 \pgfpathlineto{\pgfpointpolar{45}{\pgf@circ@res@up}}
1066 \pgfpatharc{45}{135}{\pgf@circ@res@up}
1067 \pgfpathclose
1068 \pgf@circ@draworfill
1069 \endpgfscope
1070 }
1071 }
1072
1073 \pgfdeclareshape{msport}{
1074 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
1075 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
1076 \savedanchor{\southeast}{
1077 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
1078 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
1079 \pgf@x=.5\pgf@x
1080 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
1081 \pgf@y=-.5\pgf@y
1082 }
1083 \savedanchor{\northwest}{
1084 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
1085 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
1086 \pgf@x=-.5\pgf@x
1087 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
1088 \pgf@y=.5\pgf@y
1089 }
1090 \anchor{north}{\northwest\pgf@x=0pt\relax}
1091 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
1092 \anchor{east}{\southeast\pgf@y=0pt\relax}
1093 \anchor{south east}{\southeast}
1094 \anchor{south}{\southeast\pgf@x=0pt\relax}
1095 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
1096 \anchor{west}{\northwest\pgf@y=0pt\relax}
1097 \anchor{north west}{\northwest}
1098 %
1099 \anchor{center}{\northwest\pgf@y=0pt\relax}
1100 \anchor{left}{\northwest\pgf@y=0pt\relax}
1101 \anchor{right}{\southeast\pgf@y=0pt\relax}
1102 % put the node text inside and centered
1103 \savedanchor{\textanchor}{
1104 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
1105 \dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
1106 }
1107 }
1108 \anchor{text}{\textanchor}
1109 \pgf@circ@draw@component{
1110 \pgfextracty{\pgf@circ@res@up}{\northwest}
1111 \pgfextractx{\pgf@circ@res@right}{\southeast}
1112 \pgfextractx{\pgf@circ@res@left}{\northwest}
1113 \pgfextracty{\pgf@circ@res@down}{\southeast}
1114 \pgfmathsetlength{\pgf@circ@res@step}{0.5*\pgf@circ@res@up}
1115 \pgfstartlinewidth=\pgflinewidth
1116 \pgfscope
1117 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
1118 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
1119 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
1120 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
1121 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
1122 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@down}}
1123 \pgfpathclose
1124 \pgf@circ@draworfill
1125 \endpgfscope
1126 }
1127 }
1128
1129 % Legacy antennas (with tails)
1130 \def\pgf@circ@shift@antenna@xy#1#2{%
1131 \pgf@y=\dimexpr\pgf@y+#2\pgf@circ@res@step
1132 \pgf@x=\dimexpr\pgf@x+#1\pgf@circ@res@step
1133 \relax}
1134
1135 % Legacy antenna
1136 \pgfdeclareshape{antenna}{
1137 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
1138 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
1139 \anchor{center}{\pgfpointorigin}
1140 \savedanchor{\northeast}{
1141 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
1142 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
1143 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
1144 \pgf@y=4\pgf@circ@res@step
1145 }
1146 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
1147 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
1148 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
1149 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
1150 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
1151 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
1152 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
1153 \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{4}}
1154 % stabilize all the factors in the text anchor position
1155 \savedmacro{\labelxanchor}{\edef\labelxanchor{\ctikzvalof{monopoles/antenna/label/xanchor}}}
1156 \savedmacro{\labelyanchor}{\edef\labelyanchor{\ctikzvalof{monopoles/antenna/label/yanchor}}}
1157 \anchor{text}{% stable, but this text label position is not taking into account the text size.
1158 \northeast
1159 \pgf@x=\labelxanchor\pgf@x
1160 \pgf@y=\labelyanchor\pgf@y
1161 }
1162 \pgf@circ@draw@component{
1163 \pgfstartlinewidth=\pgflinewidth
1164 \pgf@circ@scaled@Rlen=\scaledRlen
1165 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
1166
1167 \pgftransformxshift{ -4\pgf@circ@res@step }
1168
1169 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
1170 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1171
1172 \pgfusepath{draw}
1173
1174 \pgfscope
1175 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1176 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1177 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
1178 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1179 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1180 \pgf@circ@setcolor
1181 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
1182 \pgfusepath{draw}
1183 \endpgfscope
1184 \pgfsetlinewidth{\pgfstartlinewidth}
1185
1186 }
1187 }
1188
1189 % Legacy TX antenna
1190 \pgfdeclareshape{txantenna}{
1191 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
1192 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
1193 \anchor{center}{\pgfpointorigin}
1194 \savedanchor{\northeast}{
1195 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
1196 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
1197 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
1198 \pgf@y=4\pgf@circ@res@step
1199 }
1200 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
1201 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
1202 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
1203 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
1204 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
1205 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
1206 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
1207 \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
1208 % stabilize all the factors in the text anchor position
1209 \savedmacro{\labelxanchor}{\edef\labelxanchor{\ctikzvalof{monopoles/txantenna/label/xanchor}}}
1210 \savedmacro{\labelyanchor}{\edef\labelyanchor{\ctikzvalof{monopoles/txantenna/label/yanchor}}}
1211 \anchor{text}{% stable, but this text label position is not taking into account the text size.
1212 \northeast
1213 \pgf@x=\labelxanchor\pgf@x
1214 \pgf@y=\labelyanchor\pgf@y
1215 }
1216 \pgf@circ@draw@component{
1217 \pgfstartlinewidth=\pgflinewidth
1218 \pgf@circ@scaled@Rlen=\scaledRlen
1219 \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@scaled@Rlen
1220
1221 \pgfpathmoveto{\pgfpointorigin}
1222 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
1223 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
1224 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1225
1226 \pgfusepath{draw}
1227
1228 \pgfscope
1229 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1230 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1231 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
1232 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1233 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1234 \pgf@circ@setcolor
1235 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
1236 \pgfusepath{draw}
1237 \endpgfscope
1238 \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
1239 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
1240 \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
1241 \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
1242 \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
1243 \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
1244 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
1245 \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
1246 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
1247 \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
1248 \pgfusepath{draw}
1249 \pgfsetlinewidth{\pgfstartlinewidth}
1250
1251 }
1252 }
1253
1254 % Legacy RX antenna
1255 \pgfdeclareshape{rxantenna}{
1256 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
1257 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
1258 \anchor{center}{\pgfpointorigin}
1259 \savedanchor{\northeast}{
1260 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
1261 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
1262 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
1263 \pgf@y=4\pgf@circ@res@step
1264 }
1265 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
1266 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
1267 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
1268 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
1269 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
1270 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
1271 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
1272 \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
1273 % stabilize all the factors in the text anchor position
1274 \savedmacro{\labelxanchor}{\edef\labelxanchor{\ctikzvalof{monopoles/rxantenna/label/xanchor}}}
1275 \savedmacro{\labelyanchor}{\edef\labelyanchor{\ctikzvalof{monopoles/rxantenna/label/yanchor}}}
1276 \anchor{text}{% stable, but this text label position is not taking into account the text size.
1277 \northeast
1278 \pgf@x=\labelxanchor\pgf@x
1279 \pgf@y=\labelyanchor\pgf@y
1280 }
1281 \pgf@circ@draw@component{
1282 \pgfstartlinewidth=\pgflinewidth
1283 \pgf@circ@scaled@Rlen=\scaledRlen
1284 \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@scaled@Rlen
1285
1286 \pgfpathmoveto{\pgfpointorigin}
1287 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
1288 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
1289 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1290
1291 \pgfusepath{draw}
1292
1293 \pgfscope
1294 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1295 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1296 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
1297 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1298 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
1299 \pgf@circ@setcolor
1300 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
1301 \pgfusepath{draw}
1302 \endpgfscope
1303
1304 \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
1305 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
1306 \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
1307 \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
1308 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
1309 \pgfpatharc{150}{210}{3\pgf@circ@res@step}
1310 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
1311 \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
1312 \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
1313 \pgfpatharc{150}{210}{2\pgf@circ@res@step}
1314 \pgfusepath{draw}
1315 \pgfsetlinewidth{\pgfstartlinewidth}
1316 }
1317 }
1318
1319 % Legacy match
1320 \pgfdeclareshape{match}{
1321 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
1322 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
1323 \savedanchor{\northeast}{%
1324 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
1325 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
1326 \pgf@x=2\pgf@circ@res@step
1327 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
1328 \pgf@y=.5\pgf@circ@res@step%
1329 }
1330 % the center is on the left side of the shape for facility of usage
1331 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
1332 \anchor{east}{\northeast\pgf@y=0cm\relax}
1333 \anchor{south}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x\relax}
1334 \anchor{west}{\pgfpointorigin}
1335 \anchor{north east}{\northeast}
1336 \anchor{north west}{\northeast\pgf@x=0cm\relax}
1337 \anchor{south east}{\northeast\pgf@y=0pt\relax}
1338 \anchor{south west}{\pgfpointorigin}
1339 \anchor{center}{\pgfpointorigin}
1340 % text under the black triangle
1341 \savedanchor{\textanchor}{
1342 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
1343 \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
1344 \pgf@x=1.5\pgf@x
1345 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
1346 \pgf@y=-1.5\ht\pgfnodeparttextbox
1347 }
1348 \anchor{text}{\textanchor}
1349 \pgf@circ@draw@component{
1350 \pgf@circ@scaled@Rlen=\scaledRlen
1351 \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
1352
1353 \pgfscope
1354 \pgfpathmoveto{\pgfpointorigin}
1355 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
1356 \pgfusepath{draw}
1357
1358 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
1359 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
1360 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
1361 \pgf@circ@fill@strokecolor
1362 \pgfusepath{fill}
1363
1364 \pgfsetlinewidth{\pgfstartlinewidth}
1365 \endpgfscope
1366 }
1367 }
1368 % %>>>
1369
1370 \endinput
1371 % vim: set fdm=marker fmr=%<<<,%>>>: