summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/svg/RelaySVG.m4
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/circuit_macros/examples/svg/RelaySVG.m4')
-rw-r--r--graphics/circuit_macros/examples/svg/RelaySVG.m4111
1 files changed, 39 insertions, 72 deletions
diff --git a/graphics/circuit_macros/examples/svg/RelaySVG.m4 b/graphics/circuit_macros/examples/svg/RelaySVG.m4
index df633176b0..f4b8152a50 100644
--- a/graphics/circuit_macros/examples/svg/RelaySVG.m4
+++ b/graphics/circuit_macros/examples/svg/RelaySVG.m4
@@ -1,80 +1,47 @@
.PS
-# `Relay.m4'
-cct_init(svg_font(sans-serif,11bp__))
-
-{contact
- {`"contact"' wid 0.8 at last [].s+(0,-0.2)
- "svg_it(P)" rjust at last [].P.w
- "svg_it(O)" ljust at last [].O
- "svg_it(C)" ljust at last [].C }
- move right_ 1.0; contact(R,)
- {`"contact(,R)"' at last [].s+(0,-0.2)
- "svg_it(P)" rjust at last [].P.w
- "svg_it(O)" ljust at last [].O
- "svg_it(C)" ljust at last [].C }
- move right_ 1.0; contact(P)
- {`"contact(P)"' at last [].s+(0,-0.2)
- "svg_it(P)" rjust at last [].P.w
- "svg_it(O)" ljust at last [].O
- "svg_it(C)" ljust at last [].C }
- move right_ 1.0; contact(O,); {`"contact(O,)"' at last [].s+(0,-0.2)}
- move right_ 1.0; contact(C,); {`"contact(C,)"' at last [].s+(0,-0.2)}
-}
-move down 0.8
-right_
-{contact(I)
- {`"contact(I)"' at last [].s+(0,-0.2)
- "svg_it(P)" rjust at last [].P.w
- "svg_it(O)" ljust at last [].O.e
- "svg_it(C)" ljust at last [].C.e }
- move right_ 1.0; contact(RI)
- {`"contact(RI)"' at last [].s+(0,-0.2)
- "svg_it(P)" rjust at last [].P.w
- "svg_it(O)" ljust at last [].O.e
- "svg_it(C)" ljust at last [].C.e }
- move right_ 1.0; contact(PI)
- {`"contact(PI)"' at last [].s+(0,-0.2)
- "svg_it(P)" rjust at last [].P.w
- "svg_it(O)" ljust at last [].O.e
- "svg_it(C)" ljust at last [].C.e }
- move right_ 1.0; contact(OI); {`"contact(OI)"' at last [].s+(0,-0.2)}
- move right_ 1.0; contact(CI); {`"contact(CI)"' at last [].s+(0,-0.2) wid 1}
-}
-move down 1.3
-right_
-{
-relay
- {"svg_it(V1)" rjust at last [].V1
+# RelaySVG
+cct_init
+svg_font(sans-serif,10bp__)
+
+skip = 1.1
+
+R1:relay
+ {"svg_it(V1)" wid 0.16 rjust at last [].V1
"svg_it(V2)" ljust at last [].V2
- "svg_it(P1)" rjust at last [].P1.w
+ "svg_it(P1)" rjust at last [].P1-(dotrad_,0)
"svg_it(O1)" ljust at last [].O1
"svg_it(C1)" ljust at last [].C1 }
-`"relay"' at last [].s+(0,-0.2)
-relay(2) with .sw at last [].sw+(1.2,0)
+ S: "svg_tt(`relay')" at last [].s+(0,-0.2)
+
+R5:relay(2,CTh) with .sw at last [].sw+(skip,0)
+ { for_(1,2,1,`
+ "svg_it(P`'m4x)" rjust at last [].P`'m4x-(dotrad_,0)
+ "svg_it(C`'m4x)" ljust at last [].C`'m4x ') }
+ "svg_tt((2,CTh))" at (last [],S)
+
+R4:relay(2,O) with .sw at last [].sw+(skip,0)
+ {for_(1,2,1,`
+ "svg_it(P1)" rjust at last [].P1-(dotrad_,0)
+ "svg_it(O`'m4x)" ljust at last [].O`'m4x ')}
+ "svg_tt((2,O))" at (last [],S)
+
+R3:relay(2,PIAX) with .sw at last [].sw+(skip,0)
{"svg_it(V1)" rjust at last [].V1
- "svg_it(V2)" ljust at last [].V2
- "svg_it(P1)" rjust at last [].P1.w
- "svg_it(O1)" ljust at last [].O1
- "svg_it(C1)" ljust below at last [].C1
- "svg_it(P2)" rjust at last [].P2.w
- "svg_it(O2)" ljust at last [].O2
- "svg_it(C2)" ljust at last [].C2 }
-`"relay(2)"' at last [].s+(0,-0.2)
-relay(2,RPI) with .sw at last [].sw+(1.2,0)
+ "svg_it(V2)" rjust at last [].V2
+ for_(1,2,1,`
+ "svg_it(P`'m4x)" rjust at last [].P`'m4x-(dotrad_,0)
+ "svg_it(O`'m4x)" ljust at last [].O`'m4x+(dotrad_,0)
+ "svg_it(C`'m4x)" ljust at last [].C`'m4x+(dotrad_,-2pt__) ') }
+ "svg_tt((2,PIAX))" at (last [],S)
+
+R2:relay(2,R) with .sw at last [].sw+(skip,0)
{"svg_it(V1)" rjust at last [].V1
- "svg_it(V2)" ljust at last [].V2
- "svg_it(P1)" rjust at last [].P1.w
- "svg_it(O1)" wid 0.2 ljust at last [].O1.e
- "svg_it(C1)" wid 0.2 ljust at last [].C1.e+(0,2pt__)
- "svg_it(P2)" rjust at last [].P2.w
- "svg_it(O2)" wid 0.2 ljust at last [].O2.e+(0,-2pt__)
- "svg_it(C2)" wid 0.2 ljust at last [].C2.e }
-`"relay(2,RIP)"' at last [].s+(0,-0.2)
-relay(2,O) with .sw at last [].sw+(1.2,0)
-`"relay(2,O)"' at last [].s+(0,-0.2)
-relay(2,CT) with .sw at last [].sw+(1.2,0)
-`"relay(2,CT)"' at last [].s+(0,-0.2)
-}
+ "svg_it(V2)" wid 0.2 ljust at last [].V2
+ for_(1,2,1,`
+ "svg_it(P`'m4x)" rjust at last [].P`'m4x-(dotrad_,0)
+ "svg_it(O`'m4x)" ljust at last [].O`'m4x
+ "svg_it(C`'m4x)" ljust at last [].C`'m4x ') }
+ "svg_tt(`relay(2,R)')" at (last [],S)
- command "</g>" # end font
+ command "</g>)" # end font
.PE