// -------------------------------------------------------------------------- #version 3.7; // -------------------------------------------------------------------------- #declare useMyMacros = false; #declare useAreaLights = true; #declare displayISO = true; #declare SimpleTexture = false; #declare useTransmit = true; // -------------------------------------------------------------------------- // --- INCLUDES ------------------------------------------------------------- // -------------------------------------------------------------------------- #include "colors.inc" #if(useMyMacros) #include "myMacros.inc" #end #include "functions.inc" #include "textures.inc" #include "metals.inc" global_settings { assumed_gamma 1.80 max_trace_level 10 } // -------------------------------------------------------------------------- // --- SCENE ---------------------------------------------------------------- // -------------------------------------------------------------------------- camera { #if(useMyMacros) location p2r(15, 28, 7, false) #else location <5.970, 3.286, 1.600> #end look_at <0, 0.20, 0> angle 36 } // -------------------------------------------------------------------------- // --- HDRI SKY SPHERE ------------------------------------------------------ // -------------------------------------------------------------------------- #declare fileName = "hdr_v1_07"; sphere { 0,500 pigment { image_map { hdr fileName once interpolate 2 map_type 1 } } finish { emission 0.10 diffuse 0.80 } hollow rotate 135*y } // -------------------------------------------------------------------------- // --- LIGHT ---------------------------------------------------------------- // -------------------------------------------------------------------------- #macro makeAreaLight(AreaSize,AreaLevel) #local n=1+pow(2,AreaLevel); area_light -*0.50, +*0.50, n, n adaptive 1 jitter orient circular #end light_source { #if(useMyMacros) p2r(15, 60, 100, true) #else <48.296, 86.603, 12.941> #end colour rgb 1 #if (useAreaLights) makeAreaLight(200,5) #end } // -------------------------------------------------------------------------- // --- FLOOR ---------------------------------------------------------------- // -------------------------------------------------------------------------- #declare normal_A = normal { bumps 1.20 scale 4 } #declare normal_B = normal { wrinkles 0.40 // 1.20 scale 2 } #declare My_Normal = normal_B; #declare Texture_CeramicLight = texture { pigment { White*1.00 } finish { ambient 0.00 emission 0.10 diffuse 0.80 reflection { 0.05 fresnel on } specular 0.90 roughness 1/20 } normal { My_Normal } } #declare Texture_CeramicDark = texture { pigment { White*0.20 } finish { ambient 0.00 emission 0.10 diffuse 0.80 reflection { 0.05 fresnel on } crand 0.50 specular 0.90 roughness 1/20 } normal { My_Normal } } #declare Texture_Mortar = texture { pigment { granite color_map { [ 0 White*0.60 ] [ 1 White*0.30 ] } scale 0.10 } finish { ambient 0.00 emission 0.10 diffuse 0.80 } } // --- hexagons ------------------------------------------------------------- #declare tileDim = 1.60; #declare tileH = 0.05; #declare tileZDim = 1.60; #declare hSize = tileDim/4; #declare delta = tileDim + 2* tileH; #declare p0 = <0*hSize, -tileH, 1*hSize>; #declare p1 = <0*hSize, -tileH, 3*hSize>; #declare p2 = <1*hSize, -tileH, 4*hSize>; #declare p3 = <3*hSize, -tileH, 4*hSize>; #declare p4 = <4*hSize, -tileH, 3*hSize>; #declare p5 = <4*hSize, -tileH, 1*hSize>; #declare p6 = <3*hSize, -tileH, 0*hSize>; #declare p7 = <1*hSize, -tileH, 0*hSize>; #declare oneHexa = union { sphere { p0, tileH } sphere { p1, tileH } sphere { p2, tileH } sphere { p3, tileH } sphere { p4, tileH } sphere { p5, tileH } sphere { p6, tileH } sphere { p7, tileH } cylinder { p0, p1, tileH } cylinder { p1, p2, tileH } cylinder { p2, p3, tileH } cylinder { p3, p4, tileH } cylinder { p4, p5, tileH } cylinder { p5, p6, tileH } cylinder { p6, p7, tileH } cylinder { p7, p0, tileH } polygon { 9 p0,p1,p2,p3,p4,p5,p6,p7,p0 translate tileH*y } translate tileH*<1,0,1> } #declare allHexa = union { #declare xIndex = -6; #while (xIndex < 3) #declare zIndex = -4; #while (zIndex < 2 ) object { oneHexa translate *delta } #declare zIndex=zIndex+1; #end #declare xIndex=xIndex+1; #end } // --- squares -------------------------------------------------------------- #declare eps = 0.5*tileH*sqrt(2); #declare pp0 = <-hSize+eps, -tileH, 0>; #declare pp1 = <0, -tileH, hSize-eps>; #declare pp2 = ; #declare pp3 = <0, -tileH, -hSize+eps>; #declare oneSquare = union { sphere { pp0, tileH } sphere { pp1, tileH } sphere { pp2, tileH } sphere { pp3, tileH } cylinder { pp0, pp1, tileH } cylinder { pp1, pp2, tileH } cylinder { pp2, pp3, tileH } cylinder { pp3, pp0, tileH } polygon { 5 pp0,pp1,pp2,pp3,pp0 translate tileH*y } } #declare allSquares = union { #declare xIndex = -6; #while (xIndex < 3) #declare zIndex = -4; #while (zIndex < 2 ) object { oneSquare translate *(tileDim+2*tileH) } #declare zIndex=zIndex+1; #end #declare xIndex=xIndex+1; #end } // --- mortar --------------------------------------------------------------- #declare allHexaMin = min_extent(allHexa); #declare allHexaMax = max_extent(allHexa); #declare Mortar = box { allHexaMax, allHexaMin translate -0.02*y } // --- floor ---------------------------------------------------------------- object { allHexa texture { Texture_CeramicLight } } object { allSquares texture { Texture_CeramicDark } } object { Mortar texture { Texture_Mortar } } // -------------------------------------------------------------------------- // --- HECICAL TORUS ISOSURFACE --------------------------------------------- // -------------------------------------------------------------------------- #if(displayISO) #declare transmitValue = 0.00; #if (useTransmit) #declare transmitValue = 0.25; #end #declare myColorMap = color_map { [ 0.00 rgb < 1.00000, 0.50000, 1.00000> transmit transmitValue ] [ 0.10 rgb < 1.00000, 0.50000, 1.00000> transmit transmitValue ] [ 0.20 rgb < 0.50000, 0.50000, 1.00000> transmit transmitValue ] [ 0.30 rgb < 0.20000, 0.20000, 1.00000> transmit transmitValue ] [ 0.40 rgb < 0.20000, 1.00000, 1.00000> transmit transmitValue ] [ 0.50 rgb < 0.20000, 1.00000, 0.20000> transmit transmitValue ] [ 0.60 rgb < 1.00000, 1.00000, 0.20000> transmit transmitValue ] [ 0.70 rgb < 1.00000, 0.50000, 0.20000> transmit transmitValue ] [ 0.80 rgb < 1.00000, 0.20000, 0.20000> transmit transmitValue ] [ 0.90 rgb < 1.00000, 0.20000, 0.20000> transmit transmitValue ] [ 1.00 rgb < 1.00000, 0.50000, 1.00000> transmit transmitValue ] } // P0 : major radius, // P1 : number of winding loops // P2 : Twistiness of winding. When zero, each winding loop is separate. // When set to one, each loop twists into the next one. // When set to two, each loop twists into the one after next // P3 : Fatness of winding? // P4 : Threshold. Setting this parameter to 1 and the threshold to zero has // similar effect as setting this parameter to zero and the threshold to 1 // P5 : Negative minor radius ? // Reducing this parameter increases the minor radius of the central torus. // Increasing it can make the torus disappear and be replaced by a vertical // column. // The value at which the surface switches from one form to the other // depends on several other parameters // P6 : Another fatness of winding control? // P7 : Groove period. Increase this for more grooves // P8 : Groove amplitude. Increase this for deeper grooves // P9 : Groove phase. Set this to zero for symmetrical grooves isosurface { function { f_helical_torus (x, y, z, 1, 9, 5, 0.25, 0.10, -0.15, 0, 1, 1, 0) } contained_by { box { <-1.50, -1.00, -1.50>, <1.50, 1.00, 1.50> } } max_gradient 10 texture { pigment { radial color_map { myColorMap } } finish { specular 0.10 roughness 0.10 phong 0.20 #if(!SimpleTexture) reflection 0.20 #end } } #if(!SimpleTexture) interior { ior 1.50 } #end rotate<0,0,0> scale 1 translate< 0, 0.50, 0> } #end