// NET / Single Hill Face of Winding Triangle Net '00.11 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { max_trace_level 3 assumed_gamma 2.2 } light_source {<40, 20, -80> color <1,1,1>} camera { location <0, -100, -80> angle 31 look_at <0, -25, 0> } #declare Rsize=0.125; #declare Imax=2000; #declare Cp=array[Imax][3] #declare I=0; #while (I Rsize pigment {color rgb <1,1,1>} finish { ambient 0.6 } no_shadow } #end #macro Cydr (Cpt, Cpe) cylinder { Rsize pigment {color rgb <1,1,1>} finish { ambient 0.6 } no_shadow } #end #macro Acosc (Rc,Dy,Ac) #declare Ac=acos(Rc); #if (Dy<0) #declare Ac=2*pi-Ac; #end #if (Ac=0) #declare Ac=2*pi; #end #end #declare I=0; #while (I<6) #declare Pe=1+I; #declare Cp[Pe][0]=Cp[0][0]+2*cos(pi/3*I); #declare Cp[Pe][1]=Cp[0][1]+2*sin(pi/3*I); #declare Cp[Pe][2]=0.015*(pow(Cp[Pe][0],2)+pow(Cp[Pe][1],2)); Spdr (Pe) Cydr (Pe,0) Cydr (Pe,Pe-1) #declare I=I+1; #end Cydr (6,1) #declare Ap=0; #declare As=0; #declare Al=0; #declare Ae=0; #declare Ad=0; #declare Rndm = seed(9); #macro Spculc (N,P,Pe) #declare Rs=sqrt(pow(Cp[P][0]-Cp[N][0],2)+pow(Cp[P][1]-Cp[N][1],2))/4; Acosc((Cp[P][0]-Cp[N][0])/4/Rs,Cp[P][1]-Cp[N][1],Ap) #declare Re=sqrt(pow(Cp[N+1][0]-Cp[N][0],2)+pow(Cp[N+1][1]-Cp[N][1],2))/4; Acosc((Cp[N+1][0]-Cp[N][0])/4/Re,Cp[N+1][1]-Cp[N][1],Ae) Acosc(Rs,1,As) Acosc(Re,1,Al) #if (rand(Rndm)>0.5) #declare Ad=rand(Rndm); #end #if (Ae-Ap<0) #declare Ap=Ap-2*pi; #end #if (Ae-Ap-As-Al-Ad>0) #declare I=0; #while (I0) #declare I=0; #while (I