Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/Windings.m4

raw
1 .PS
2 cct_init
3 # Windings.m4
4 ifelse(xtract(m4postprocessor,pstricks,pgf,mpost,pdf,postscript,svg),,
5 `print "
6 `pstricks, pgf, mpost, pdf, postscript, or svg required for Windings.m4'"',
7 ` s_init(Windings)
8 ifdef(`Windings_1',,`sinclude(FWindings.dim)')
9 sinclude(Circuit_macros.dim)
10 ifdef(`Windings_1',,`sinclude(tst.dim)')
11
12 Toprow:[
13 W1: [ W: winding ]
14 s_box(\tt w{}inding) at last [].s below
15
16 W2: [ winding(R) ] with .n at last "".s+(0,-0.1)
17 s_box(\tt w{}inding(R)) at last [].s below
18
19 W3: [ sk = 0.75
20 d = 1.5*sk
21 p = 0.4*sk
22 w = 1*sk
23
24 define vlight {rgbstring(0.9,0.9,0.9)}
25 W: winding(L,d,p,4,w,vlight)
26
27 thinlines_
28 dimension_(from W.nw+(p/4,0) right p,0.1,s_box(\tt pitch\strut) above,W)
29 dimension_(from W.sw to W.nw,0.2,s_box(\tt diam),H)
30 dimension_(from W.e+(-p/2,-w/2) up w,-0.3,,s_ht)
31 s_box(\tt\hfill core wid) at W.e ljust
32 arrow <- up d-w+0.1 left d/10 from W.ne+(-p/2,-(d-w))
33 s_box(\tt core color) at Here+(-0.2,0) ljust above
34 thicklines_
35 ] with .sw at last [].se+(0.25,0)
36 "\tt T1" at last [].W.T1 below
37 "\tt T2" at last [].W.T2 below
38
39 W4: [
40 boxwid = 0.3
41 boxht = 0.4
42 down_
43 B1: box
44 winding(,boxwid*1.3,boxht/5,3,boxwid) at B1
45 "Left pins" "cw" at B1.s+(0,-0.15)
46 for_(1,2,1,`"\sl\small T`'m4x" at last [].T`'m4x rjust')
47 B2: box at B1.e + (0.5,0)
48 winding(R,boxwid*1.3,boxht/5,3,boxwid) at B2
49 "Left pins" "ccw" at B2.s+(0,-0.15)
50 for_(1,2,1,`"\sl\small T`'m4x" at last [].T`'m4x rjust')
51 up_
52 B3: box at B1.s + (0,-0.55)
53 winding(,boxwid*1.3,boxht/5,3,boxwid) at B3
54 "Right pins" "cw" at B3.s+(0,-0.15)
55 for_(1,2,1,`"\sl\small T`'m4x" at last [].T`'m4x ljust')
56 B4: box at (B2,B3)
57 winding(R,boxwid*1.3,boxht/5,3,boxwid) at B4
58 "Right pins" "ccw" at B4.s+(0,-0.15)
59 for_(1,2,1,`"\sl\small T`'m4x" at last [].T`'m4x ljust')
60 ] with .sw at last [].se+(0.1,0)
61
62
63 W5: [
64 W: arcwinding(,60,120)
65 {`"\tt arcwinding("' at W.s+(0,-12bp__) `"\tt ,60,120)"' }
66 W: arcwinding(,120,60) with .sw at W.se+(0.4,0)
67 {`"\tt $\ldots$(,120,60)"' at last [].s below}
68 W: arcwinding(,60,120,,-dimen_) with .nw at 2nd last [].sw+(0,-0.4)
69 {`"\tt $\ldots$(,60,120,,"' at W.s+(0,-12bp__) `"\tt -dimen\_)"' }
70 W: arcwinding(,120,60,,-dimen_) with .sw at W.se+(0.4,0)
71 {`"\tt $\ldots$(,120,60,,"' at W.s+(0,-12bp__) `"\tt -dimen\_)"' }
72 ] with .nw at last [].ne+(0.3,0)
73
74 ] # end Toprow
75
76 Trans:[
77 Q: box invis ht 1 wid 5/4
78 g = Q.wid/12
79 ironwid = Q.wid/4.5
80
81 line thick ironwid/(1bp__)+linethick from Q.n+(g/2-linethick/2 bp__,0) \
82 to Q.ne then to Q.se then to Q.sw then to Q.nw \
83 then to Q.n+(-g/2+linethick/2 bp__,0)
84 ifmpost(`rgbdraw(0.7,0.7,0.7,')
85 line thick ironwid/(1bp__)-linethick outlined "lightgray" \
86 from Q.n+(g/2+linethick/2 bp__,0) \
87 to Q.ne then to Q.se then to Q.sw then to Q.nw \
88 then to Q.n+(-g/2-linethick/2 bp__,0)
89 ifmpost(`)')
90
91 thinlines_
92 dimension_(from Q.n+(-g/2,-ironwid/2) right g,-ironwid/4,
93 "$g$" below,1,2pt__)
94 thicklines_
95
96 down_
97 P: winding(R,ironwid*5/4,ironwid/2,4,ironwid,"lightgray") at Q.w
98 line left ironwid*2/3 from P.T1
99 arrow right to P.T1 "$i_1$" above
100 line left ironwid*2/3 from P.T2
101 gap(up_ to 2nd last line.end)
102 llabel(-,s_box($v_1$),+)
103 "$N_1$" at P.e ljust
104
105 up_
106 S: winding(L,ironwid*5/4,ironwid/2,4,ironwid,"lightgray") at Q.e
107 line right ironwid*2/3 from S.T2
108 arrow left to S.T2 "$i_2$" above
109 line right ironwid*2/3 from S.T1
110 gap(up_ to 2nd last line.end)
111 rlabel(-,s_box($v_2$),+)
112 "$N_2$" at S.w rjust
113
114 box dashed rad ironwid/4 wid Q.wid ht Q.ht at Q
115 arrow right arrowht from 0.5 between Q.n and Q.ne
116 "$\phi$" ljust at Here+(0,5pt__)
117
118 move up ironwid/2 from Q.n
119 move down ironwid/2 from Q.s
120 ] with .nw at Toprow.sw+(0,-0.2) # end Trans
121
122 [
123 #Torus: circle rad 0.6; circle rad 0.4 at Torus
124 r_ctr = 0.5
125 t_th = 0.2
126 w_th = 0.3
127 Torus: circle rad r_ctr thick t_th/(1bp__)
128 {circle rad r_ctr thick Torus.thick-2*linethick outlined "lightgray" at Torus}
129
130 TN: arcwinding(w_th,110,70,5, r_ctr,t_th,"lightgray") with .C at Torus
131 "\sl T1" at TN.T1 below; "\sl T2" at TN.T2 below
132 TW: arcwinding(w_th,160,200,4,-r_ctr,t_th,"lightgray") with .C at Torus
133 "\sl T1" at TW.T1 above; "\sl T2" at TW.T2 below
134 TE: arcwinding(w_th,20,-20,7,-r_ctr,t_th,"lightgray") with .C at Torus
135 "\sl T1" at TE.T1 above; "\sl T2" at TE.T2 below
136 ] with .nw at last [].ne+(0.15,0)
137
138 ')
139 .PE