/* POVRAY PROGRAM TO CREATE THE TOROIDAL SHELLS VERSION OF THE UNIVERSAL TERRESTRIAL DWELLING By ROBERT JOHN MORTON YE572246C COMMAND LINE: povray -visual DirectColor toroids.pov +W640 +H480 set width and height of picture in /etc/povray/3.6/povray.ini */ #include "colors.inc" #include "shapes.inc" #include "textures.inc" global_settings{max_trace_level 256} //max possible is 256 #declare G = 1.6180339887; //golden ratio #declare oh = 150; //hypotenuse distance to observer 3 for internal view #declare rd = 0; //angle of elevation to observer 0 for internal view #declare Height = oh * sind(rd); #declare Dist = oh * cosd(rd); camera{ location<0, Height, Dist> look_at <0, 0, 0> angle 13 //angle 13 for external and 60 for internal views } light_source{<0,Height,Dist> color rgb <.5,.5,.5>} //camera light #declare fr=79.788456088; //radius of 2-hectare gleba (metres) light_source { //SUN <0, 1000, 0> //located at south horizon color rgb <.7,.7,.5> //reddish-yellow light cylinder //confined to a cylindrical beam radius fr //radius at full intensity falloff 10000 //falling off to 0 brightness at 1000 units radius area_light <1,0,0>, <0,0,1>, 20,20 //lighting element is a 20 x 20 pixels adaptive 1 //the normal of which is determined by the vectors jitter //adaptive = minimise number of test rays required point_at <0, 0, 0> //light beam is aimed at the co-ordinate origin rotate <30,0,-15> //rotate sun to desired position in the sky } //ENVIRONMENT ----------------------------------------------------------------- #declare ground_level = -4; //amount ground is below co-ordinate origin #declare md = -7000; //mountains are 5km away #declare rp = 6378140; //Earth radius sphere{<0,0,0>, rp //create spherical planet texture{ //define its ground texture that comprises: pigment{color rgb <0.85, 1.0, 0.6>} finish{diffuse 0.2 ambient 0.5} } //translate it downwards to ground level translate<0, ground_level - rp, 0> } sky_sphere{ pigment{ gradient y color_map{ [(1 - cos(radians( 30))) / 2 color White ] [(1 - cos(radians(120))) / 2 color Blue ] } scale 2 translate -1 } } // GLEBA CIRCLE --------------------------------------------------------------- #declare gleba_height = .002; //gleba is 5 mm above ground level cylinder { <0, 0, 0>, <0, gleba_height, 0>, 1 // thin cylinder of unit radius texture { //define its texture that comprises: pigment { onion color_map { [0.0 color Yellow] // starts at yellow, then blend through to [1.0 color rgb <0.815, 1.015, 0.51>] //field-green } } finish { //with surface characteristics: diffuse 0.2 //diffusion ambient 0.5 //effective ambient lighting (brightness) } } translate <0,ground_level,0> //move gradiented circle down to ground level scale //rescale to size of 2-hectare gleba } // TOROIDAL MODULE ----------------------------------------------------------- #declare SC1O = texture { pigment { color rgb <0.55, 0.51, 0.47>} //, 0.15> } // greeny-red finish { phong 0.8 ambient 0.6 } } #declare SC2O = texture { pigment { color rgb <0.47, 0.55, 0.51>} //, 0.15> } // bluey-green finish { phong 0.8 ambient 0.6 } } #declare SC3O = texture { pigment { color rgb <0.47, 0.51, 0.55>} //, 0.15> } // greeny-blue finish { phong 0.8 ambient 0.6 } } #declare SC1T = texture { pigment { color rgb <0.55, 0.51, 0.47, 0.75>} //, 0.15> } // greeny-red finish { phong 0.8 ambient 0.6 } } #declare SC2T = texture { pigment { color rgb <0.47, 0.55, 0.51, 0.5>} //, 0.15> } // bluey-green finish { phong 0.8 ambient 0.6 } } #declare SC3T = texture { pigment { color rgb <0.47, 0.51, 0.55, 0.5>} //, 0.15> } // greeny-blue finish { phong 0.8 ambient 0.6 } } #declare tex1t = texture{ pigment{color rgb <0.75, 0.75, 0.75, 0.9>} //outer shell colour transparent finish{phong 0.8 ambient 0.5} } #declare tex1o = texture{ pigment{color rgb <0.35, 0.40, 0.45>} //inner shell colour opaque finish{phong 0.7 ambient 0.6} } #declare glas = texture{ pigment{color rgb <0.7, 0.7, 0.8, 0.85>} //glass for windows finish{phong 0.9 ambient 0.5} } #declare invisible = texture{pigment{color rgbt<1,1,1,1>}} /* NEW VWERION 27NOV2013 height = 9 metres vertical radius = 4.5 metres diameter = height x golden ratio = 14.5623058987 metres So radius = 7.281152949 metres */ #declare V = 4.5; //torus vertical radius #declare s = 0.95; //inner to outer scaling factor #declare R = G * V; //radius of unit #declare D = R * cosd(15); //half-separation between centres of units #declare c = R / (1 + G); //unit radius [1.527864045] #declare Tmajor = c * (1 + G / 2); //major radius of torus [2.763932022] #declare Tminor = c * G / 2; //minor radius of torus [1.236067977] #declare tvs = V / Tminor; //torus vertical scaling #declare T = torus{Tmajor, Tminor scale<1, tvs, 1>} //golden section torus #declare TS = object{T scale} //scaled down version of T #declare rs = 1.5 * R; //radius of ellipsoid #declare evr = 2; //ellipsoid's vertical radius #declare ehvr = evr / rs; //ellipsoid's vertical to horizontal ratio #declare S = sphere{<0, 0, 0>, rs scale<1, ehvr, 1>} //ellipsoidal inner shell #declare SS = object{S scale} //scaled down version of S // CALCULATE THE RADIUS OF THE SKYLIGHT, CREATE SKYLIGHT. SEE GEOMETRY FILE. #declare t2 = Tminor * Tminor; #declare V2 = V * V; #declare F = sqrt(V2-t2); #declare b = F - 2; #declare sr = Tmajor - sqrt((t2*t2 + 2*F*t2*b - t2*b*b)/V2); //skylight radius #declare SL = object{S clipped_by{cylinder{<0,0,0>, <0,+4,0>, sr}}} //skylight #declare OT = merge{ //translucent outer torus unit with centre part cut out object{T} //outer toroidal shell cylinder{<0,-2,0>, <0,+2,0>, 3 texture{invisible}} } #declare Q = cylinder{ //side-window cutter <0,0,-1>, <0,0,1>, 1 scale<0.5,1,1> translate<0,0,R> } #declare WC = merge{object{Q} object{Q rotate<0,30,0>}} //windows cutter #declare INNER_SHELL = union{ //INNER SHELL object{OT scale clipped_by{object{S}}} //outer wall object{S clipped_by{object{TS}}} //top & bottom merge{ //inner+outer floors cylinder{<0,-1.3,0>, <0,-1,0>, 3} cylinder{<0,-1.3,0>, <0,-1,0>, R clipped_by{object{TS}}} } } #declare WINDOWS = union{ //GLASS WINDOWS difference{ //The two elliptical side windows object{WC clipped_by{object{T}}} //cutter clip by outer torus object{TS} //chopped by scaled-down torus } object{SL} //top skylight object{SL translate<0,-ehvr*2,0>} //bottom dome window texture{glas} } #declare U1 = union{ //COMPLETE TOROIDAL MODULE difference{ //Module without glass union{ object{INNER_SHELL texture{SC1O}} object{OT texture{glas}} //outer shell } object{WC texture{invisible}} //window cutter } object{WINDOWS} } object{U1} /* #declare U2 = union{ //COMPLETE TOROIDAL MODULE difference{ //Module without glass union{ object{INNER_SHELL texture{SC2O}} object{OT texture{glas}} //outer shell } object{WC texture{invisible}} //window cutter } object{WINDOWS} } #declare U3 = union{ //COMPLETE TOROIDAL MODULE difference{ //Module without glass union{ object{INNER_SHELL texture{SC3O}} object{OT texture{glas}} //outer shell } object{WC texture{invisible}} //window cutter } object{WINDOWS} } #declare DU1 = merge{ //create a double module comprising an inner and an outer object{U1 rotate<0,165,0>} object{U1 rotate<0,-135,0> translate<0, 0, -D-D> rotate<0,60,0>} translate<0,0,-(D+D)> } #declare QUAD1 = merge{object{DU1} object{DU1 rotate<0,60,0>}} #declare DU2 = merge{ //create a double module comprising an inner and an outer object{U2 rotate<0,165,0>} object{U2 rotate<0,-135,0> translate<0, 0, -D-D> rotate<0,60,0>} translate<0,0,-(D+D)> } #declare QUAD2 = merge{object{DU2} object{DU2 rotate<0,60,0>}} #declare DU3 = merge{ //create a double module comprising an inner and an outer object{U3 rotate<0,165,0>} object{U3 rotate<0,-135,0> translate<0, 0, -D-D> rotate<0,60,0>} translate<0,0,-(D+D)> } #declare QUAD3 = merge{object{DU3} object{DU3 rotate<0,60,0>}} union{ merge{ //create the complete 12-module ninho of 6 double modules object{QUAD1 rotate<0,+120,0>} object{QUAD2} object{QUAD3 rotate<0,-120,0>} // clipped_by{cylinder{<0,-4.1,0>, <0,0,0>, 50}} // translate<2*D*cosd(30),0,0> //internal view with Height=0 and Dist=3.6 } // box{<-.36,-1,-.02>, <.36,1.1,.02> //puts a standard size door in doorway // texture{pigment{color rgb<0,1,0>}} //use for internal view only // } // sphere{<0,-4,0>, fr scale<1,1.5,1> texture{glas}} //ownership sphere rotate<0,12.5,0> //to give the whole ninho a nice perspective angle } */