summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/svg/ex02SVG.m4
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/circuit_macros/examples/svg/ex02SVG.m4
Initial commit
Diffstat (limited to 'graphics/circuit_macros/examples/svg/ex02SVG.m4')
-rw-r--r--graphics/circuit_macros/examples/svg/ex02SVG.m451
1 files changed, 51 insertions, 0 deletions
diff --git a/graphics/circuit_macros/examples/svg/ex02SVG.m4 b/graphics/circuit_macros/examples/svg/ex02SVG.m4
new file mode 100644
index 0000000000..9ec72d8e2a
--- /dev/null
+++ b/graphics/circuit_macros/examples/svg/ex02SVG.m4
@@ -0,0 +1,51 @@
+.PS
+# ex02.m4
+cct_init
+
+[
+ [ for angle = 0 to 315 by 45 do { Point_(angle)
+ opamp(to rvec_(linewid*3/2,0)) with .Out at 0,0 } ]
+ resistor(down_ dimen_ from last [].s)
+ diode(down_ dimen_*2/3,LE)
+ diode(down_ dimen_*2/3,LER)
+ ground(,T)
+]
+
+[
+ define(`elen_',`dimen_*3/2') # restore defaults
+ define(`sourcerad_',`dimen_*0.25')
+ leng = elen_
+ define(`fromcentre',`move to C+(-elen_/2,-elen_*cosd(15)/(2*sind(15)))')
+ C: dot
+ { fromcentre()
+ for i = 0 to 359 by 30 do {
+ Point_(i); inductor
+ }
+ }
+ define(`elen_',leng*0.8)
+ { fromcentre()
+ for i=0 to 359 by 30 do {
+ Point_(i); inductor(,W)
+ }
+ }
+ define(`elen_',leng*0.6)
+ { fromcentre()
+ for i=0 to 359 by 30 do {
+ Point_(i); resistor
+ }
+ }
+ define(`elen_',leng*0.4)
+ { fromcentre()
+ for i=0 to 359 by 30 do {
+ Point_(i); capacitor(,C)
+ }
+ }
+ define(`elen_',leng*0.2)
+ { fromcentre()
+ for i=0 to 359 by 30 do {
+ Point_(i); diode
+ }
+ }
+ ] with .sw at last [].se+(linewid,0)
+
+.PE