| 1 |
% unperfection.mp |
| 2 |
% L. Nobre G. |
| 3 |
% 2003 |
| 4 |
|
| 5 |
input featpost3Dplus2D; |
| 6 |
|
| 7 |
Spread := 70; |
| 8 |
f := (10,4,5); |
| 9 |
|
| 10 |
beginfig(1); |
| 11 |
numeric i, len, polelen; |
| 12 |
numeric fws, NumLines, linex, inray, outay, axray; |
| 13 |
numeric wang, poleray; |
| 14 |
path aro[], oneline; |
| 15 |
color axe, pole, polec, aroc; |
| 16 |
picture floorwall; |
| 17 |
len := 0.6; |
| 18 |
wang := 60; |
| 19 |
axe := (0,cosd(90-wang),sind(90-wang)); |
| 20 |
pole := (0,1,0); |
| 21 |
fws := 4; |
| 22 |
polelen := 0.8*fws; |
| 23 |
outay := 0.45*fws; |
| 24 |
inray := 0.7*outay; |
| 25 |
poleray := 0.07*inray; |
| 26 |
NumLines := 30; |
| 27 |
for i=0 upto NumLines: |
| 28 |
linex := fws*(i/NumLines-0.5); |
| 29 |
oneline := rp((linex,0.5*fws,-0.5*fws)) |
| 30 |
--rp((linex,-0.5*fws,-0.5*fws)) |
| 31 |
--rp((linex,-0.5*fws,0.5*fws)); |
| 32 |
draw oneline withcolor (0.7*background); |
| 33 |
endfor; |
| 34 |
aroc := outay*(0,cosd(wang),sind(wang))-0.5*(0,fws,fws); |
| 35 |
polec := (0,(outay-inray)*cosd(wang)-fws/2, |
| 36 |
(outay+inray)*sind(wang)-poleray-fws/2); |
| 37 |
aro1 := goodcirclepath( aroc, axe, inray ); |
| 38 |
aro2 := goodcirclepath( aroc+len*axe, axe, inray ); |
| 39 |
aro3 := buildcycle( aro1, aro2 ); |
| 40 |
floorwall := currentpicture; |
| 41 |
clip floorwall to aro3; |
| 42 |
aro4 := spatialhalfcircle( aroc+len*axe, axe, inray, false ); |
| 43 |
aro5 := spatialhalfcircle( aroc+len*axe, axe, outay, false ); |
| 44 |
aro6 := reverse aro5; |
| 45 |
aro7 := aro4--aro6--cycle; |
| 46 |
fill aro7 withcolor (0.6*background); |
| 47 |
rigorousdisc( 0, true, aroc, inray, axe*len ); |
| 48 |
draw floorwall; |
| 49 |
draw aro3; |
| 50 |
rigorousdisc( 0, true, polec, poleray, pole*polelen ); |
| 51 |
aro8 := spatialhalfcircle( aroc+len*axe, axe, inray, true ); |
| 52 |
aro9 := spatialhalfcircle( aroc+len*axe, axe, outay, true ); |
| 53 |
aro10 := reverse aro9; |
| 54 |
aro11 := aro8--aro10--cycle; |
| 55 |
fill aro11 withcolor (0.6*background); |
| 56 |
rigorousdisc( 0, false, aroc, outay, axe*len ); |
| 57 |
endfig; |
| 58 |
|
| 59 |
end. |