diff options
Diffstat (limited to 'graphics/circuit_macros/examples/svg')
-rw-r--r-- | graphics/circuit_macros/examples/svg/AdderSVG.m4 | 2 | ||||
-rw-r--r-- | graphics/circuit_macros/examples/svg/Banking.txt | 54 | ||||
-rw-r--r-- | graphics/circuit_macros/examples/svg/GrayCodeSVG.m4 | 20 | ||||
-rw-r--r-- | graphics/circuit_macros/examples/svg/Makefile | 7 | ||||
-rw-r--r-- | graphics/circuit_macros/examples/svg/RotboxSVG.m4 | 4 | ||||
-rw-r--r-- | graphics/circuit_macros/examples/svg/SierpinskiSVG.m4 | 30 | ||||
-rw-r--r-- | graphics/circuit_macros/examples/svg/TubediagsSVG.m4 | 361 | ||||
-rw-r--r-- | graphics/circuit_macros/examples/svg/examplesSVG.htmx | 4 | ||||
-rw-r--r-- | graphics/circuit_macros/examples/svg/graysurfSVG.m4 | 4 | ||||
-rw-r--r-- | graphics/circuit_macros/examples/svg/icsSVG.m4 | 13 | ||||
-rw-r--r-- | graphics/circuit_macros/examples/svg/lcctSVG.m4 | 17 |
11 files changed, 437 insertions, 79 deletions
diff --git a/graphics/circuit_macros/examples/svg/AdderSVG.m4 b/graphics/circuit_macros/examples/svg/AdderSVG.m4 index cef4d07a8e..6c0de6b5ed 100644 --- a/graphics/circuit_macros/examples/svg/AdderSVG.m4 +++ b/graphics/circuit_macros/examples/svg/AdderSVG.m4 @@ -4,7 +4,7 @@ log_init(svg_font(sans-serif,11bp__)) del = linewid/4 [ # full adder using gates - A: dot; {"A" rjust}; line right + A: dot; { move left 15bp__}; {"A" rjust}; line right Xor1: XOR_gate with .In1 at Here dy = Xor1.In1.y-Xor1.In2.y B: dot(at (A,Xor1.In2)); {"B" rjust}; line to Xor1.In2 diff --git a/graphics/circuit_macros/examples/svg/Banking.txt b/graphics/circuit_macros/examples/svg/Banking.txt deleted file mode 100644 index 122846d1c3..0000000000 --- a/graphics/circuit_macros/examples/svg/Banking.txt +++ /dev/null @@ -1,54 +0,0 @@ -.PS -#Banking.m4 - - command "<g style=\"font-family:Arial\">" - textht = 12*(scale/72)*dptextratio # 12 pt size - - scale = 2.54 # use cm - boxwid = 6.8 - boxht = 4.5 - arrowwid = 0.25 - arrowht = 0.5 - -define heading {"<tspan font-style=\"bold\" font-size=\"120%\" fill=\"white\" ->$1</tspan>"} -define subheading {"<tspan font-style=\"bold\" font-size=\"75%\" fill=\"white\" ->$1</tspan>"} -define wtext {<tspan fill="white">$1</tspan>} - - C: circle diam 2.6 colored "mediumblue" - Person: box rad boxht/4 colored "mediumblue" with .n at C.s+(0,C.rad/8) \ - heading(Personal Banking) \ - "" \ - heading(Customer) \ - subheading(Person) \ - "" \ - wtext(A customer of the bank, with) \ - "wtext(personal bank accounts.)" - -# arrow thick 1.5 dashed down 3.5 from Person.s -# { box invis fill 1 ht 0.4 wid 1.0 "Uses" at last arrow } -# Internet: box colored "steelblue" \ -# "heading(Internet Banking System)" \ -# "subheading(Software system)" \ -# "" \ -# "wtext(Allows customers to view)" \ -# "wtext(information about their bank)" \ -# "wtext(accounts`,' and make payments.)" -# -# arrow thick 1.5 dashed right 5.4 from Internet.e \ -# "Sends e-mail" above "using" below -# Email: box colored "slategrey" \ -# "heading(E-mail System)" \ -# "subheading(Software system)" \ -# "" \ -# "wtext(The internal Microsoft Exchange)" \ -# "wtext(e-mail system..)" -# -# arrow thick 1.5 dashed from Email.nw+(0.4,0) to Person.se+(0.3,Person.ht/5) -# { box invis fill 1 ht 0.4 wid 3.3 "Sends e-mails to" at last arrow } - -# etc - - command "</g>" # font -.PE diff --git a/graphics/circuit_macros/examples/svg/GrayCodeSVG.m4 b/graphics/circuit_macros/examples/svg/GrayCodeSVG.m4 new file mode 100644 index 0000000000..8d11969049 --- /dev/null +++ b/graphics/circuit_macros/examples/svg/GrayCodeSVG.m4 @@ -0,0 +1,20 @@ +.PS +# Gray_code.m4 +gen_init + + outer = 4 + inner = 0.75 + nbits = 10 + +C: circle diam outer + circle diam inner at C + sectors = 2^nbits + lthk = (outer-inner)/2/nbits + for bit = 1 to nbits do { + for is = 2^(bit-1) to sectors by 2^(bit+1) do { + startang = is/sectors*360 + endang = min(startang+(2^bit)/sectors*360,360) + arcd(C,outer/2-(bit-0.5)*lthk,startang,endang) thick lthk/(1bp__) + } + } +.PE diff --git a/graphics/circuit_macros/examples/svg/Makefile b/graphics/circuit_macros/examples/svg/Makefile index eba342fa22..4d604dac40 100644 --- a/graphics/circuit_macros/examples/svg/Makefile +++ b/graphics/circuit_macros/examples/svg/Makefile @@ -7,6 +7,7 @@ M4LIBS = svg.m4 SVGconfig.m4 DPIC = dpic #DPIC = $$HOME/dpic/bu*/p2c/ftp/dpic #DPIC = $$HOME/dpic/bu*/test/dpic +#DPIC = ../../../dpic/bison/dpic .SUFFIXES: .pic .svg .m4 .pic.svg: @@ -25,7 +26,7 @@ CCTSVG = \ CrowSVG.svg CrullerSVG.svg CsourceSVG.svg \ DecoderSVG.svg DemultiplexerSVG.svg DiodesSVG.svg DriveSVG.svg \ EmarrowsSVG.svg \ - FlowSVG.svg FontsSVG.svg FusesSVG.svg GroundsSVG.svg \ + FlowSVG.svg FontsSVG.svg FusesSVG.svg GrayCodeSVG.svg GroundsSVG.svg \ HeadersSVG.svg HeathkitSVG.svg InclepsSVG.svg I2LSVG.svg JackSVG.svg \ LogicSVG.svg LoglogSVG.svg \ MCSVG.svg MixerSVG.svg MotorControlSVG.svg MultiplexerSVG.svg \ @@ -34,8 +35,8 @@ CCTSVG = \ RectifiersSVG.svg RelaySVG.svg RotboxSVG.svg\ SchottkySVG.svg ShiftRSVG.svg SierpinskiSVG.svg \ SixpoleSVG.svg SourcesSVG.svg SQUIDSVG.svg SwitchesSVG.svg \ - TTLnandSVG.svg TgateSVG.svg TtreeSVG.svg \ - ThreeSVG.svg TimerSVG.svg VariableSVG.svg WindingsSVG.svg XformSVG.svg \ + TTLnandSVG.svg TgateSVG.svg TtreeSVG.svg ThreeSVG.svg TimerSVG.svg \ + TubediagsSVG.svg VariableSVG.svg WindingsSVG.svg XformSVG.svg \ controlSVG.svg cscSVG.svg diamondSVG.svg ex00SVG.svg \ ex01SVG.svg ex02SVG.svg ex03SVG.svg ex04SVG.svg ex05SVG.svg ex06SVG.svg \ ex08SVG.svg ex09SVG.svg ex10SVG.svg ex11SVG.svg ex12SVG.svg \ diff --git a/graphics/circuit_macros/examples/svg/RotboxSVG.m4 b/graphics/circuit_macros/examples/svg/RotboxSVG.m4 index a5686ba393..3d4fbde82b 100644 --- a/graphics/circuit_macros/examples/svg/RotboxSVG.m4 +++ b/graphics/circuit_macros/examples/svg/RotboxSVG.m4 @@ -11,9 +11,9 @@ gen_init "r=0.1" at last [] move to last [].ne Point_(0) - [ for_(2,8,2, `rotbox(,,dashed,t=m4x/10) at last []+vec_(boxwid*1.1,0) + [[]; for_(2,8,2, `rotbox(,,dashed,t=m4x/10) at last []+vec_(boxwid*1.1,0) sprintf("t=%g",m4x/10) at last [] ') ] with .nw at last [].ne+(0.1,0) - [ for_(10,16,2, `rotbox(,,dashed,t=m4x/10) at last []+vec_(boxwid*1.1,0) + [[]; for_(10,16,2, `rotbox(,,dashed,t=m4x/10) at last []+vec_(boxwid*1.1,0) sprintf("t=%g",m4x/10) at last [] ') ] with .nw at last [].sw+(0,-0.1) ] diff --git a/graphics/circuit_macros/examples/svg/SierpinskiSVG.m4 b/graphics/circuit_macros/examples/svg/SierpinskiSVG.m4 index 3a014b8a0f..7fbf13bf15 100644 --- a/graphics/circuit_macros/examples/svg/SierpinskiSVG.m4 +++ b/graphics/circuit_macros/examples/svg/SierpinskiSVG.m4 @@ -1,6 +1,7 @@ .PS # Sierpinski.m4 gen_init +[ define Sierpinski { if $1 > 0.04 then { d = $1/2-lh @@ -14,6 +15,7 @@ gen_init r = 4 linethick = 0.2 + #linethick = 1/2 /(1pt__) lw = linethick pt__ /2 s3 = sqrt(3) lh = lw*s3 @@ -21,6 +23,32 @@ gen_init d = r/2-lh shade(0,line from A+(0,lw) right d then up d*s3 left d then down d*s3 left d\ then right d ) -# psset_(linecolor=white) + ifpstricks(`psset_(linecolor=white)') Sierpinski(r/2,A) + + ifpstricks(`psset_(linecolor=black)') + thicklines_ + ] + +# CayleyGraph.m4 +[ +define CayleyGraph { + if $3 > 0 then { + { line to Here+(cosd($2),sind($2))*($1) + exec sprintf("CayleyGraph(%g,%g,%g);",0.5*($1),$2,$3-1); } + { line to Here+(cosd($2+90),sind($2+90))*($1) + exec sprintf("CayleyGraph(%g,%g,%g);",0.5*($1),$2+90,$3-1); } + { line to Here+(cosd($2-90),sind($2-90))*($1) + exec sprintf("CayleyGraph(%g,%g,%g);",0.5*($1),$2-90,$3-1); } + } + } + + size = 2 + depth = 6 + for t=0 to 270 by 90 do { + line from (0,0) to (cosd(t),sind(t)); + { exec sprintf("CayleyGraph(%g,%g,%g);",size/4,t,depth); } + } + ] with .sw at last [].se+(-0.25,0) + .PE diff --git a/graphics/circuit_macros/examples/svg/TubediagsSVG.m4 b/graphics/circuit_macros/examples/svg/TubediagsSVG.m4 new file mode 100644 index 0000000000..cfc87b0a6a --- /dev/null +++ b/graphics/circuit_macros/examples/svg/TubediagsSVG.m4 @@ -0,0 +1,361 @@ +.PS +# TubediagsSVG.m4 + +cct_init(svg_font(sans-serif,11bp__,2bp__)) +include(../tubedefs.m4) + +# Some base diagrams +[ Loopover_(`xv',` + V_`'xv: m4xpand(B_`'xv) ifelse(m4Lx,1,, + `with .Base at last [].Base+(dimen_*3,0)') + "xv" at V_`'xv.Base.s+(0,-dimen_/3) below', + 2AG,2D,4BB,9K) ] + +# Test circuit +[ +Ld: dot + battery(up dimen_,2) + line right_ dimen_ +Pot1: potentiometer(down_ dimen_*2,5) with .Start at Here + line from Pot1.End left_ dimen_ + battery(up_ to Ld,2) +Tg: dot(at Pot1.T1) + source(right_ dimen_ from Pot1.T1,"svg_mu`'A") + line right_ dimen_/3 +Tr: triode with .G1.w at Here + line from Tr.K1.sw to (Tr.K1.sw,Pot1.End); dot + { line down dimen_/2 +B: dot } + source(to (Tg,Here),"V"); corner; line to Tg + line from Tr.P1.c to (Tr.P1.c,Pot1.Start) + source(right_ elen_,"mA"); llabel(-,,+); rlabel(,I`'svg_sub(b)) +Tp: dot + { source(down_ to (Here,B),"V") + llabel(+,,-); rlabel(,E`'svg_sub(b)); dot } + line right_ dimen_/2 then down_ (Here.y-B.y)/2 then right_ dimen_/2 +P2: potentiometer(down_ Tp.y-B.y,5,0.5,-dimen_/6) with .T1 at Here + dot(at P2.End) + line right_ dimen_ from P2.Start; corner + battery(down_ dimen_*3/4,2,R) +T: Here + battery(up_ dimen_*3/4 from (Here,B),2) + line dashed up_ to T "B" ljust + line from (T,B) left T.x-Ld.x+dimen_/2 then up Ld.y-B.y then to Ld + ] with .nw at last [].sw + (0,-dimen_/2) + +define(`OutputXformer',`[ pushdef(`dimen_',dimen_*1.5) + S1: inductor(up_ dimen_*.4,L,3,M) + { line right_ dimen_/4 from last [].e; S2T: dot(,,1) + line from S1.end right_ S2T.x-S1.end.x; S21: dot(,,1) + line from S1.start right_ S2T.x-S1.end.x; S22: dot(,,1) } + move up_ dimen_/8 + S2: inductor(up_ dimen_*.4,L,3,M) + { line right_ dimen_/4 from last [].e; S1T: dot(,,1) + line from S2.end right_ S2T.x-S2.end.x; S11: dot(,,1) + line from S2.start right_ S2T.x-S2.end.x; S12: dot(,,1) } + line down_ dimen_/8 from M4Core1.start + line down_ dimen_/8 from M4Core2.start + P: inductor(down_ dimen_*0.6 with .c at 0.5 between S1.end and S2.start \ + -(dimen_*0.8,0),L,5,) + P1: P.start + P2: P.end + PT: last [].w + popdef(`dimen_')]') + +define(`PowerXformer',`[ pushdef(`dimen_',dimen_*1.5) + S3: inductor(up_ dimen_*.2,L,1,M) + ST3: last [].e + { line up_ dimen_/10 from M4Core1.end; line up_ dimen_/10 from M4Core2.end } + S2: inductor(up_ dimen_*.2 from S3.end+(0,dimen_/10),L,1,M) + { line up_ dimen_/10 from M4Core1.end; line up_ dimen_/10 from M4Core2.end } + S1: inductor(up_ dimen_*.4 from S2.end+(0,dimen_/10),L,3,M) + ST1: last [].e + P: inductor(down_ dimen_*0.6 with .c at 0.5 between S1.end and S3.start \ + -(dimen_*0.8,0),L,5,) + popdef(`dimen_')]') + +# Circuit of 25 W amplifier (adapted from F. Langford-Smith, "Radiotron +# Designer's Handbook," fourth edition, Harrison, NJ, Radio Corporation +# of America, 1952) + +[ Toprail: Here +#{"Toprail"} + resistor(down_ dimen_); rlabel(,100 k) +V1P: dot +#{"V1P" rjust} + line down_ dimen_*3/4 +V1: triode(,W) with .P1 at Here + {"6SL7" at V1.nw above } + resistor(down_ dimen_*3/2 from V1.K1.sw); llabel(,2.2 k) +Rail1: dot +#{"Rail1"} + ground + arrow left_ from V1.G1.w +RP: Here + arrow <- right from (Here,Rail1) to Rail1 + dot(at last arrow) + resistor(up_ 2nd last arrow.y-Here.y); llabel(,22 k); dot + { move left_ dimen_ }; "Pickup" at RP below + capacitor(right_ dimen_ from V1P,C,R); llabel(,0.05 svg_mu) + resistor(down_ dimen_); rlabel(,470 k) +V1o: dot +#{ "V1o" at V1o rjust } + resistor(down_ (Here.y-Rail1.y)/2); rlabel(,22 k) + dot + { capacitor(down_ Here.y-Rail1.y,C); rlabel(,0.01 svg_mu); dot } + line right_ dimen_/2 +R47: resistor(down_ to (Here,Rail1)); llabel(,4.7 M) + line to Rail1 + +Pot1: potentiometer(down_ dimen_,,0.5,dimen_*2/3) \ + with .T1 at (V1o+(elen_+dimen_*2/3,0),V1.G1) + { line from Pot1.Start left_ (Pot1.Start.x-V1o.x)/2 + continue to (Here,V1o) then to V1o } + line from Pot1.End down_ dimen_/3 +Rail2: dot + ground +V2: triode(,E) with .G1.w at Pot1.T1; "6SL7" at V2.ne above + resistor(from Rail2 right_ V2.K1.e.x-Rail2.x); rlabel(,22 k); dot + { capacitor(right_ dimen_,C,R); rlabel(,2 n) +V2k: dot } +#{ "V2k" at V2k above } + { line down_ to (Here,Rail1) + variable(`resistor(right_ dimen_); rlabel(,1 M);') + line up_ to V2k } + line to V2.K1.se + + line from Toprail to (R47,Toprail); dot + { capacitor(down_ dimen_,C); rlabel(10 svg_mu); ground(,T) } + R51k: resistor(right_ dimen_); rlabel(,51 k); dot + { capacitor(down_ dimen_,C); llabel(10 svg_mu); ground(,T) } + dot(at (V2.P1.c,Here)) + resistor(down_ dimen_); llabel(,100 k) +V2p: dot + line to V2.P1 + +V3: triode(,W) with .G1.w at (V2k+(dimen_,0),V2.G1) + " 6SL7" at V3.n below ljust + resistor(from V3.K1.sw to (V3.K1.sw,Rail1)); llabel(,1.5 k); dot; ground + line left_ dimen_/2 + resistor(up_ to (Here,V3.G1)); llabel(,,2.2); rlabel(,,M); dot + { line to V3.G1.w } + line to (Here,V2p); capacitor(left_ to V2p,C,R); rlabel(,3 n) + + dot(at (V3.P1.c,Toprail)); { line to R51k.end } + resistor(down_ dimen_); llabel(,51 k) +V3p: dot +#{"V3p"} + line down_ (Here.y-V3.n.y)/2 +V3q: dot; { line to V3.P1.c } + capacitor(left_ dimen_*2/3,C); rlabel(,.1 svg_mu) + line to (V2k,Here) + resistor(down_ to V2k); rlabel(0.1); llabel( M) +#{"V2k" at V2k} + +V4: triode(,E) with .G1.w at (V3.G1.e+(dimen_*2,0),V3.G1) + "6SL7" at V4.n above rjust + resistor(from V4.K1.se to (V4.K1.se,Rail1)); rlabel(,,1.5 k) +V4k: dot +#{"V4k"} + line left dimen_*3/4 +V4k1: dot + { resistor(up_ V4.G1.y-Here.y); llabel(,,2.2 M) +V4G: dot } + line from V3p right_ dimen_ + variable(`resistor(down_ to (Here,V4.G1)); llabel(100 k)') +V3o: dot + capacitor(right_ to V4G,C); llabel(,3 n) + line to V4.G1.w + resistor(left_ from V4k1 to (V3o,V4k)); rlabel(,51 k); dot + ground + capacitor(down_ from V3o to Here,C); llabel(,,500 p) + + line from V4.P1.c to (V4.P1.c,V3p); + resistor(up_ dimen_); llabel(,51 k); dot + resistor(left_ to (V3p,Here)); llabel(,10 k) + +V5: triode(,N) with .G1.w at V4.G1.e+(2.25*dimen_,0) + "6SL7" at V5.n above rjust +V6: triode(,SR) with .G1.w at V5.G1.w-(0,dimen_*2.5) + "6SL7" at (V6.w,V6.P1) below rjust + +V4p: dot(at (V4.P1.c,V3p)) +#{"V4p"} + line right_ dimen_*2/3; capacitor(right_ dimen_,C); llabel(,3 p) + line down_ to (Here,V5.G1) +V5G: dot; { line to V5.G1.w } +#{"V5G"} + resistor(down_ dimen_); rlabel(,2.2 M); dot; + resistor(right_ to (V5.K1.sw,Here)); llabel(,1 k) +V5K: dot +#{"V5K"} + line to V5.K1.sw + line from V4k down_ V4k.y-V6.G1.y then right_ V5G.x-V4k.x - dimen_ + capacitor(right_ dimen_,C); rlabel(,3 p) +V6G: dot; { line to V6.G1.w } +#{"V6G"} + resistor(up_ dimen_); llabel(,2.2 M); dot + resistor(right_ to (V6.K1.nw,Here)); llabel(,1 k) +V6K: dot +#{"V6K"} + line to V6.K1.nw + resistor(left_ dimen_*2/3 from (V6G,V6K)); rlabel(,1 k) dot; ground + line to (Here,V5K); resistor(right_ dimen_*2/3); llabel(,1 k) + +PV: dot(at (V4.e.x+dimen_/5,Toprail.y)) +#{"PV"} + line from V6.P1.c down_ V4p.y-V4.P1.c.y +Rail2: dot +#{"Rail2" below} + line from PV to (PV,Rail2); corner + { resistor(right_ to Rail2); llabel(,220 k) } + move up_ dimen_*2/3; dot; line left_ dimen_/2 +V6sw: dot +#{"V6sw"} + capacitor(down_ dimen_*2/3,C); rlabel(,10 svg_mu); ground(,T) + +V5P: dot(at (V6.P1.c,V4p)); { line to V5.P1.c } +#{"V5P"} + resistor(to (Here,Toprail)); rlabel(,220 k) + line to (V4p,Here) + + V7: V_6L6G at (V3,Rail2+(0,-2*dimen_)); "6L6G" at V7.n above ljust + V8: V_6L6G(,R) at V7+(0,-2*dimen_); "6L6G" at V8.s below ljust + line right dimen_/4 from V7.G2.e; resistor(right_ dimen_); llabel(,100); +V9G: dot +#{"V9G"} + line right dimen_/4 from V8.G2.e; resistor(right_ dimen_); llabel(,100); + V9: V_6L6G(,,G2) with .G2.w at V9G+(dimen_/2,0); "6L6G" at V9.n above rjust + V10: V_6L6G(,R,G2) at V9+(0,-2*dimen_); "6L6G" at V10.s below rjust + line from V9G to V9.G2.w + line from V10.G2.w left_ dimen_/2 +L910: line from V9G to (V9G,V10.G2); dot + line left_ dimen_/2 from V7.G1.w +V7G: dot +#{"V7G"} + resistor(down_ to 0.5 between Here and (Here,V10.G1)); rlabel(,220 k) +V7T: dot +#{"V7T"} + { line left_ dimen_/3; corner; ground } + line from V8.G1.w to (V7G,V8.G1); dot + resistor(up_ to V7T); llabel(,220 k) + + line from V9.K1.sw to V10.K1.nw + line from V7.K1.sw to V8.K1.nw +V7K: dot(at last line.c+(0,dimen_/8)) +#{"V7K"} + line left_ dimen_*2; dot + { capacitor(down_ dimen_/2,C); llabel(,50 svg_mu); ground(,T) } +PP: potentiometer(left_ dimen_,,0.5,dimen_/2) with .Start at Here + rlabel(,50 10 W) + corner(,at PP.T1); line left_ dimen_ then up_ dimen_/4 + round(,tubethick) + line thick tubethick up tubeplatelen/3 left tubeplatelen*2/9 + round(,tubethick) + line thick tubethick down tubeplatelen/3 left tubeplatelen*2/9 + line down_ dimen_/4 then left_ dimen_ then up_ dimen_/4 + round(,tubethick) + line thick tubethick up tubeplatelen/3 left tubeplatelen*2/9 + round(,tubethick) + line thick tubethick down tubeplatelen/3 left tubeplatelen*2/9 + line down_ dimen_/4; ground + "1st two 6SL7" at Here+(dimen_*3/4,dimen_/2) above + +V9T: dot(at (L910,V7K)-(0,dimen_/4)) +#{"V9T"} + + line right_ dimen_/2 from V9.G1.e; continue to (Here,V9.P1)+(0,dimen_*2/3) + resistor(left_ to (V7G,Here)); llabel(,100) +V7nw: dot; { line to (Here,V7.G1) } + line right_ dimen_/2 from V10.G1.e; continue to (Here,V10.P1)-(0,dimen_*2/3) + resistor(left_ to (V7G,Here)); rlabel(,100) +V8sw: dot; { line to (Here,V8.G1) } + + line from V9.P1.c up_ dimen_ +V9P: dot + line from V10.P1.c down_ dimen_ +V10P: dot +#{"V10P"} + + line from V7.P1.c up_ V9P.y-V7.P1.y then to V9P + resistor(right_ to (V5.e+(dimen_/4,0),Here)) + rlabel(,"100 k" "2 W") +Rt1: Here + line to (Here,V6.e)+(0,dimen_/6); resistor(up_ dimen_) + llabel(,"100 k" rjust "2 W") + line to (Here,V5K) then to V5K + line from V8.P1.c down_ V8.P1.y-V10P.y then to V10P + resistor(right_ to (V6.e+(dimen_/2,0),Here)) + llabel(,"100 k" "2 W") + resistor(up_ dimen_*3/2) + llabel(,"100 k" rjust "2 W") + line to (Here,V6K) then to V6K + + line from V9T to (V9.e+(dimen_*3/4,0),V9T) +Xout: OutputXformer with .PT at Here + line from Xout.P1 to (Xout.P1,V9P); dot + line from Xout.P2 to (Xout.P1,V10P); dot + line from Xout.PT left_ dimen_/4 +XT: dot + + resistor(from V6sw left_ dimen_); rlabel(,10 k) +XP: dot + { line down_ dimen_; continue to (XT,Here) then to XT } + + capacitor(right_ dimen_*5/4 from V5P,C); llabel(,0.1 svg_mu) + corner; line to (Here,Rail2)-(0,dimen_/2) + continue to (V7nw,Here) then to V7nw + line from V8sw down_ dimen_*5/8 + continue to (Rail2,Here) then to (Rail2,V9.n) + capacitor(up_ dimen_/2,C,R); rlabel(,0.1 svg_mu) + line to Rail2 + + line from XP left_ dimen_*2; dot + { dot(at Here+(dimen_,0)) + { "290 V" at last [].n above } +R100: resistor(down_ dimen_*2/3) + llabel(,"100 k" ljust "2 W"); dot; ground } + { capacitor(down_ dimen_*2/3,C); llabel(,40 svg_mu); dot } + reversed(`inductor',left_ dimen_,L,,M); rlabel(,4 H 300 mA) +Filt: dot + { capacitor(down_ dimen_*2/3,C); llabel(,40 svg_mu) + line to R100.end } + +Pwr: [ + PXform: PowerXformer + line left_ dimen_/4 from PXform.P.start; fuse(left_ dimen_/2,D) + AC1: arrow left_ dimen_/2 + AC2: arrow from PXform.P.end to (AC1.end,PXform.P.end) + "AC" at 0.5 between AC1.end and AC2.end ljust + dot(at PXform.ST3); line right_ dimen_/4; dot + dot(at PXform.ST1); line right_ dimen_/4 then down_ dimen_*3/2; ground(,T) + line from PXform.S2.end right_ dimen_*2.5 then up_ dimen_/4 + Rect2: V_5V4G with .F1.sw at Here; "5V4G" at Rect2.n+(0,dimen_/2) + Rect1: V_5V4G with .e at Rect2.w-(dimen_/2,0); "5V4G" at Rect1.n+(0,dimen_/2) + move to Rect1.F1.sw; line to (Here,PXform.S2.end); dot + move to Rect1.F1.se; line to (Here,PXform.S2.start); dot + move to Rect2.F1.se; line to (Here,PXform.S2.start) +PO: dot + line from Rect1.P1 left_ dimen_/2; dot + { line to (Here,PXform.S1.start) then to PXform.S1.start } + line to (Here,Rect1.n)+(0,dimen_/8) + continue to (Rect1.P2+(dimen_/2,0),Here) + continue to (Here,Rect1.P2) then to Rect1.P2 + line from Rect2.P1 left_ dimen_/2 then up_ Rect2.ht/2+dimen_/4; dot + { line to (Rect2.P2+(dimen_/2,0),Here) + continue to (Here,Rect2.P2) then to Rect2.P2 } + move to PXform.S1.end + line right_ dimen_/8 then up last [].y - Here.y then to last [].w + arrow from PXform.S3.start right_ dimen_ + arrow from PXform.S3.end right_ dimen_ + "5 V" at PXform.S2 + (dimen_*3/4,0) + "6.3 V" at 0.5 between last arrow.end and 2nd last arrow.end ljust + ] with .nw at (RP,Filt)+(0,dimen_/4) + line from Pwr.PXform.S2.start to Pwr.PO + (dimen_*3/4,0); corner + resistor(up_ to (Here,Filt)); rlabel(,"V" ljust "adj"); corner + line to Filt + + ] with .nw at last [].sw+(0,-0.5) + + command "</g>" # end font +.PE diff --git a/graphics/circuit_macros/examples/svg/examplesSVG.htmx b/graphics/circuit_macros/examples/svg/examplesSVG.htmx index 0a5fd2eca9..d4f45ecdef 100644 --- a/graphics/circuit_macros/examples/svg/examplesSVG.htmx +++ b/graphics/circuit_macros/examples/svg/examplesSVG.htmx @@ -310,6 +310,7 @@ cfig(ex02SVG) cfig(RectifiersSVG) cfig(HeathkitSVG) cfig(lcctSVG) +cfig(TubediagsSVG) cfig(sfgSVG) cfig(LogicSVG) cfig(ex08SVG) @@ -323,11 +324,12 @@ cfig(CanLogicSVG) cfig(AlogixSVG) cfig(ABlogixSVG) cfig(XORSVG) +cfig(paletteSVG) cfig(ex00SVG) +cfig(GrayCodeSVG) cfig(CrossbarSVG) cfig(ByteSVG) cfig(RotboxSVG) -cfig(paletteSVG) cfig(randomSVG) cfig(expSVG) cfig(graysurfSVG) diff --git a/graphics/circuit_macros/examples/svg/graysurfSVG.m4 b/graphics/circuit_macros/examples/svg/graysurfSVG.m4 index 9ea5580703..5427b62afc 100644 --- a/graphics/circuit_macros/examples/svg/graysurfSVG.m4 +++ b/graphics/circuit_macros/examples/svg/graysurfSVG.m4 @@ -4,7 +4,7 @@ threeD_init copy "HOMELIB_/dpictools.pic" Overall: [ - +[] Surface:[ # This just draws the facets back to front @@ -184,7 +184,7 @@ Z: arrow from Zv to (project(0,0,1.2)); "z" ljust # Partial rim ellipsearc(maxy*2,maxy*2*sind(elevation),-pi_*1.4,pi_/3) \ with .C at (project(0,0,(maxy^2-1)^2)+linethick bp__/2) -] scaled 1.25 with .s at 1st [].ne+(0,-0.75) +] scaled 1.25 with .s at 2nd [].ne+(0,-0.75) ] scaled 0.85 .PE diff --git a/graphics/circuit_macros/examples/svg/icsSVG.m4 b/graphics/circuit_macros/examples/svg/icsSVG.m4 index 88ea5b65a0..9a1f40634a 100644 --- a/graphics/circuit_macros/examples/svg/icsSVG.m4 +++ b/graphics/circuit_macros/examples/svg/icsSVG.m4 @@ -13,7 +13,6 @@ define(`lg_pinseq',`for_($1,$2,1, $6`'m4x,Pin`'eval($5`'m4x),`$3'`$7',eval($5`'m4x))') ') define(`ic6116',`[ Chip: box wid_ lg_chipwd ht_ 15*lg_pinsep - "6116" at Chip.sw+(0,-2bp__) below ljust lg_pin(Chip.sw_+(0,lg_pinsep),GND,Pin12,w,12) lg_pin(Chip.sw_+(0,2*lg_pinsep),,Pin18,wN,18) "svg_small(CS,75)" wid textht*1.5 at (Chip.w,last line) ljust @@ -33,10 +32,9 @@ define(`ic6116',`[ Chip: box wid_ lg_chipwd ht_ 15*lg_pinsep lg_pinseq(0,7,e,3,8-,A) lg_pinseq(8,9,e,3,31-,A) lg_pin(Chip.se_+(0,13*lg_pinsep),A10,Pin19,e,19) - ]') + `$1']') define(`ic6502',`[ Chip: box wid_ lg_chipwd ht_ 24*lg_pinsep - "6502" at Chip.sw_+(0,-2bp__) below_ ljust_ lg_pin(Chip.sw_+(0,lg_pinsep),V`'svg_small(SS,75),Pin21,w,21) lg_pin(Chip.sw_+(0,2*lg_pinsep),V`'svg_small(SS,75),Pin1,w,1) lg_pin(Chip.sw_+(0,4*lg_pinsep),,Pin34,w,34) @@ -63,11 +61,9 @@ define(`ic6502',`[ Chip: box wid_ lg_chipwd ht_ 24*lg_pinsep lg_pin(Chip.se+(0,23*lg_pinsep),,Pin4,eN,4) "svg_small(IRQ,75)" wid textht*2.0 at (Chip.e,last line) rjust { line left last "".wid from last "".ne+(-1,0)*textoffset } - - ]') + `$1']') define(`ic6522',`[ Chip: box wid_ lg_chipwd ht_ 24*lg_pinsep - "6522" at Chip.sw+(0,-2bp__) below ljust lg_pin(Chip.sw_+(0,lg_pinsep),V`'svg_small(SS,75),Pin1,w,1) lg_pin(Chip.sw_+(0,3*lg_pinsep),CS1,Pin24,w,24) lg_pin(Chip.sw_+(0,4*lg_pinsep),CK,Pin25,w,25) @@ -97,10 +93,9 @@ define(`ic6522',`[ Chip: box wid_ lg_chipwd ht_ 24*lg_pinsep "svg_small(RESET,75)" wid textht*3.8 at (Chip.e,last line) rjust { line left last "".wid from last "".ne+(-1,0)*textoffset } - ]') + `$1']') define(`ic74LS138',`[ Chip: box wid_ lg_chipwd ht_ 11*lg_pinsep - "74LS138" at Chip.sw+(0,-2bp__) below ljust lg_pin(Chip.sw_+(0,lg_pinsep),GND,Pin8,w,8) lg_pin(Chip.sw_+(0,2*lg_pinsep),,Pin4,wN,4) "svg_small(G2a,75)" wid textht*2.0 at (Chip.w,last line) ljust @@ -117,6 +112,6 @@ define(`ic74LS138',`[ Chip: box wid_ lg_chipwd ht_ 11*lg_pinsep lg_pin(Chip.sw_+(0,10*lg_pinsep),V`'svg_small(CC,75),Pin16,w,16) lg_pinseq(0,6,e,2,15-,Y,n) lg_pin(Chip.se_+(0,9*lg_pinsep),Y7,Pin7,eN,7) - ]') + `$1']') divert(0)dnl diff --git a/graphics/circuit_macros/examples/svg/lcctSVG.m4 b/graphics/circuit_macros/examples/svg/lcctSVG.m4 index 0a91b823cc..9994b32309 100644 --- a/graphics/circuit_macros/examples/svg/lcctSVG.m4 +++ b/graphics/circuit_macros/examples/svg/lcctSVG.m4 @@ -20,7 +20,7 @@ del = lg_pinsep jog = del*2/3 right_ -IC1: ic6502 +IC1: ic6502("6502" at Chip.sw+(0,-2bp__) below ljust) \ Vcc: IC1.Pin8.end.x-del-elen_,IC1.Pin4.y+lg_pinsep+3*del Reset: IC1.Pin8.end.x-del,Vcc.y+del @@ -56,7 +56,8 @@ RWB: Here Addr: Here right_ -IC5: ic74LS138 with .Chip.nw at (IC1.Chip.w.x,Addr.y-2*del) +IC5: ic74LS138("74LS138" at Chip.sw+(0,-2bp__) below ljust) \ + with .Chip.nw at (IC1.Chip.w.x,Addr.y-2*del) line from IC5.Pin5.end down_ 3*lg_pinsep ; ground(,T,Groundtype) line from IC5.Pin16.end down_ 1.5*lg_pinsep ; ground(,T,Groundtype) move to IC5.Pin1.end; breakout(3,left,up) @@ -71,7 +72,8 @@ C1: Here } {line from IC1.Pin37.end to (Here,IC1.Pin37)} right_; xtal(right_ 3*del) -IC2: ic6116 with .Chip.nw at Here.x+2*del+lg_plen*L_unit,IC1.Chip.n.y +IC2: ic6116("6116" at Chip.sw+(0,-2bp__) below ljust) \ + with .Chip.nw at Here.x+2*del+lg_plen*L_unit,IC1.Chip.n.y line from IC2.Pin24.end up to (IC2.Pin24.end,Vcc) right_ Or1: OR_gate with .Out at IC2.Pin21.end @@ -89,9 +91,12 @@ RW: Here line down_ lg_pinsep from IC2.Pin20.end ; ground(,T,Groundtype) right_ -IC3: ic6116 with .Chip.nw at IC2.Chip.ne + (IC2.Chip.nw.x - IC1.Chip.ne.x-del,0) -IC4: ic6522 with .Chip.nw at IC3.Chip.ne + (IC2.Chip.nw.x - IC1.Chip.ne.x-del,0) -IC6: ic74LS138 with .Chip.nw at (IC3.Chip.nw,IC5.Chip.nw) +IC3: ic6116("6116" at Chip.sw+(0,-2bp__) below ljust) \ + with .Chip.nw at IC2.Chip.ne + (IC2.Chip.nw.x - IC1.Chip.ne.x-del,0) +IC4: ic6522("6522" at Chip.sw+(0,-2bp__) below ljust) \ + with .Chip.nw at IC3.Chip.ne + (IC2.Chip.nw.x - IC1.Chip.ne.x-del,0) +IC6: ic74LS138("74LS138" at Chip.sw+(0,-2bp__) below ljust) \ + with .Chip.nw at (IC3.Chip.nw,IC5.Chip.nw) line from Vcc to (IC4.Pin34.end.x+del,Vcc.y) line from Reset to (IC4.Pin34.end,Reset) then to IC4.Pin34.end |