Debian Codegraph @

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

raw
1 % profaux.mp
2 % L. Nobre G.
3 % 2005
4
5 beginfig(1);
6 numeric u, penbig, pensma, aangle, barhei, cirray, ularg, umarg, xhei, xcen;
7 numeric atray;
8 u = 1cm;
9 cirray = 5u;
10 atray = 6.7u;
11 aangle = 33;
12 penbig = 1.85u;
13 pensma = 0.75u;
14 barhei = -1u;
15 ularg = penbig-pensma;
16 umarg = 0.5*pensma;
17 color cux, coa;
18 cux = 0.78red;
19 coa = 0.78green;
20 pen bigpen, smapen;
21 bigpen = pencircle scaled penbig;
22 smapen = pencircle scaled pensma;
23 path theu;
24 z11 = (-0.5*ularg,0.5*ularg+umarg);
25 z12 = ( 0.5*ularg,0.5*ularg+umarg);
26 theu = (z11--(halfcircle scaled ularg rotated 180)--z12);
27 draw theu;
28 xhei = ularg+umarg;
29 xcen = 0.5*umarg;
30 z13 = (ularg+1.5*pensma)*right + xcen*up;
31 z14 = z13 + 0.5*(ularg,xhei);
32 z15 = z13 - 0.5*(ularg,xhei);
33 z16 = z13 + 0.5*(-ularg,xhei);
34 z17 = z13 - 0.5*(-ularg,xhei);
35 draw (z14--z15);
36 draw (z16--z17);
37 picture tmpic;
38 tmpic = currentpicture;
39 currentpicture := nullpicture;
40 path horba, theci, lsid, rsid;
41 theci = fullcircle scaled (2*cirray);
42 z2 = atray*up;
43 z1 = z2 - 2*atray*dir(90-0.5*aangle);
44 z3 = z2 + 2*atray*dir(0.5*aangle-90);
45 z5 = barhei*up;
46 z4 = z5 + cirray*left;
47 z6 = z5 + cirray*right;
48 z18= (z2--z1) intersectionpoint theci;
49 z19= (z2--z3) intersectionpoint theci;
50 lsid = z18--z1;
51 rsid = z19--z3;
52 z7 = (z4--z5) intersectionpoint lsid;
53 z8 = (z5--z6) intersectionpoint rsid;
54 horba = z7--z8;
55 z9 = (z7--z1) intersectionpoint theci;
56 z10= (z8--z3) intersectionpoint theci;
57 drawoptions( withpen bigpen withcolor coa );
58 draw theci;
59 draw z18--z9;
60 draw z19--z10;
61 draw horba;
62 draw tmpic shifted (z10+umarg*(right+down)) withpen smapen withcolor cux;
63 % drawoptions( withcolor blue );
64 % dotlabels.top(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19);
65 endfig;
66 end.
67
68
69
70