summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m4
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-03-11 21:11:43 +0000
committerKarl Berry <karl@freefriends.org>2023-03-11 21:11:43 +0000
commit6bc45f3087df0ce19bdf3c57a0aec55944ec40ed (patch)
tree3faac3b12b92fc4ba09b62c0472a9b3654dada6a /Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m4
parent86d58778de06c53c2e0b20f25556b96619a2dc42 (diff)
circuit-macros (11mar23)%
git-svn-id: svn://tug.org/texlive/trunk@66549 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m4')
-rw-r--r--Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m443
1 files changed, 43 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m4 b/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m4
new file mode 100644
index 00000000000..abe9a9bac7a
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m4
@@ -0,0 +1,43 @@
+.PS
+# Cylinder.m4
+gen_init(SIdefaults) # lengths are in mm
+
+define(`cylinder',`[ angle = ifelse(`$3',,20,`$3')
+ w = ifelse(`$1',,boxwid,`$1')
+ h = ifelse(`$2',,boxht,`$2')
+ B: ellipse wid w ht sind(angle)*w
+ S: box invis wid w ht h fill_(1) with .s at B
+ line from S.nw to S.sw
+ line from S.ne to S.se
+ T: ellipse wid w ht sind(angle)*w at B+(0,h)
+ ]')
+
+define Cylinder { [ dtor = atan2(1,0)/90
+ if "$1"=="" then { w = boxwid } else { w = $1 }
+ if "$2"=="" then { h = boxht } else { h = $2 }
+ if "$3"=="" then { angle = 20 } else { angle = $3 }
+ B: ellipse wid w ht sin(angle*dtor)*w
+ S: box invis wid w ht h fill 1 with .s at B
+ line from S.nw to S.sw
+ line from S.ne to S.se
+ T: ellipse wid w ht sin(angle*dtor)*w at B+(0,h)
+ ] }
+
+M4: [
+ cylinder
+ move
+ cylinder(,,15)
+ move
+ cylinder(3,50)
+ ]
+"M4 macro" at last [].s below
+
+Pic: [
+ Cylinder
+ move
+ Cylinder(,,15)
+ move
+ Cylinder(3,50)
+ ] with .w at M4.e+(5,0)
+"pic macro" at last [].s below
+.PE