File: iplaca.mp

package info (click to toggle)
texlive-base 2020.20210202-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 791,092 kB
  • sloc: perl: 45,038; sh: 4,926; makefile: 4,655; ansic: 2,266; ruby: 2,231; tcl: 2,156; xml: 1,874; python: 822; cpp: 695; awk: 606; lisp: 199; sed: 8
file content (45 lines) | stat: -rw-r--r-- 737 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
% iplaca.mp
% L. Nobre G.
% 2012

prologues := 1;

numeric u;
u = 52mm;

def placaminho( expr yv ) =
  begingroup
    pair p[];
    numeric xh;
    xh = u-yv;
    p1 = (xh,yv);
    p2 = (-xh,yv);
    p3 = (-xh,-yv);
    p4 = (0,-yv);
    p5 = (-yv,0);
    p6 = (0,yv);
    p7 = (yv,0);
    p8 = (xh,-yv);
    ( p1--p2--p3--p4--p5--p6--p7--p4--p8--cycle )
  endgroup
enddef;

beginfig(1);
  path a, b, c;
  color g;
  pen j;
  j = pencircle scaled 0.02u;
  g = 0.5white;
  a = placaminho( 0.15u ) shifted (left*u*1.9);
  fill a withcolor g;
  draw a withpen j;
  b = placaminho( 0.3u );
  fill b withcolor g;
  draw b withpen j;
  c = placaminho( 0.45u ) shifted (right*u*1.7);
  fill c withcolor g;
  draw c withpen j;
endfig;

end.