| 1 |
% tetrapodes.mp |
| 2 |
% L. Nobre G. |
| 3 |
% 2009 |
| 4 |
|
| 5 |
input featpost3Dplus2D; |
| 6 |
|
| 7 |
verbatimtex |
| 8 |
\documentclass{article} |
| 9 |
\usepackage{palatino} |
| 10 |
\usepackage{mathpazo} |
| 11 |
\begin{document} |
| 12 |
etex |
| 13 |
|
| 14 |
f := (10,2,3); |
| 15 |
Spread := 50; |
| 16 |
|
| 17 |
def rotatearoundZ( expr P, A ) = |
| 18 |
((X(P)*cosd(A)-Y(P)*sind(A),X(P)*sind(A)+Y(P)*cosd(A),Z(P))) |
| 19 |
enddef; |
| 20 |
|
| 21 |
beginfig(1); |
| 22 |
numeric margia, margib, margic, raycil, raysph, angul; |
| 23 |
color ca, cb; |
| 24 |
path sph; |
| 25 |
margia = 0.10; |
| 26 |
margib = 1.52; |
| 27 |
margic = 0.05; |
| 28 |
raycil = 0.55; |
| 29 |
raysph = 1.00; |
| 30 |
angul = 30; |
| 31 |
ca := (0,-raysph-margia-raycil,0); |
| 32 |
cb := (-raycil-margic,0,raysph+margib); |
| 33 |
rigorousdisc(0,true,ca,raycil,cb-ca); |
| 34 |
ca := rotatearoundZ((-raysph-margia-raycil,0,0),angul); |
| 35 |
cb := rotatearoundZ((0,raycil+margic,-raysph-margib),angul); |
| 36 |
rigorousdisc(0,true,ca,raycil,cb-ca); |
| 37 |
sph = rigorousfearpath(black,raysph); |
| 38 |
unfill sph; |
| 39 |
draw sph; |
| 40 |
ca := rotatearoundZ((raysph+margia+raycil,0,0),angul); |
| 41 |
cb := rotatearoundZ((0,-raycil-margic,-raysph-margib),angul); |
| 42 |
rigorousdisc(0,true,ca,raycil,cb-ca); |
| 43 |
ca := (0,raysph+margia+raycil,0); |
| 44 |
cb := (raycil+margic,0,raysph+margib); |
| 45 |
rigorousdisc(0,true,ca,raycil,cb-ca); |
| 46 |
endfig; |
| 47 |
|
| 48 |
beginfig(2); |
| 49 |
numeric tro; |
| 50 |
tro = 2; |
| 51 |
V1 := (tro,0,0); |
| 52 |
V2 := (0,tro,0); |
| 53 |
V3 := (-tro,0,0); |
| 54 |
V4 := (0,-tro,0); |
| 55 |
V5 := (1,1,1); |
| 56 |
V6 := (-1,1,1); |
| 57 |
V7 := (-1,-1,1); |
| 58 |
V8 := (1,-1,1); |
| 59 |
V9 := (1,1,-1); |
| 60 |
V10 := (-1,1,-1); |
| 61 |
V11 := (-1,-1,-1); |
| 62 |
V12 := (1,-1,-1); |
| 63 |
V13 := (0,0,tro); |
| 64 |
V14 := (0,0,-tro); |
| 65 |
for i=1 upto 14: |
| 66 |
V[i] := rotatearoundZ(V[i],45); |
| 67 |
V[i] := (0.4*X(V[i]),Y(V[i]),1.5*Z(V[i])); |
| 68 |
endfor; |
| 69 |
makeface1(1,5,13,8); |
| 70 |
makeface2(2,6,13,5); |
| 71 |
makeface3(3,7,13,6); |
| 72 |
makeface4(4,8,13,7); |
| 73 |
makeface5(1,5,2,9); |
| 74 |
makeface6(2,6,3,10); |
| 75 |
makeface7(3,7,4,11); |
| 76 |
makeface8(4,8,1,12); |
| 77 |
makeface9(1,9,14,12); |
| 78 |
makeface10(2,10,14,9); |
| 79 |
makeface11(3,11,14,10); |
| 80 |
makeface12(4,12,14,11); |
| 81 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 82 |
f := 2*(5,5,1.5); |
| 83 |
Spread := 50; |
| 84 |
pickup pencircle scaled 1pt; |
| 85 |
sharpraytrace; |
| 86 |
endfig; |
| 87 |
|
| 88 |
def spacedistort( expr Pos, Ref, Fac ) = |
| 89 |
( Pos + cdotprod( Pos, Ref )*Fac*Ref ) |
| 90 |
enddef; |
| 91 |
|
| 92 |
beginfig(3); |
| 93 |
f := (15,10,5); |
| 94 |
Spread := 50; |
| 95 |
numeric numsidecells, numlimcorner, i, j, k, cx, cy, cz, faca, facb; |
| 96 |
numeric ar, scal; |
| 97 |
color posa, posb, posc, posd, thisoria, thisorib, thisoric,thatori; |
| 98 |
path ball; |
| 99 |
numsidecells = 7; |
| 100 |
numlimcorner = 2*numsidecells+2; |
| 101 |
faca = 0.0; |
| 102 |
facb = 0.0; |
| 103 |
ar = 1.0; |
| 104 |
scal = 0.14; |
| 105 |
thisoria = N(( 1, 1, 1)); |
| 106 |
thisorib = N(( 1,-2, 1)); |
| 107 |
thisoric = 0.5*sqrt(3)*(1,1,1); |
| 108 |
thatori = ncrossprod(thisoric,thisorib); |
| 109 |
for i=1 upto numsidecells: |
| 110 |
cx := i-0.5*numsidecells-1; |
| 111 |
for j=1 upto numsidecells: |
| 112 |
cy := j-0.5*numsidecells-1; |
| 113 |
for k=1 upto numsidecells: |
| 114 |
cz := k-0.5*numsidecells-1; |
| 115 |
if i+j+k < numlimcorner+1: |
| 116 |
posa := spacedistort( (cx,cy,cz), thisoria, faca ); |
| 117 |
posa := spacedistort( posa, thisorib, facb ); |
| 118 |
posb := spacedistort( (cx-0.5,cy+0.5,cz), thisoria, faca ); |
| 119 |
posb := spacedistort( posb, thisorib, facb ); |
| 120 |
posc := spacedistort( (cx-0.5,cy,cz+0.5), thisoria, faca ); |
| 121 |
posc := spacedistort( posc, thisorib, facb ); |
| 122 |
posd := spacedistort( (cx,cy+0.5,cz+0.5), thisoria, faca ); |
| 123 |
posd := spacedistort( posd, thisorib, facb ); |
| 124 |
% whatisthis(posa,scal*ar*thatori,scal*thisorib,1,1); |
| 125 |
% whatisthis(posb,scal*ar*thatori,scal*thisorib,1,1); |
| 126 |
% whatisthis(posc,scal*ar*thatori,scal*thisorib,1,1); |
| 127 |
% whatisthis(posd,scal*ar*thatori,scal*thisorib,1,1); |
| 128 |
ball := rigorousfearpath( posa, scal ); unfill ball; draw ball; |
| 129 |
ball := rigorousfearpath( posb, scal ); unfill ball; draw ball; |
| 130 |
ball := rigorousfearpath( posc, scal ); unfill ball; draw ball; |
| 131 |
ball := rigorousfearpath( posd, scal ); unfill ball; draw ball; |
| 132 |
fi; |
| 133 |
endfor; |
| 134 |
endfor; |
| 135 |
endfor; |
| 136 |
|
| 137 |
endfig; |
| 138 |
|
| 139 |
end; |
| 140 |
|