// Last edited on 2021-01-12 22:57:24 by jstolfi // Imagem de um coletor solar vista do sol. // Coordenadas e dimensões em mm. #version 3.6; global_settings{ max_trace_level 30 } background{ color rgb < 0.850, 0.850, 0.850 > } #declare tx_espelho = texture{ pigment{ color rgb < 1.000, 1.000, 1.000 > } finish{ diffuse 0.05 reflection 0.95*< 1.000, 1.000, 1.000 > ambient 0 } } #declare tx_caldeira = texture{ pigment{ color rgb < 1.000, 0.000, 0.000 > } finish{ diffuse 0 ambient 1 } } #declare tx_solzinho = texture{ pigment{ color rgb < 1.000, 0.950, 0.300 > } finish{ diffuse 0.2 ambient 0.8 } } #declare tx_barras = texture{ pigment{ color rgb < 0.400, 0.400, 0.400 > } finish{ diffuse 0.8 ambient 0.1 } } #declare tx_plastico = texture{ pigment{ color rgb < 0.100, 0.800, 1.000 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_branca = texture{ pigment{ color rgb < 1.000, 1.000, 1.000 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_cinza = texture{ pigment{ color rgb < 0.500, 0.500, 0.500 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_preta = texture{ pigment{ color rgb < 0.010, 0.010, 0.010 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fixa = texture{ pigment{ color rgb < 0.000, 0.800, 0.100 > } finish{ diffuse 0.0 ambient 1.0 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.600, 0.600, 0.600 >, color rgb < 0.900, 0.900, 0.900 > } finish{ diffuse 0.9 ambient 0.1 } scale 500 } #local tx_invisivel = texture{ pigment{ color rgb < 1,1,1 > filter 1.000 } finish{ diffuse 0.000 ambient 0.000 } } #local tx_vidro = texture{ pigment{ color rgb < 1,1,1 > filter 0.960 } finish{ diffuse 0.005 ambient 0.005 reflection 0.030 * < 1,0,0 > specular 0.35 roughness 0.005 } } #include "eixos.inc" #macro espelho_redondo(CE,RE,DE) // Espelho circular de raio {RE}, centro {CE} e normal {DE} (unitario). #local esp = 6.0; // Espessura (mm). intersection{ cylinder{ CE - esp/2*DE, CE + esp/2*DE, RE + esp texture{ tx_espelho } } cylinder{ CE - esp*DE, CE + esp*DE, RE texture{ tx_preta } } } #end #macro caldeira(CC,RC,HC) // Caldeira com centro {CC}, raio {RC}, altura {HC}, centrada no eixo {Z}. cylinder{ CC - HC/2*z, CC + HC/2*z, RC texture{ tx_caldeira } } #end #macro nao_interfere(CE,RE,CC,RC,HC) #local ok = 0; #if ((CE.x + RE < CC.x - RC) | (CE.x - RE > CC.x + RC)) #local ok = 1; #end #if ((CE.y + RE < CC.y - RC) | (CE.y - RE > CC.y + RC)) #local ok = 1; #end #if ((CE.z + RE < CC.z - RC) | (CE.z - RE > CC.z + RC)) #local ok = 1; #end ok #end #macro solzinho(R) sphere{ <0,0,0>, R texture{ tx_solzinho } } #end #macro armacao(RA,RB) // Armação de barras de raio {RB} envolvendo o cubo {[-RA _ +RA]^3}. union{ #local enc = RA/(RA + RB); // Fator de encolhimento #local du = -1; #while (du <= +1) #local dv = -1; #while (dv <= +1) cylinder{ enc*RA*< -1, du, dv >, enc*RA*< +1, du, dv >, RB } cylinder{ enc*RA*< du, dv, -1 >, enc*RA*< du, dv, +1 >, RB } cylinder{ enc*RA*< dv, -1, du >, enc*RA*< dv, +1, du >, RB } sphere{ enc*RA*< -1, du, dv >, 1.001*RB } sphere{ enc*RA*< +1, du, dv >, 1.001*RB } #local dv = dv + 2; #end #local du = du + 2; #end texture{ tx_barras } } #end #macro refletor(RA,nx,ny,nz,epos,edir,RE) union{ #local ix = 0; #while (ix < nx) #local iy = 0; #while (iy < ny) #local iz = 0; #while (iz < nz) #local CE = epos[ix][iy][iz]; #local DE = edir[ix][iy][iz]; // Verifica se espelho interfere com caldeira: #if (nao_interfere(CE,RE,CC,RC,HC)) object{ espelho_redondo(CE,RE,DE) } #end #local iz = iz + 1; #end #local iy = iy + 1; #end #local ix = ix + 1; #end } #end #macro cena(RA,RB,nx,ny,nz,epos,edir,RE,CC,RC,HC) union{ box{ RA*< -30, -30, -0.1 >, RA*< +30, +30, 00.0 > translate -10*z texture{ tx_xadrez } } union{ // object{ eixos(1.2*RA) } object{ armacao(RA,RB) } object{ refletor(RA,nx,ny,nz,epos,edir,RE) } object{ caldeira(CC,RC,HC) } translate RA*z } } #end #include "direcao_do_sol.inc" #include "dimensoes.inc" #include "parametros.inc" #include "argumentos.inc" object{ cena(RA,RB,nx,ny,nz,epos,edir,RE,CC,RC,HC) } #include "camlight.inc" #declare centro_cena = < 0, 0, RA >; #declare raio_cena = 2.0*RA; #declare dir_camera = direcao_do_sol(lat,est,hora); #declare dist_camera = 10*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera, z, intens_luz)