/* POV-RAY PROGRAM ~/Private/website/landshare/shells-alt/other/barrels.pov TO GENERATE THE SIX-TOROID VERSION OF THE MODULES AND CONNECTING PASSAGES OF THE ACCOMMODATION UNIT OF THE EXPERIMENTAL FARMLET OF THE LANDSHARE PROJECT by Robert John Morton YE572246C Terminal command for: Small Frame: povray -visual DirectColor barrels.pov +W320 +H240 Medium Frame: povray -visual DirectColor barrels.pov +W640 +H480 Large Frame: povray -visual DirectColor barrels.pov +W1280 +H960 In a Nautilus window do "Ctrl-L Ctrl-Insert" to grab the directory path to this file. Then open a terminal and enter "cd Shift-Insert Enter" to take the terminal to this file's working directory. Finally, cut and paste one of the above commands into the terminal and press "Enter" to start tyhe rendering process. Set default width and height of picture in /etc/povray/3.6/povray.ini */ #include "colors.inc" #include "shapes.inc" #include "textures.inc" #include "metals.inc" #include "stones.inc" #include "glass.inc" global_settings{max_trace_level 256} /*max possible is 256 For a normal view, use oh = 100. For an exploded view at less than rd = 45 degrees, use oh = 120. For rd > 45, use oh = 150. Standard views are at rd = 10, 20, 30, 45, 60, 90 However, don't use rd = 90 because the azimuthal orientation goes potty. Use rd = 89.9 */ #declare oh = 250; //hypotenuse distance to observer: 100 normal 120 exploded #declare rd = 45; /*angle of elevation to observer: 0 for internal view x-offset (East-West) 0 = due South | height of observer above ground | | horizontal distance of observer from object | | | object is at the coordinate zero | | | | 13 for external 60 for internal views | | | | | */ camera{location<0, oh*sind(rd), oh*cosd(rd)> look_at<0,0,0> angle 5} /* LIGHTING --------------------------------------------------------------------------------------- light_source { <15, 200, 30> color rgb <1, 1, 1> } // for quick tests light_source { <7.25, 1.1, 8> color rgb <1, 1, 1> } // for quick tests 1) Simulate the sun */ #declare sun_white = light_source { // WHITE SUN IS ON THE HORIZON DUE SOUTH <0, 0, 1000> // located at south horizon color rgb <1,1,1> // white light cylinder // confined to a cylindrical beam radius 600 // of radius 100 units diameter at full intensity falloff 2000 // falling off to zero brightness at 70 units diameter area_light <1,0,0>, <0,0,1>, 20,20 // lighting element is a 20 x 20 array of 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> // the light beam is aimed at the co-ordinate origin } // jitter softens shadows /* rotate the sun to its desired elevation eg -60 means the sun is 60 degrees above the horizon due south. Rotate it round the z-axis to simulate time of day eg -15 means 15 degrees (one hour) before noon. Sun: ascention 80 degrees, declination 30 degrees */ object{sun_white rotate<-80,0,-30>} //object { sun_yellow } // BACKGROUND ------------------------------------------------------------------------------------- #declare ground_level = -4.5; //amount ground is below co-ordinate origin (in metres) #declare rp = 6378140; //Earth radius (metres) sphere{<0,0,0>, rp //create spherical planet the size of the Earth 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{ //standard sky sphere pigment{ gradient y color_map{ [(1 - cos(radians( 30)))/2 color White] [(1 - cos(radians(120)))/2 color rgb<0.4,0.6,1>] } scale 2 translate -1 } } #declare hall_light = light_source { <0,ground_level+2,0> // located in middle of hall color rgb <1,1,1> // white light cylinder // confined to a cylindrical beam radius 10 // of radius 10 units diameter at full intensity falloff 15 // falling off to zero brightness at 15 units diameter area_light <1,0,0>, <0,0,1>, 20,20 // lighting element is a 20 x 20 array of 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> // the light beam is aimed at the co-ordinate origin } // jitter softens shadows /* SPECIAL TEXTURES USED IN THIS PROJECT: The upper declaration for each colour is the conservative colouring used for the finished module. The lower declaration is for a bold exaggerated version of the colour for the purpose of illustrsating clearly the individual panels. */ #declare dm = texture{pigment{color // rgb<0.5, 0.60, 0.35> //grey with a suggestion of light green rgb<0, 0.6, 1> //alternative metiallic blue } finish{phong 0.8 ambient 0.5} } #declare lm = texture{pigment{color // rgb<0.55, 0.65, 0.53> //grey with a hint of red rgb<0.9, 0.9, 0.8> //alternative metallic white } finish{phong 0.8 ambient 0.5} } #declare GLASS = texture{pigment{color Col_Glass_General} finish{F_Glass8}} // GLEBA CIRCLE ----------------------------------------------------------------------------------- #declare YELLOW = texture { pigment { color rgb <0.90, 0.86, 0.32> } // crop corn colour finish { phong 0.8 ambient 0.4 } } #declare CROP = texture { pigment { color rgb <0.58, 0.55, 0.30> } // crop ploughed colour finish { phong 0.8 ambient 0.4 } } #declare LAKE = texture { pigment { color rgb <0.38671875, 0.625, 0.73828125> } // water blue finish { diffuse 0.3 ambient 0.3 phong .95 } } #declare gleba_height = .002; // gleba is 5 mm above ground level #declare fr = 79.788456088; // radius of a 2-hectare gleba (in metres) #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 rgb <1, 1, 0, 0.5>] // starts at yellow, then blend through to [1.0 color rgb <0.815, 1.015, 0.51, 0.5>] // field-green rgb <0.8, 1.0, 0.5> } } finish { // with surface characteristics: diffuse 0.2 // diffusion ambient 0.5 // effective ambient lighting (brightness) } } translate <0, ground_level, 0> // move the gradiented circle down to ground level } #declare gleba = object { gleb scale } // rescale to the size of the 2-hectare gleba /* THREE-CIRCLE GLEBA ----------------------------------------------------------------------------- A gleba is deemed to be 2 hectares in area. That is 20,000 square metres. A three-circle gleba therefore comprises 3 touching circles, each of which has an area of two-thirds of a hectare. */ #declare mgr = sqrt(20000/(3*3.141592653)); //radius of each of the three circles #declare glebshift = mgr * (1/cosd(30)-1); // #declare minigleb = object { gleb scale //squash a 2-hectare circle to a third of its area 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 } /* 1-THE HEXAGONAL ROAD SYSTEM -------------------------------------------------------------------- Each of the 3 hexagons has an area, A = 1 hectare = 10,000 square metres. The perpenducular between the mid-point of each side of a hexagon and that hexagon's centre, hp = sqrt(A/(6*tand(30))) metres. Each side of each hexagon, hs = 2*sqrt(A/(6*tand(60))) metres. The points of each hexagon are rounded to a radius ir = 11.5 metres. Consequently, the length of the straight part of each side of a hexagon, hst = hs - 2*(ir-1)*Tan(30) = 31.744778112 metres. */ #declare A = 10000; //area of hexagon in square metres #declare hp = sqrt(A/(6*tand(30))); //perp between mid-point of side & centre of 1-hec hexagon #declare hs = 2*sqrt(A/(6*tand(60))); //total length of the side of a 1-hectare hexagon in metres #declare ir = 11.5; //radius of the rounded corners of the 1-hectare hexagons #declare ird = ir + ir; //diameter #declare hst = hs-2*(ir-1)*tand(30); //length of straight part of road forming side of hexagon #declare road_height = 0.008; //thickness of road material = 8 millimetres #declare circ_road = difference{ //create a circular road 2 metres wide cylinder{<0, 0, 0>, <0, road_height, 0>, ir} //and 5 mm high cylinder{<0, -.01, 0>, <0, 2*road_height, 0>, ir - 2 pigment{color rgbt<1,1,1,1>} //make this inner circle invisible } } #declare hex_side = union{ object{ circ_road clipped_by{box{<-ird, -1, 0>, <+ird, +1, ird>}} rotate <0,30,0> //clip out a 30 degree arc for rounded corner clipped_by{box{<0, -1,-ird>, <-ird, +1, ird>}} translate <0, 0, 1-ir> //move it from origin to island tangent. } box{<0, 0, -1>, } //path 2 metres wide, x metres long, 8 mm high translate<-hst/2, ground_level, hp> // Move side to ground level and to a position } /* such that the hexagon of which it would be a part is centred at the co-ordinate origin. */ #declare hex = union{ //i = 0 to 360 creates a full hexagon as in ../virtual/virtual.htm #declare i = 120; //i = 120 to 240 creates the 3-arm swastica form #while(i < 240) object{hex_side rotate <0,i,0>} //form a complete hexagon #declare i = i + 60; #end translate //set co-ordinate origin at } //one corner of the hexagon #declare ROAD = texture{ pigment{colour rgb <0.52, 0.49, 0.50>} //light grey tarmac. // light brown dirt track: Hex d1a346. 209.163.70 as used in ../virtual/virtual.htm // pigment{colour rgb <0.81640625, 0.63671875, 0.1796875>} finish{phong 0.8 ambient 0.4} } #declare roads = union{ //create the 3-hexagon landshare object{hex} //bounded by peripheral roads object{hex rotate <0,120,0>} object{hex rotate <0,240,0>} clipped_by{cylinder{<0, -5, 0>, <0, -3, 0>, fr}} //clipped hexagon texture{ROAD} } // 2) GARDEN AND LAKE ----------------------------------------------------------------------------- #declare island_height = .006; //height of island #declare shift = 1-ir*(1+1/cosd(30)); //shift from lake-centred to landshare-centred #declare lake_radius = 19.5; //radius of lake #declare island = union{ object{circ_road texture{ROAD}} cylinder{ //island in the centre of the circular road <0, 0, 0>, <0, island_height, 0>, ir - 2 texture{ //define its texture that comprises: pigment{color rgb <0.8, 1.0, 0.5>} //colour field-green rgb <0.8, 1.0, 0.5> finish { //with surface characteristics: diffuse 0.2 //diffusion ambient 0.31 //effective ambient lighting (brightness) } } } translate <0, ground_level, ir> } #declare lake_height = .004; //lake height 4mm above ground #declare lake = cylinder{ //THE LAKE (centred on centre of lake) <0, ground_level, 0>, <0, ground_level + lake_height, 0>, lake_radius //Lake 19.5 metres radius. } // ELLIPSOIDAL SILO ------------------------------------------------------------------------------- #declare esilo = sphere{ <0, 0, 0>, 2 scale <1, 4, 1> //ellipsoidal silo basic shape translate <0, -2, -lake_radius - 4> //translate it 1.25 times the radius of the island from origin } #declare silo_group = union{ object{esilo rotate <0, +30, 0>} object{esilo} object{esilo rotate <0, -30, 0>} texture{dm} //same material as the ninho } // CROP AND LAKE SECTORS -------------------------------------------------------------------------- #declare Sector1 = object{lake // 1-Lake texture{LAKE} translate<0,0,shift> rotate<0,-30,0> } #declare Sector2 = union{ // 2-Crop object{lake texture{YELLOW}} object{silo_group} translate<0,0,shift> rotate<0,-150,0> } #declare Sector3 = union{ // 3-Crop object{lake texture{CROP}} object{silo_group} translate<0,0,shift> rotate<0,-270,0> } #declare ownership = sphere{ //Ellipsoid of gradiented ownership <0, -4, 0>, fr scale<1, 1.5, 1> texture{pigment{color Col_Glass_General}} } /* OBJECTS -------------------- Dimensions in Metres ------------------------------------ */ // TOROIDAL MODULE ----------------------------------------------------------- #declare SC2O = texture { pigment { color rgb <0.50, 0.52, 0.49>} //, 0.15> } // bluey-green 0.50, 0.52, 0.49 finish { phong 0.8 ambient 0.6 } // 0.47, 0.60, 0.51 } #declare glas = texture{ pigment{color rgb <0.8, 0.85, 0.9, 0.9>} //glass for windows finish{phong 0.9 ambient 0.5} } #declare invisible = texture{pigment{color rgbt<1,1,1,1>}} /* NEW VERION 27NOV2013 height = 9 metres vertical radius = 4.5 metres diameter = height x golden ratio = 14.5623058987 metres So radius = 7.281152949 metres */ #declare G = 1.6180339887; //golden ratio #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 10.921729424 #declare evr = 2; //ellipsoid's vertical radius #declare ehvr = evr / rs; //ellipsoid's vertical to horizontal ratio 0.183121182 #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 /* Create a version of the basic accommodation module divided into panels. First of all, create a thin box section from which to make the dividing flanges. This is just slightly bigger than the torus in the x and y directions (30 wide by 10 metres high) and 300mm thick in the z-direction. Then clip it by the basic torus object, leaving only the part of the box contained within the torus. */ #declare flange = union{ box{<-7.5,-5,-0.15>, <7.5,5,-0.002> clipped_by{object{T}}} box{<-7.5,-5,+0.15>, <7.5,5,+0.002> clipped_by{object{T}}} } /* create a clipping box that encloses half of the torus shell. */ #declare clippe = box{<-7.5,-5,0>, <7.5,5,7.5>} /* Isolate a singls 60-degree segment of the full torus. */ #declare segment = union{ object{T} object{flange} object{flange rotate<0,-60,0>} rotate<0, 60,0> clipped_by{clippe} rotate<0,120,0> clipped_by{clippe} } /* form an object comprising three 60-degree segments equally spaced around the circle. */ #declare segments = union{ object{segment rotate<0,-120,0>} object{segment} object{segment rotate<0,+120,0>} } /* Assemble a complete torus shell comprising two of the above objects, one transparent and the other opaque, the second being angularly off-set from the first by 60 degrees. */ #declare TP = merge{ union{ object{segments rotate<0,-45,0> texture{dm}} object{segments rotate<0,+15,0> texture{GLASS}} } cylinder{<0,-2,0>, <0,+2,0>, 3 texture{invisible}} } #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{GLASS} } #declare module = union{ //COMPLETE TOROIDAL MODULE difference{ //Module without glass union{ object{INNER_SHELL texture{lm}} object{TP} //outer shell } object{WC texture{invisible}} //window cutter } object{WINDOWS} // object{hall_light} rotate<0,165,0> // translate<0,0,-(R+R)> } #declare modules = union{ #declare a = 0; #while(a < 360) object{module rotate<0,a,0>} #declare a = a + 60; #end } #declare R1 = R * 0.35; #declare R2 = R1 * 0.17; //minor radius of corridor torus #declare q = 0.93; #declare half_AF = 2 * R * sind(60); /* CREATE THE TOROID-SECTION TO FORM THE CONNECTING PASSAGES BETWEEN THE SPHERICAL NODES. The minor radius of the torus = R, the radius of the main sphere. The major radius of the torus is the square root of (3 time R-squared). See torus_geom.png */ #declare T2 = torus{(R1 + R2) * sind(60), R2} //create torus #declare C = cylinder{<0, R/2, 0>, <0, -R/2, 0>, R1} #declare passage = object{T2 //torus as basis for forming connecting passages /* Clip so only the required section of the central core of the torus remains */ clipped_by{object{C}} /* Rotate the torus 90 degrees around the x-axis so its central axis lies along the z-axis of the coordinate system. Next, move its central point along the z-axis to lie on the periphery of the main sphere. */ rotate<90, 0, 0> scale translate } #declare passages = union{ #declare a = 0; #while(a < 360) object{passage rotate<0,a,0>} #declare a = a + 60; #end texture{dm} } /* Create the little stub floors for the passages (connecting corridors) */ #declare passage_floor = box{ <-1,-1,-1.5>, <1,-1.3,1.5> translate } #declare passage_floors = union{ #declare a = 0; #while(a < 360) object{passage_floor rotate<0,a,0>} #declare a = a + 60; #end texture{dm} } /* Cutting cylinders to make a hole for the passage in the main glass torus. */ #declare cutter = cylinder{ <0,0,0.5>, <0,0,-0.5>, R1-R2 scale translate } #declare cutters = union{ #declare a = 0; #while(a < 360) object{cutter rotate<0,a,0>} #declare a = a + 60; #end texture{invisible} } /* Assemble the complete dwelling */ union{ /* difference{object{modules} object{cutters}} object{passages} object{passage_floors} */ object{module} /* object{trigleb} //clover-leaf form of the gleba object{roads} //the three-way raos system of the gleba object{Sector1} //the lake (and island) object{Sector2} //first crop crescent object{Sector3} //second crop crescent rotate<0,-105,0> //to give the whole ninho a nice perspective angle [-105] // translate<0,0,R> */ }