Debian Codegraph @

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

raw
1 % iplaca.mp
2 % L. Nobre G.
3 % 2012
4
5 prologues := 1;
6
7 numeric u;
8 u = 52mm;
9
10 def placaminho( expr yv ) =
11 begingroup
12 pair p[];
13 numeric xh;
14 xh = u-yv;
15 p1 = (xh,yv);
16 p2 = (-xh,yv);
17 p3 = (-xh,-yv);
18 p4 = (0,-yv);
19 p5 = (-yv,0);
20 p6 = (0,yv);
21 p7 = (yv,0);
22 p8 = (xh,-yv);
23 ( p1--p2--p3--p4--p5--p6--p7--p4--p8--cycle )
24 endgroup
25 enddef;
26
27 beginfig(1);
28 path a, b, c;
29 color g;
30 pen j;
31 j = pencircle scaled 0.02u;
32 g = 0.5white;
33 a = placaminho( 0.15u ) shifted (left*u*1.9);
34 fill a withcolor g;
35 draw a withpen j;
36 b = placaminho( 0.3u );
37 fill b withcolor g;
38 draw b withpen j;
39 c = placaminho( 0.45u ) shifted (right*u*1.7);
40 fill c withcolor g;
41 draw c withpen j;
42 endfig;
43
44 end.
45