// Door file for Doorway to enlightenment #version unofficial MegaPov 0.6; #declare WoodTex= texture { pigment {rgb 1.2} normal { wood 0.017 rotate <90,0,0> scale <0.08,0.5,0.08> turbulence 0.2 } finish {specular 0.23 roughness 0.1 brilliance 1 reflection 0.01 diffuse 0.55} } // Walls #declare Func1= function { "ridgedmf" <0.6,1.2,8,0.95,10> } #declare Func2= function { "superellipsoid" <0.04,0.04> } #macro FullBrick(Seed) #local R1=seed(Seed); #local X=rand(R1); #local Y=rand(R1); #local Z=rand(R1); isosurface { function { Func2(x/0.12,y/0.04,z/0.06) +0.004*Func1((x+4+4*X)/0.05,(y+4+4*Y)/0.001,(x+4+4*Z)/0.05) } max_gradient 30 sign -1 contained_by { box { <-0.13,-0.05,-0.07> <0.13,0.05,0.07> } } pigment {rgb <0.65,0.4,0.3>*1.3-<0.65,0.4,0.3>*0.2*rand(R1)} finish {specular 0.05 roughness 0.4 diffuse 0.62} } #end #macro HalfBrick(Seed) #local R1=seed(Seed); #local X=rand(R1); #local Y=rand(R1); #local Z=rand(R1); isosurface { function { Func2(x/0.06,y/0.04,z/0.06) +0.004*Func1((x+4+4*X)/0.05,(y+4+4*Y)/0.001,(x+4+4*Z)/0.05) } max_gradient 30 sign -1 contained_by { box { <-0.07,-0.05,-0.07> <0.07,0.05,0.07> } } pigment {rgb <0.65,0.4,0.3>*1.3-<0.65,0.4,0.3>*0.5*rand(R1)} finish {specular 0.05 roughness 0.4 diffuse 0.62} } #end #if(Simple) #macro FullBrick(Dummy) box { <-0.12,-0.04,-0.06> <0.12,0.04,0.06> pigment {rgb <0.65,0.4,0.3>} } #end #macro HalfBrick(Dummy) box { <-0.06,-0.04,-0.06> <0.06,0.04,0.06> pigment {rgb <0.65,0.4,0.3>} } #end #end #declare LeftWall= union { #declare i=0; #declare R1=seed(3546); #while (i<18) object { FullBrick(int(100000*rand(R1))) translate <-0.125*mod(i,2),i*0.085,0> translate <-0.375-0.125,0.04,0> } #declare i=i+1; #end #declare i=0; #while (i<18) #if(mod(i,2)=1) object { HalfBrick(int(100000*rand(R1))) translate <0,i*0.085,0> translate <-0.375-0.065,0.04,0> } #end #declare i=i+1; #end } #declare RightWall= union { #declare i=0; #declare R1=seed(35664); #while (i<18) object { FullBrick(int(100000*rand(R1))) translate <0.125*mod(i,2),i*0.085,0> translate <0.375+0.125,0.04,0> } #declare i=i+1; #end #declare i=0; #while (i<18) #if(mod(i,2)=1) object { HalfBrick(int(100000*rand(R1))) translate <0,i*0.085,0> translate <0.375+0.065,0.04,0> } #end #declare i=i+1; #end } #declare BottomWall= union { #local R1=seed(4356366); #local i=0; #local j=0; #while (j<6) #local i=0; #while (i<3) object { FullBrick(int(100000*rand(R1))) translate <0.125*mod(i+1,2)+0.25*j-0.25*3,i*0.085-0.215,0> } #local i=i+1; #end #local j=j+1; #end object { FullBrick(int(100000*rand(R1))) translate <0.125*mod(2,2)+0.25*6-0.25*3,1*0.085-0.215,0> } } #declare TopWall= union { #declare R1=seed(657); #local i=0; #local j=0; #while (j<5) #declare i=0; #while (i<3) object { FullBrick(int(100000*rand(R1))) translate <0.125*mod(i+1,2)+0.25*j-0.25*3+0.125,i*0.085+18*0.085+0.04,0> } #local i=i+1; #end #local j=j+1; #end object { FullBrick(int(100000*rand(R1))) translate <0.125*mod(2,2)+0.25*5-0.25*3+0.125,1*0.085+18*0.085+0.04,0> } } #declare Mortar= difference { box { <-0.605,-0.3,-0.058> <0.605,1.77,0.058> } box { <-0.375,0,-0.06> <0.375,18*0.085-0.005,0.15> } box { <-0.39,0,-0.06> <0.39,18*0.085+0.005,0.0> } texture { pigment { bozo color_map { [0 rgb <0.8,0.8,0.7>] [0.3 rgb 0.8] [0.6 rgb <0.8,0.8,0.6>*0.8] [1 rgb <0.8,0.7,0.4>*0.8] } turbulence 1 scale 0.001 } normal { granite 0.6 scale 0.003 } finish {specular 0.1 roughness 0.3 diffuse 0.55} } } // Door Frame #macro Upstrut() union { difference { box { <0,0,0> <0.05,1.525-0.05,0.15> } box { <0.04,-0.01,-0.01> <0.06,1.525-0.04,0.01> } box { <0.025,-0.01,0.04> <0.055,1.525-0.04,0.16> } } cylinder { <0.04,0,0.01> <0.04,1.525-0.05,0.01> 0.01 } } #end #macro Topstrut() union { difference { box { <-0.375,1.525-0.05,0> <0.375,1.525,0.15> } box { <-0.38,1.525-0.06,-0.01> <0.38,1.525-0.04,0.01> } box { <-0.375+0.025,1.525-0.025,0.04> <0.375-0.025,1.525-0.06,0.16> } } cylinder { <-0.375,1.525-0.04,0.01> <0.375,1.525-0.04,0.01> 0.01 } pigment {rgb 1} finish {specular 0.1 roughness 0.1 brilliance 0.8} } #end #declare Step= union { box { <-0.375,0,-0.1> <0.375,0.02,0.15> } cylinder { <-0.375,0.02,-0.09> <0.375,0.02,-0.09> 0.01 } intersection { box { <-0.375,-0.01,0> <0.375,0.01,0.35> rotate <-3.5,0,0> translate <0,0.02,-0.09> } box { <-0.376,0.005,-0.092> <0.376,0.035,0.15> } } texture {WoodTex rotate <0,0,90>} } //Door #declare BottomUpEdge= // Bottom Door Panel Vertical Borders difference { box { <-0.274,0.201,0.05> <-0.249,0.649,0.15> } box { <-0.02,0,0.03> <0.1,0.05,0.16> rotate <0,0,-45> translate <-0.274,0.649,0> } box { <-0.02,0,0.03> <0.1,-0.05,0.16> rotate <0,0,45> translate <-0.274,0.201,0> } cylinder { <-0.2625,0.2,0> <-0.2625,0.65,0> 0.035 scale <1,1,0.3> translate <0,0,0.05> } translate <0.2625,0,0> texture {WoodTex translate <0,-0.9,0>} } #declare TopUpEdge= // Top Door Panel Vertical Borders difference { box { <-0.274,0.801,0.05> <-0.249,1.39,0.15> } box { <-0.02,0,0.03> <0.1,0.05,0.16> rotate <0,0,-45> translate <-0.274,1.39,0> } box { <-0.02,0,0.03> <0.1,-0.05,0.16> rotate <0,0,45> translate <-0.274,0.801,0> } cylinder { <-0.2625,0.8,0> <-0.2625,1.39,0> 0.035 scale <1,1,0.3> translate <0,0,0.05> } translate <0.2625,0,0> texture {WoodTex translate <0,0.9,0>} } #declare HorEdge= // All Door Panel Horizontal Borders difference { box { <-0.274,0.201,0.055> <-0.051,0.224,0.15> } box { <-0.02,-0.02,0> <0,0.02,0.16> rotate <0,0,-45> translate <-0.274,0.201,0> } box { <0.02,-0.02,0> <0,0.02,0.16> rotate <0,0,45> translate <-0.051,0.201,0> } cylinder { <-0.274,0.2125,0> <0.05,0.2125,0> 0.035 scale <1,1,0.3> translate <0,0,0.05> } translate <0,-0.2125,0> texture {WoodTex rotate <0,0,90> translate <2,0,0>} } #declare DoorBox= // The actual door itself union { box { // Bottom Beam <-0.345,0.036,0.045> <0.345,0.2,0.15> texture {WoodTex rotate <0,0,90> translate <0.4,0.1,0>} } box { // Top Beam <-0.345,1.39,0.045> <0.345,1.495,0.15> texture {WoodTex rotate <0,0,90> translate <-0.4,1.45,0>} } box { // Left Beam <-0.345,0.201,0.045> <-0.275,1.494,0.15> texture {WoodTex translate <-0.3,0.8,0>} } box { // Right Beam <0.275,0.201,0.045> <0.345,1.494,0.15> texture {WoodTex translate <0.3,-0.8,0>} } difference { box { // Horizontal Middle <-0.274,0.65,0.045> <0.274,0.8,0.15> } box { // Mailbox hole <-0.12,0.69,0.04> <0.12,0.76,0.16> } texture {WoodTex rotate <0,0,90> translate <0.2,0.72,0>} } union { // Mail Box difference { box { <-0.125,0.685,0.04> <0.125,0.755,0.045> } box { <-0.105-0.005,0.705-0.005,0.03> <0.105+0.005,0.735+0.005,0.05> } } difference { cylinder { <-0.135,0,0> <0.135,0,0> 0.005 } box { <-0.03,-0.03,-0.02> <0,0.03,0.02> rotate <0,0,45> translate <-0.125,0,0> } box { <0.03,-0.03,-0.02> <0,0.03,0.02> rotate <0,0,-45> translate <0.125,0,0> } translate <0,0.755,0.045> } difference { cylinder { <-0.135,0,0> <0.135,0,0> 0.005 } box { <-0.03,-0.03,-0.02> <0,0.03,0.02> rotate <0,0,45> translate <-0.125,0,0> } box { <0.03,-0.03,-0.02> <0,0.03,0.02> rotate <0,0,-45> translate <0.125,0,0> } scale <1,-1,1> translate <0,0.685,0.045> } difference { cylinder { <0.125,0.675,0.045> <0.125,0.765,0.045> 0.005 } box { <-0.03,-0.03,0> <0.03,0,0.05> rotate <0,0,-45> translate <0.125,0.685,0> } box { <-0.03,0,0> <0.03,0.03,0.05> rotate <0,0,45> translate <0.125,0.755,0> } } difference { cylinder { <0.125,0.675,0.045> <0.125,0.765,0.045> 0.005 } box { <-0.03,-0.03,0> <0.03,0,0.05> rotate <0,0,-45> translate <0.125,0.685,0> } box { <-0.03,0,0> <0.03,0.03,0.05> rotate <0,0,45> translate <0.125,0.755,0> } scale <-1,1,1> } box { <-0.115,0.687,0.046> <0.115,0.753,0.05> } texture { pigment {rgb <1,0.85,0.62>*0.8} finish { diffuse 0.65 reflection_min 0.7 reflection_max 0.4 reflection_falloff 2 reflect_metallic metallic specular 0.4 roughness 0.01 brilliance 2 } normal {bumps 0.1 scale 0.1} } } box { // Bottom Partition <-0.05,0.201,0.045> <0.05,0.649,0.15> texture {WoodTex translate <0,0,0.045>} } box { // Bottom Left Pane <-0.25,0.225,0.055> <-0.075,0.625,0.15> texture {WoodTex translate <-0.13,0.2,0>} } box { // Bottom Right Pane <0.075,0.225,0.055> <0.25,0.625,0.15> texture {WoodTex translate <0.13,0.6,0>} } // Bottom Panel Borders object {BottomUpEdge translate <-0.2625,0,0>} object {BottomUpEdge scale <-1,1,1> translate <-0.0625,0,0>} object {HorEdge translate <0,0.2125,0>} object {HorEdge scale <1,-1,1> translate <0,0.6275,0>} object {BottomUpEdge translate <0.0625,0,0>} object {BottomUpEdge scale <-1,1,1> translate <0.2625,0,0>} object {HorEdge translate <0,0.2125,0> scale <-1,1,1>} object {HorEdge scale <1,-1,1> translate <0,0.6275,0> scale <-1,1,1>} difference { // Top Partition box { <-0.05,0.801,0.045> <0.05,1.389,0.15> } cylinder { // Hole for peephole <0,1.2,0.04> <0,1.2,0.16> 0.012 } texture {WoodTex translate <0,0.9,0>} } box { // Top Left Pane <-0.25,0.825,0.055> <-0.075,1.365,0.15> texture {WoodTex translate <-0.13,-0.9,0>} } box { // Top Right Pane <0.075,0.825,0.055> <0.25,1.365,0.15> texture {WoodTex translate <0.13,-1.9,0>} } object {TopUpEdge translate <-0.2625,0,0>} // Top Panel Borders object {TopUpEdge scale <-1,1,1> translate <-0.0625,0,0>} object {HorEdge translate <0,0.8125,0>} object {HorEdge scale <1,-1,1> translate <0,1.3775,0>} object {TopUpEdge translate <0.0625,0,0>} object {TopUpEdge scale <-1,1,1> translate <0.2625,0,0>} object {HorEdge translate <0,0.8125,0> scale <-1,1,1>} object {HorEdge scale <1,-1,1> translate <0,1.3775,0> scale <-1,1,1>} union { // Peep hole torus { 0.014,0.002 texture { pigment {rgb <1,0.85,0.62>*0.8} finish { diffuse 0.65 reflection_min 0.7 reflection_max 0.4 reflection_falloff 2 reflect_metallic metallic specular 0.4 roughness 0.01 brilliance 2 } normal {bumps 0.1 scale 0.1} } } sphere { 0,0.014 scale <1,0.7,1> material { texture { pigment {rgbf <1,1,1,0.99>} finish { reflection_type 1 reflection_max 0.7 reflection_min 0.3 reflection_falloff 2 specular 1 roughness 0.002 reflect_metallic conserve_energy } } interior { ior 1.5 dispersion 1.04 disp_nelems 10 } } } rotate <90,0,0> translate <0,1.2,0.045> } intersection { // WeatherBoard prism { quadratic_spline -03.23,0.323,11 <0,-0.5>,<0,-0.1>,<0,0>,<0.05,0.1>,<0.3,0.22>,<0.4,0.32>,<0.5,0.37>,<0.5,0.3>,<0.5,-0.05>,<0.5,-0.05>,<0,-0.1> } box { <0,-0.324,0> <0.5,0.324,0.4> } rotate <0,0,270> rotate <0,180,0> scale <1,0.21,0.14> translate <0,0.105,0> translate <0,0.038,0.045> texture {WoodTex rotate <0,0,90> translate <3,0.1,0>} } pigment {rgb 1} finish {specular 0.1 roughness 0.1 brilliance 0.8} } #declare Door= union { object {BottomWall} object {TopWall} object {LeftWall} object {RightWall} object {Mortar} object {Upstrut() texture {WoodTex translate <0,-0.9,0>} translate <-0.375,0,0>} object {Upstrut() texture {WoodTex translate <0,0.9,0>} scale <-1,1,1> translate <0.375,0,0>} object {Topstrut()texture {WoodTex rotate <0,0,90> translate <0.6,1.49,0>}} object {Step} object {DoorBox} }