summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/standard/triangulartrimesh.mp
blob: 1a19c77697666013001099a429296c748c57ef55 (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
31
32
33
34
35
36
37
38
39
% triangulartrimesh.mp
% L. Nobre G.
% IYP (2005)

%input featpost3Dplus2D;

def zsurface( expr xc, yc ) =
	cosd(xc*57)*cosd(yc*57)+4*mexp(-(xc**2+yc**2)*6.4)
enddef;

f := 16*(4,1,1);
Spread := 35;
LightSource := 10*(4,-3,4);
defaultfont := "cmvtt10";
beginfig(1); 
  numeric np, ssize, lx, ly, topl, ystep, i, zl;
  string L[];
  L0 = "P";
  L1 = "H";
  L2 = "Y";
  L3 = "S";
  L4 = "I";
  L5 = "C";
  L6 = "S";
  np = 72;
  ssize = 15;
  ly = -0.5*ssize;
  lx = -sqrt(3)*ssize/6;
  ystep = ssize/7;
  topl = 2*zsurface( 0, 0 );
  for i=0 upto 6:
    zl := zsurface(lx,i*ystep+ly);
    labelinspace(false,(lx,i*ystep+ly,zl),green*ystep,blue*(topl-zl),L[i]);
  endfor;
  hexagonaltrimesh( false,np,ssize,zsurface);
  label.ulft("matagalatlante.org",lrcorner currentpicture); 
endfig;

end;