summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/ropepatterns.mp
blob: a87650018530635944c00dfe0b23a97373a54ffd (plain)
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
% ropepatterns.mp
% L. Nobre G.
% 2011

input featpost3Dplus2D;

prologues := 2;

RopeColors := TableColors;                

beginfig(1);
  numeric i, u;
  u = 1cm;
  path auxpath, ropath;
  pair auxpair;
  for i=0 upto TableColors:
    RopeColorSeq[i] := i;
    auxpair := u*(i,TableColors);
    auxpath := fullcircle scaled u shifted auxpair;
    fill auxpath withcolor TableC[i];
    draw auxpath;
    label( decimal(i), auxpair );
  endfor;
  ropath = origin...(u*(0.5*TableColors,TableColors-2))...(u*TableColors*(1,0));
  ropepattern(ropath, u, 10);
  RopeColors := floor(0.5*TableColors);                
  ropepattern(ropath yscaled (-1) shifted (u*up*(TableColors-2)), u, 7);  
endfig;

end.