/* POVRAY PROGRAM TO CREATE THE FLUTED ELLIPSOIDS VERSION OF THE UNIVERSAL TERRESTRIAL DWELLING By: ROBERT JOHN MORTON YE572246C COMMAND LINE: povray -visual DirectColor fluted.pov +W640 +H480 The switch "-visual DirectColor" prevents the rendering window being transparent under Ubuntu Hardy Heron (problem with compitz). To set width and height of picture in /etc/povray/3.6/povray.ini open terminal, log in as super user, change directory to /etc/povray/3.6, gedit povray.ini, change width and height settings, save & exit. */ #include "colors.inc" #include "shapes.inc" #include "textures.inc" #include "glass.inc" global_settings{max_trace_level 256} //max possible is 256 #declare G = 1.6180339887; //golden ratio // 1) CAMERA ------------------------------------------------------------------ // 1.png 2.png 3.png 4.png 5.png 6.png #declare Height = 150; // 100 16 2 223 223 100 #declare Dist = 220; // 223 223 223 5 5 223 camera{location<0, Height, Dist> look_at <0, 0, 0> angle 13} // 2) LIGHTING ---------------------------------------------------------------- #declare camera_lights = light_source { //CAMERA LIGHT <0, Height, Dist> //located at camera color rgb <.4,.4,.4> //white cylinder //cylindrical beam radius 100 //radius 100 units at full intensity falloff 10000 //falling off to zero at 70 units area_light <1,0,0>, <0,0,1>, 20,20 //lighting element: 20 x 20 pixel array adaptive 1 //normal is determined by the vectors jitter //minimise number of test rays required point_at <0, 0, 0> //light beam aimed at coordinate origin } //jitter softens shadows object{camera_lights} #declare sun = light_source { //SUN LIGHT <0, 1000, 0> //located overhead color rgb <.8,.7,.6> //reddish light cylinder //confined to a cylindrical beam radius 80 //of radius 80 units at full intensity falloff 10000 //falling off to zero at 10000 units area_light <1,0,0>, <0,0,1>, 20,20 //lighting element 20 x 20 pixel array adaptive 1 //normal is determined by the vectors jitter //minimise no. of test rays required point_at <0, 0, 0> //light beam aimed at coordinate origin } //jitter softens shadows object{sun rotate <-5, 0, -10>} // Horizon Glow 1.png 2.png 3.png 4.png 5.png 6.png #declare h = 0; // 0 0 0 20 20 0 #declare b = .1; // .1 .1 .1 .2 .2 .1 #declare horizon_light = light_source{<100,h,0> color rgb } #declare horizon_glow = union{ #declare a = 20; #while(a < 360) object{horizon_light rotate<0,a,0>} #declare a = a + 60; #end } object{horizon_glow} // 3) SPECIAL TEXTURES USED IN THIS PROJECT ----------------------------------- #declare Shell_Colour1 = texture { pigment { color rgb <0.55, 0.51, 0.47>} //, 0.15> } // greeny-red finish { phong 0.8 ambient 0.6 } } #declare Shell_Colour2 = texture { pigment { color rgb <0.47, 0.55, 0.51>} //, 0.15> } // bluey-green finish { phong 0.8 ambient 0.6 } } #declare Shell_Colour3 = texture { pigment { color rgb <0.47, 0.51, 0.55>} //, 0.15> } // greeny-blue finish { phong 0.8 ambient 0.6 } } #declare ROAD = texture { pigment { colour rgb <0.52, 0.49, 0.50> } // light grey tarmac. finish { phong 0.8 ambient 0.4 } } #declare GLASS = texture{pigment{color Col_Glass_General}} // 4) ENVIRONMENT ------------------------------------------------------------- #declare ground_level = -4; //amount ground is below co-ordinate origin #declare fr = 79.788456088; //radius of a 2-hectare gleba (in metres) #declare md = -7000; //mountains are 5km away #declare rp = 6378140; //Earth radius #declare mountain = cone{<0, rp+40, 0>, 40 <0, rp, 0>, 100} merge{ sphere{<0,0,0>, rp} //create spherical planet object{mountain rotate<-.005,-20,0>} object{mountain rotate<-.005,+20,0>} object{mountain rotate<-.010,-10,0>} object{mountain rotate<-.010,+10,0>} object{mountain rotate<-.015,-05,0>} object{mountain rotate<-.015,+05,0>} object{mountain rotate<-.020,-01,0>} texture { //define its ground texture that comprises: pigment {color rgb <0.85, 1.0, 0.6> } finish { diffuse 0.2 ambient 0.5 } } translate<0,ground_level - rp,0> //translate it downwards to ground level } 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 } } // 5) GLEBA CIRCLE ------------------------------------------------------------ #declare gleba_height = .002; //gleba is 5 mm above ground level #declare gleb = 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 } #declare gleba = object{gleb scale} //rescale size to 2-hectare gleba #declare mgr = sqrt(20000/(3*3.141592653)); //mini-gleba radius #declare glebshift = mgr * (1/cosd(30)-1); #declare minigleb = object { gleb scale clipped_by { cylinder { <0, -5, mgr>, <0, -3, mgr>, mgr } } translate <0, 0, glebshift> } #declare trigleb = union { #declare k = 30; #while (k < 390) object { minigleb rotate <0, k, 0> } #declare k = k + 120; #end } #declare ownership = sphere{<0,-4,0>, fr scale<1,1.5,1> texture{GLASS}} /* 6) CREATE THE BASIC PATIO SHELL -------------------------------------------- CALCULATIONS FOR THE INNER SHELL The shell has to have an inner height clearance of 2 metres at a radius of 5*cos(30) = 4.33012702 metres in order to provide adequate doorway height. The maximun inner height at the centre of the shell must be 2.7 metres. D = 4.33012702 D^2 = 18.75000001 H = 1.7 H^2 = 2.89 Y = 1 R^2 = H^2 + F^2 F = D + x R^2 = H^2 + (D+x)^2 = H^2 + D^2 + x^2 + 2*D*x The universal ellipse formula (see geom.png) for working out dimensions is: H^2 * x^2 - 2 * F * H^2 * x + R^2 * Y^2 - H^4 = 0 But since Y=Y^2=1 H^2 * x^2 - 2 * F * H^2 * x + R^2 - H^4 = 0 Substitute for F and R^2: H^2 * x^2 - 2 * (D + x) * H^2 * x + H^2 + D^2 + x^2 + 2*D*x - H^4 = 0 Expand: H^2 * x^2 - 2D * H^2 * x - x * 2 * H^2 * x + H^2 + D^2 + x^2 + 2D*x - H^4 = 0 H^2 * x^2 - 2D * H^2 * x - 2 * H^2 * x^2 + H^2 + D^2 + x^2 + 2D*x - H^4 = 0 Gather like terms: H^2 * x^2 - 2 * H^2 * x^2 + x^2 - 2D * H^2 * x + 2D * x + H^2 + D^2 - H^4 = 0 (1 - H^2)x^2 + 2D(1 - H^2)x + D^2 + H^2 - H^4 = 0 a = 1 - H^2 = -1.89 b = 2D(1 - H^2) = 2*4.33012702*(-1.89) = -16.36788014 c = D^2 + H^2 - H^4 = 4.33012702^2+1.7^2-1.7^4 = 13.28790001 Sqrt(b^2 - 4ac) = Sqrt((16.36788014^2)-4*13.28790001*(-1.89)) = 19.19281179 2a = -3.78 x = (16.36788014+19.19281179)/(-3.78) = -9.40759046 x = (16.36788014-19.19281179)/(-3.78) = +0.74733642 Use the smaller root (the one on the side of the origin we are on): F = D + x = 4.33012702 + 0.74733642 = 5.07746344 F^2 = 25.78063498 R = Sqrt(25.78063498 + 2.89) = 5.35449671 */ #declare RI = 5.35449671; //inner radius of ellipsoid, in metres #declare RO = RI + 0.3; //outer radius of ellipsoid, in metres #declare IH = 1.7; //inner vertical radius #declare OH = IH + 0.3; //outer vertical radius #declare SO = OH/RO; //outer vertical scaling factor #declare SI = IH/RI; //inner vertical scaling factor #declare r = RO/G; //radius of roof hole = 3.49467116 metres #declare dr = 0.001; //fraction of a metre larger or smaller #declare bw = r + dr + dr; //box width /* RR: RADIUS OF CIRCLE ON WHICH CENTRES OF INNER GROUP OF SHELL UNITS LIE ---- RR is defined as 2 * 5 * cos(30), hence */ #declare RR = 8.660254038; /* It follows that RR is also the separation distance between the centres of every adjacent pair of ellipsoidal shell units of the ninho. RR is thus this is twice the diameter D of the circular flat floor i.e. the bottom of the inner surface of a shell unit. Hence: */ #declare D = 4.33012702; /* It follows that D is the radius of the circle on which the centres of the inner ring of shell units rest. The radius of the outer d circle on which the centres of the outer-most shell units lie is RR / tan(30) = 15 metres. Hence: */ #declare d = 15; // 7) CREATE THE FULL SET OF INNER SHELLS ------------------------------------- #declare G = 1.6180339887; //golden ratio #declare ELo = sphere{<0,0,0>, 2 scale} #declare ELi = sphere{<0,0,0>, 2-0.3 scale} #declare so = merge{ #declare a = 0; #while(a < 360) object{ELo rotate<0,a,0>} #declare a = a + 120; #end rotate<0,15,0> } #declare si = merge{ #declare a = 0; #while(a < 360) object{ELi rotate<0,a,0>} #declare a = a + 120; #end rotate<0,15,0> } // #declare so = sphere{<0,0,0>, RO scale<1,SO,1>} //outer skin of the ellipsoid // #declare si = sphere{<0,0,0>, RI scale<1,SI,1>} //inner skin of the ellipsoid #declare inner_shell = union{ merge{ //make flat bottom for floor object{si} //inner ellipsoid cylinder{<0,1,0>, <0,2.5,0>, r} //roof hole with liner clipped_by{cylinder{<0,-1,0>, <0,4,0>, RI + 1}} } //clip off bottom of ellipsoid cylinder{<0,-1,0>, <0,-1.001,0>, RI + 1 clipped_by{object{si}}} //floor clipped_by{object{so}} } #declare inner_shell_pair = merge{ object{inner_shell translate<0,0,RR>} object{inner_shell rotate<0,90,0> translate<0,0,d> rotate<0,30,0>} } #declare inner_shell_quad = merge{ //functional group of 4 shell units object{inner_shell_pair} object{inner_shell_pair rotate<0,60,0>} } #declare Inner_Shells = merge{ //put the 3 groups of 4 together to form ninho object{inner_shell_quad texture{Shell_Colour1}} object{inner_shell_quad rotate<0,120,0> texture{Shell_Colour2}} object{inner_shell_quad rotate<0,240,0> texture{Shell_Colour3}} } // 8) CREATE ROOF AND BUTT HOLE CUTTERS --------------------------------------- #declare cutter = cylinder{<0,-2.5,0>, <0,2.5,0>, r-dr} //roof+butt hole cutter #declare cutter_pair = union{ object{cutter translate<0,0,RR>} //inner cutter object{cutter rotate<0,90,0> translate<0,0,d> rotate<0,30,0>} //outer cutter } #declare cutters = union{ //create the full circle of 6 cutters #declare a = 0; #while(a < 360) object{cutter_pair rotate<0,a,0>} #declare a = a + 60; #end pigment{color rgbt<1,1,1,1>} //make the cutter invisible } /* 9) CREAT FULL SET OF DOMED CAPS -------------------------------------------- Note: height of outer skin's rim of the roof-hole = +1.57230275 metres depth of the outer skin's rim of the butt-hole = -1.57230275 metres Thus the roof cap cut from the top of the shell is lowered by twice this distance, namely -3.14460551 metres to form the domed bottom of the shell. This was calculated using the geometry shown in geom.xcf #declare cap = union{ //add the domed bottom object{so clipped_by{cylinder{<0,0.5,0>, <0,2.5,0>, r}}} light_source{<0,1.78615137,0> color rgb<.3,.3,.3>} translate<0,-3.14460551,0> //move it into the butt hole } #declare cap_pair = union{ object{cap translate<0,0,RR>} //inner cutter object{cap rotate<0,90,0> translate<0,0,d> rotate<0,30,0>} //outer cutter } #declare caps = union{ //create the full circle of 6 segmental cutters #declare a = 0; #while(a < 360) object{cap_pair rotate<0,a,0>} #declare a = a + 60; #end } */ // 10) CREATE THE FULL SET OF OUTER SHELLS ------------------------------------ #declare outer_shell_pair = merge{ object{so translate<0,0,RR>} //inner hexagon shell object{so translate<0,0,d> rotate<0,30,0>} //peripheral shell } #declare outer_shell_quad = merge{ object{outer_shell_pair} object{outer_shell_pair rotate<0,60,0>} } #declare outer_shells = merge{ object{outer_shell_quad texture{Shell_Colour1}} object{outer_shell_quad rotate<0,120,0> texture{Shell_Colour2}} object{outer_shell_quad rotate<0,240,0> texture{Shell_Colour3}} } // 11) CUT OUT THE ROOF AND BUTT HOLES ------------------ --------------------- #declare Outer_Shells = difference{object{outer_shells} object{cutters}} // 12) CREATE SKYLIGHTS ------------------------------------------------------- // 12.1) CREATE 6-SEGMENT SKYLIGHT CUTTER #declare sf = 1 - 1 / G; //vertical scaling factor of the ellipsoid 0.38196601 #declare cb = box{<0,-1,-10>, <10,6,10>} //box for slicing anulus into segments #declare cap = cylinder{<0,.999,0>, <0,3.001,0>, r*sf} //centre cap cylinder //radius = 1.3348456 metres #declare sm = difference{ //create skylight segment window cutter difference{ difference{ cylinder{<0,1,0>, <0,3,0> r} //big cylinder object{cap} //little cylinder } object{cb} //cutting box rotate<0,150,0> } object{cb} //same cutting box rotate<0,15,0> //to centre the cutter's position } #declare SM = union{ //create a circle of 6 skylight cutter segments #declare a = 0; #while(a < 360) object{sm rotate<0,a,0>} #declare a = a + 60; #end } /* 12.2) CREATE 12 RADIAL DIVIDERS THAT FIT BETWEEN GLASS AND OPAQUE PARTS OF-- THE SKYLIGHT ASSEMBLY */ #declare divider = difference{ box{<0,1,r>, <0,3,r*sf>} object{si} clipped_by{object{so}} } #declare dividers = union{ //The 12 radial dividers that fit #declare a = 0; //between glass and opaque parts #while(a < 360) //of skylight assemblydividers. object{divider rotate<0,a,0>} #declare a = a + 30; #end rotate<0,15,0> } // 12.3) CREATE THE OPEN CYLINDRICAL RIM THAT FORMS OUTER EDGE OF CENTRAL CAP-- #declare cap_rim = difference{ //RIM FOR THE CENTRAL CAP OF THE ROOF object{cap} //central cylinder object{si} //inner shell clipped_by{object{so}} //outer shell } // 12.4) ASSEMBLE THE OPAQUE PART OF THE ROOF UNIT ---------------------------- #declare skins = union{object{si} object{so}} //inner & outer skins of shell #declare segments = object{skins clipped_by{object{SM}}} #declare roof = union{ union{ object{segments} //the 6 opaque segments between skylights object{dividers} //vertical side-walls of segments object{cap_rim} //vertical outer rim of the centre cap object{skins clipped_by{object{cap}}} //top and bottom of centre cap } light_source{<0,1.69,0> color rgb<.4,.4,.4>} } //light source placed half way between top and bottom of central cap // 12.5) ASSEMBLE ROOF UNIT IN THE 3 SHELL COLOURS COMPLETE WITH GLASS WINDOWS- #declare windows = object{segments rotate<0,30,0> texture{GLASS}} #declare roof1 = union{object{roof texture{Shell_Colour1}} object{windows}} #declare roof2 = union{object{roof texture{Shell_Colour2}} object{windows}} #declare roof3 = union{object{roof texture{Shell_Colour3}} object{windows}} // 12.6) ASSEMBLE THE ROOF UNITS FOR THE WHOLE NINHO -------------------------- #declare roof_pair1 = union{ //roof-pair of colour 1 object{roof1 rotate<0,30,0> translate<0,0,RR>} //inner shell object{roof1 translate<0,0,d> rotate<0,30,0>} //outer shell } #declare roof_pair2 = union{ //roof-pair of colour 2 object{roof2 rotate<0,30,0> translate<0,0,RR>} //inner shell object{roof2 translate<0,0,d> rotate<0,30,0>} //outer shell } #declare roof_pair3 = object{roof3 rotate<0,30,0> translate<0,0,RR>} //colour 3 #declare roofs = union{ //all roofs of the ninho (patios don't have roofs) object{roof_pair1} object{roof_pair1 rotate<0, 60,0>} object{roof_pair2 rotate<0,180,0>} object{roof_pair3 rotate<0,240,0>} object{roof_pair3 rotate<0,300,0>} } // 13) SUPPORTS --------------------------------------------------------------- #declare gc = difference{ //create a glass segment difference{ difference{ //form cylindrical annulus cylinder{<0,-4.000,0>, <0,-1,0>, r - dr} //create cylinder cylinder{<0,-4.001,0>, <0,-.999,0>, 2} //then cut centre out } box{<0,-4.001,-bw>, } //cut off half of circular annulus rotate<0,120,0> //rotate all but 30 degrees of it out } box{<0,-4.001,-bw>, } //then kill what has been rotates out rotate<0,30,0> //to centre the its position } #declare support = union{ //create ring of 6 equally-spaced 30-degree segments #declare a = 0; #while(a < 360) object{gc rotate<0,a,0>} #declare a = a + 120; #end rotate<0,60,0> //to align the supports with the skylights } /* cone radius cr = r - 0.07230275*Tan(30) = r - 0.04174401 metres lower radius lr = cr + 2.5*Tan(30) = r - 0.04174401 + 1.44337567 metres lr = r + 1.40163166 metres cone radius cr = r - 0.57230275*Tan(30) = r - 0.33041915 metres lower radius lr = cr + 3*Tan(30) = r - 0.33041915 + 1.73205081 metres lr = r + 1.40163166 metres */ #declare kone = cone{<0,-4,0>, r + 1.40163166, <0,-1.5,0>, r - 0.04174401} #declare Support = union{ object{support clipped_by{object{kone}}} object{kone clipped_by{cylinder{<0,-1.57230275,0>, <0,0,0>, r}}} light_source{<0,-1.58230275,0> color rgb<.3,.3,.3>} } #declare support_pair = union{ //form an inner-outer pair 30 degrees apart object{Support translate<0,0,RR>} object{Support rotate<0,-60,0> translate<0,0,d> rotate<0,30,0>} } #declare support_quad = union{ object{support_pair} object{support_pair rotate<0,60,0>} } #declare supports = union{ object{support_quad texture{GLASS}} object{support_quad rotate<0,120,0> texture{GLASS}} object{support_quad rotate<0,240,0> texture{GLASS}} } // 14) ROAD ------------------------------------------------------------------- #declare rise = 0; #if(ground_level = -2) #declare rise = 1; #end #declare road = box{ <-1, ground_level + rise, RO + RR>, <+1, ground_level + rise + 0.01, fr> texture{ROAD} } // 15) DISPLAY THE COMPLETE LANDSHARE ----------------------------------------- union { // object{crater} //set the gleba inside a shallow crater object{gleba} //circular area with radial colour gradient object{road rotate<0,+60,0>} object{road} object{road rotate<0,-60,0>} union{ object{roofs} //roof and skylight units object{Inner_Shells texture{Shell_Colour1}} object{Outer_Shells texture{Shell_Colour1}} object{supports} // clipped_by{cylinder{<0,ground_level,0>, <0,0,0>, 100}} //to create open floor plan // clipped_by{box{<-50,-4,-50>, <50,4,0>}} //vertical slice view // translate } // object{ownership} //transparent ellipsoid showing extent of ownership space rotate<0,5,0> //give it a slight twist to make it look cute translate<0,0,-D> } // Programmer: Robert John Morton YE572246C