Debian Codegraph @

texmf-dist/doc/metapost/featpost/example/nosuspension.mp

raw
1 % nosuspension.mp
2 % the hard way to write
3
4 beginfig(0);
5 picture l[], auxpic;
6 numeric gridsp, u, pensz, yprop,
7 altura, largura, small, big, thisjump, thatjump;
8 pen thispen, thatpen;
9 path auxpat, thispat, thatpat;
10 pair currpos, reforigin;
11 u = 1mm;
12 pensz = 0.5u;
13 yprop = 1.5;
14 gridsp = 6u;
15 altura = 3gridsp;
16 largura = 2gridsp;
17 small = 0.5gridsp;
18 big = 0.6667gridsp;
19 thisjump = 3gridsp;
20 thatjump = 4gridsp;
21 reforigin = (10cm,15cm) + left*9.5cm;
22 auxpat = (0,yprop*u)--(0.4u,yprop*u){right}..{down}(1u,0.9u)--(1u,0);
23 auxpat := auxpat--(auxpat reflectedabout(origin,right));
24 thispat = auxpat--(auxpat reflectedabout(origin,up));
25 thatpat = thispat rotated 90;
26 thispen = makepen(thispat) scaled pensz;
27 thatpen = makepen(thatpat) scaled pensz;
28 draw (big,0)--origin
29 --(0,altura)
30 --(largura,0)
31 --(largura,altura)
32 --(largura-big,altura) withpen thatpen;
33 l1 = currentpicture;
34 currentpicture := nullpicture;
35 draw (largura,largura)--(0,largura)
36 --origin
37 --(altura,largura)
38 --(altura,0)
39 --(altura-largura,0) withpen thatpen;
40 l2 = currentpicture;
41 currentpicture := nullpicture;
42 draw (altura,largura-small)--(altura,largura)
43 --(0,largura)
44 --(altura,0)
45 --origin
46 --(0,small) withpen thispen;
47 l3 = currentpicture;
48 currentpicture := nullpicture;
49 draw (small,altura)--(0,altura)
50 --origin
51 --(largura,0)
52 --(largura,altura)
53 --(largura-small,altura) withpen thispen;
54 l4 = currentpicture;
55 currentpicture := nullpicture;
56 draw (small,0)--origin
57 --(0,altura)
58 --(largura,altura)
59 --(largura,altura-gridsp)
60 --(0,altura-gridsp) withpen thispen;
61 l5 = currentpicture;
62 currentpicture := nullpicture;
63 draw (largura,small)--(largura,0)
64 --origin
65 --(0,altura)
66 --(largura,altura)
67 --(largura,altura-small) withpen thispen;
68 draw (0,largura)--(largura-small,largura) withpen thispen;
69 l6 = currentpicture;
70 currentpicture := nullpicture;
71 draw (-small,0)--origin
72 --(0,altura)
73 --(-small,altura) withpen thispen;
74 l7 = currentpicture;
75 currentpicture := nullpicture;
76 draw (largura-small,largura)--(largura-small,altura)
77 --(0,altura)
78 --origin
79 --(largura,0)
80 --(largura,largura)
81 --(0,largura) withpen thispen;
82 l8 = currentpicture;
83 currentpicture := nullpicture;
84 draw origin--(small,0)
85 --(small,largura)
86 --(0,largura) withpen thatpen;
87 draw (small,largura-big)--(largura,largura)
88 --(largura,largura-small) withpen thatpen;
89 draw (altura,small)--(altura,0)
90 --(largura-big,largura-small) withpen thatpen;
91 l9 = currentpicture;
92 currentpicture := nullpicture;
93 currpos = (thisjump,thatjump+gridsp)+reforigin;
94 draw l1 scaled 2 shifted currpos;
95 currpos := currpos+(2thisjump,0);
96 draw l2 scaled 2 shifted currpos withcolor 0.875red;
97 currpos := reforigin;
98 draw l3 shifted currpos;
99 currpos := currpos+(thatjump,0);
100 draw l4 shifted currpos;
101 currpos := currpos+(thisjump,gridsp);
102 draw l3 shifted currpos;
103 currpos := currpos+(thatjump,-gridsp);
104 draw l5 shifted currpos;
105 currpos := currpos+(thisjump,0);
106 draw l6 shifted currpos;
107 currpos := currpos+(thisjump,gridsp);
108 draw l1 shifted currpos;
109 currpos := currpos+(thisjump,-gridsp);
110 draw l3 shifted currpos;
111 currpos := currpos+(thatjump+small,0);
112 draw l7 shifted currpos;
113 currpos := currpos+(gridsp,gridsp);
114 draw l2 shifted currpos;
115 currpos := currpos+(thatjump,-gridsp);
116 draw l1 shifted currpos;
117 currpos := reforigin+(2thatjump,-thatjump);
118 draw l8 shifted currpos;
119 currpos := currpos+(thisjump+small,-gridsp);
120 draw l7 shifted currpos;
121 currpos := currpos+(gridsp,gridsp);
122 draw l9 shifted currpos;
123 currpos := currpos+(thatjump,-gridsp);
124 draw l6 shifted currpos;
125 currpos := currpos+(thisjump,gridsp);
126 draw l3 shifted currpos;
127 endfig;
128
129 end;
130
131