Debian Codegraph @

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

raw
1 .PS
2 # shapes.m4
3 threeD_init
4 include(Shapedefs.m4)
5
6 divert(-1)
7 divert(0)dnl
8
9 azimuth = 60
10 elev = 10
11 setview(azimuth,elev)
12 [ Orig: (0,0)
13 setlight
14 Arrow3D(1,0,0) with .Start at Orig; move left 12bp__ from last [].End "x"
15 Arrow3D(0,1,0) with .Start at Orig; "y" ljust at last [].End
16 Arrow3D(0,0,1.2) with .Start at Orig; "z" above at last [].End
17 setlight(0,0,0)
18 cylinder3D(1,1,1,0.6) with .Start at (Project(0.5,0.5,0.5))
19 ]
20 Ball: shadedball(0.5) with .nw at last [].ne+(-0.25,0)
21 [
22 setview(45,10)
23 setlight(40,70)
24 n = 9; len = 1.5; thmin = m4azim+pi_/2*0.8; thmax = thmin+twopi_
25 for i=0 to n do {
26 r = i/n*(thmax-thmin)+thmin
27 prism3D(rot3Dz(r,rot3Dy(pi_/4,len,0,0)),0.2,0.1) \
28 with .Start at (Project(rot3Dz(r,rot3Dy(pi_/4,len*0.5,0,0)))) }
29 ] with .nw at last [].ne
30 [
31 setlight(0,0)
32 movewid = 0.1
33 len = 1.5; ni = 5; nj = 5
34 for i=1 to ni-1 do {
35 {for j = 0 to nj by 2 do {
36 setview(0,i/ni*180-90,j/nj*90)
37 cylinder3D(0,0,len*(j+1)/(nj+1),0.4)
38 if j < nj then {move right} } }
39 if i < ni then {move down 0.85; right_} } #else { move down movewid } }
40 ] with .nw at 1st [].sw+(0,-0.1)
41 [
42 setlight(0,0)
43 len = 1.5; ni = 4; nj = 6
44 for i=1 to ni do {
45 {for j = 0 to nj by 2 do {
46 setview(0,i/ni*180-90,j/nj*90)
47 cone3D(0,0,len*(j+1)/(nj+1),0.4)
48 if i==2 && j==(nj-2) then { move up_ 0.2 right_ -0.4 } \
49 else { if j < nj then {move right_ 0.1}} } }
50 if i < ni then {move down_ 0.75; right_} }
51 ] with .nw at last [].ne+(0.2,0)
52 .PE