Debian Codegraph @

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

raw
1 % troncoconedef.mp
2 % L. Nobre G.
3 % 2002
4
5 input featpost3Dplus2D;
6
7 verbatimtex
8 \documentclass{article}
9 \usepackage{beton}
10 \usepackage{concmath}
11 \usepackage{ccfonts}
12 \begin{document}
13 etex
14
15 f := (5,0,3);
16
17 def twoclicpathesinapen( expr CycleA, CycleB )=
18 begingroup
19 numeric TheLengthOfA, TheLengthOfB, TheMargin;
20 path SubPathA, SubPathB;
21 TheMargin = 0.02;
22 TheLengthOfA = ( length CycleA ) - TheMargin;
23 TheLengthOfB = ( length CycleB ) - TheMargin;
24 SubPathA = subpath ( 0, TheLengthOfA ) of CycleA;
25 SubPathB = subpath ( 0, TheLengthOfB ) of CycleB;
26 ( makepath makepen ( SubPathA--SubPathB--cycle ) )
27 endgroup
28 enddef;
29
30 beginfig(0);
31 numeric rayo, rayt;
32 path onec, twoc, botc;
33 color axec, baso, bast;
34 rayo = 1;
35 rayt = 0.7;
36 axec = red;
37 baso = black;
38 bast = (1,1,1);
39 onec = goodcirclepath( baso, axec, rayo );
40 twoc = goodcirclepath( bast, axec, rayt );
41 botc = twoclicpathesinapen( onec, twoc );
42 fill botc withcolor green;
43 draw onec;
44 draw twoc;
45 draw botc;
46 dotlabel.bot( btex onec0 etex, point 0 of onec );
47 dotlabel.bot( btex twoc0 etex, point 0 of twoc );
48 endfig;
49
50 verbatimtex
51 \end{document}
52 etex
53
54 end.