partie 1 : les anneaux de Borromée partie 2 : les anneaux de Borromée plats partie 3 : un maillage avec les anneaux de Borromée ======================================PARTIE I==================================== /* Anneaux de Borromée */ #include "colors.inc" #macro xx(uu) cos(uu) #end #macro yy(uu) sin(uu) #end #macro zz(uu) cos(3*uu+pi/3)/3 #end //Lights, camera camera { orthographic location < 0,0,-4> look_at < 0,0, 0> } light_source { <-2, 3,-8> color rgb 1 shadowless } light_source { <5, 3, -8> color rgb 1 shadowless } // ---------------------------------------- plane { z,4 pigment { gradient y color_map { [0.01 Blue] [0.8 SkyBlue] } } scale 5*y translate <0,-2,0> } // --------------------------------------- #macro courbe(n,deb,fin,r) #local pas=(fin-deb)/n; #local uu = deb; sphere{ ,r } #while (uu<=fin) #local vv=uu+pas; cylinder{ ,,r } sphere{ ,r } #local uu=vv; #end //fin boucle #end //macro // --------------------------------------- #declare umin = 0; #declare umax = 2*pi; #declare iter = 200; #declare r = 0.2; #declare coeff=2/3; #declare anneau= union { // union 1 union { courbe(iter,umin,umax,r) // union 2 translate <1,0,0>*coeff texture { pigment { leopard color_map { [ 0.3 color red 1 green 1 blue 1] [ 0.2 color red 0.9 green 0.9 blue 0.5] [ 0.6 color red 1 green 0.7 blue 0] [ 0.8 color red 0.5 green 0.5 blue 0.1 filter 0.5] } // color_map scale 0.1 } // fin pigment finish { diffuse 0.2 ambient 0.6 reflection 0.1 roughness 0.01 specular 0.8 } } // fin texture } // fin union 1 union { courbe(iter,umin,umax,r) // union 3 translate *coeff texture { pigment { leopard color_map { [ 0.3 color red 1 green 0.85 blue 1] [ 0.2 color red 0.9 green 0.7 blue 0.9] [ 0.6 color red 0.8 green 0.3 blue 0.7] [ 0.8 color red 0.7 green 0 blue 0 filter 0.5] } // color_map scale 0.1 } // fin pigment finish { diffuse 0.2 ambient 0.6 reflection 0.1 roughness 0.01 specular 0.8 } } // texture // } // fin union 3 union { courbe(iter,umin,umax,r) // union 4 translate *coeff texture { pigment { leopard color_map { [ 0.3 color red 0.7 green 1 blue 0.7] [ 0.2 color red 0.5 green 1 blue 0.5] [ 0.6 color red 0.3 green 0.8 blue 0.3] [ 0.8 color red 0 green 0.6 blue 0 filter 0.5] } // color_map scale 0.1 } // fin pigment finish { diffuse 0.2 ambient 0.6 reflection 0.1 roughness 0.01 specular 0.8 } } // fin texture // } // fin union 4 finish{ ambient 0.2 diffuse 0.2 roughness 0.0001 specular 0.3} } // fin union 1 // --------------------------------------- object { anneau rotate -z*30 translate <-0.5,0,0>} object { anneau scale 0.5 rotate <65,30,0> translate <1.65,1.2,3>} ======================================PARTIE II==================================== /* Anneaux plats de Borromée */ #include "colors.inc" //Lights, camera camera { orthographic location < -2.5,2,-4> look_at < 0,0, 0> } light_source { <-4, 15,-18> color rgb 1 } //shadowless light_source { <5, 5, -8> color rgb 1 shadowless } // ---------------------------------------- plane { z,4 pigment { SkyBlue } // Blue} } // --------------------------------------- #declare r1 = 1; #declare r2 = 0.5; #declare coeff=2/3; #declare anneaux= union { torus { r1,r2 clipped_by {box{ <0,-2*r2,-r1-2*r2>, }} translate <1,0,0> } torus { r1,r2 clipped_by {box{ <0,-2*r2,-r1-2*r2>, }} rotate y*180 translate <-1,0,0> } cylinder {<-1,0,-1>,<1,0,-1>,r2} cylinder {<-1,0,1>,<1,0,1>,r2} } // --------------------------------------- union { object { anneaux texture { pigment { leopard color_map { [ 0.3 color red 1 green 1 blue 1] [ 0.2 color red 0.9 green 0.9 blue 0.5] [ 0.6 color red 1 green 0.7 blue 0] [ 0.8 color red 0.5 green 0.5 blue 0.1 filter 0.5] } // color_map scale 0.1 } // fin pigment finish { diffuse 0.2 ambient 0.6 reflection 0.1 roughness 0.01 specular 0.8 } } // fin texture } object { anneaux texture { pigment { leopard color_map { [ 0.3 color red 1 green 0.85 blue 1] [ 0.2 color red 0.9 green 0.7 blue 0.9] [ 0.6 color red 0.8 green 0.3 blue 0.7] [ 0.8 color red 0.7 green 0 blue 0 filter 0.5] } // color_map scale 0.1 } // fin pigment finish { diffuse 0.2 ambient 0.6 reflection 0.1 roughness 0.01 specular 0.8 } } // texture // rotate <0,90,90> } object { anneaux texture { pigment { leopard color_map { [ 0.3 color red 0.7 green 1 blue 0.7] [ 0.2 color red 0.5 green 1 blue 0.5] [ 0.6 color red 0.3 green 0.8 blue 0.3] [ 0.8 color red 0 green 0.6 blue 0 filter 0.5] } // color_map scale 0.1 } // fin pigment finish { diffuse 0.2 ambient 0.6 reflection 0.1 roughness 0.01 specular 0.8 } } // fin texture // rotate <90,0,90> } } ======================================PARTIE II==================================== /* Maillage de Borromée */ #include "colors.inc" #macro xx(uu) cos(uu) #end #macro yy(uu) sin(uu) #end #macro zz(uu) cos(3*uu+pi/3)/3 #end //Lights, camera camera { orthographic location < -1,2,-8> look_at < -1,2, 0> } light_source { <-2, 8,-8> color rgb 1 } //shadowless light_source { <5, 3, -8> color rgb 1 shadowless } // ---------------------------------------- plane { z,0.45 pigment { SkyBlue} /* gradient y color_map { [0.01 Blue] [0.6 SkyBlue] } scale 10*y translate <0,-3,0> } */ } // --------------------------------------- #macro courbe(n,deb,fin,r) #local pas=(fin-deb)/n; #local uu = deb; #while (uu<=fin) #local vv=uu+pas; cylinder{ ,,r } sphere{ ,r } #local uu=vv; #end //fin boucle #end //macro // --------------------------------------- #declare umin = 0; #declare umax = 2*pi; #declare iter = 300; #declare r = 0.12; #declare co1=0.75; #declare tx=<1,0,0>*co1; #declare t120=*co1; #declare t240=*co1; #declare t60= *co1; #declare anneau= union { // union 1 union { courbe(iter,umin,umax,r) // union 2 translate tx texture { pigment { leopard color_map { [ 0.3 color red 1 green 1 blue 1] [ 0.2 color red 0.9 green 0.9 blue 0.5] [ 0.6 color red 1 green 0.7 blue 0] [ 0.8 color red 0.5 green 0.5 blue 0.1 filter 0.5] } // color_map scale 0.1 } // fin pigment finish { diffuse 0.2 ambient 0.6 reflection 0.1 roughness 0.01 specular 0.8 } } // fin texture } // fin union 1 union { courbe(iter,umin,umax,r) // union 3 translate t120 texture { pigment { leopard color_map { [ 0.3 color red 1 green 0.85 blue 1] [ 0.2 color red 0.9 green 0.7 blue 0.9] [ 0.6 color red 0.8 green 0.3 blue 0.7] [ 0.8 color red 0.7 green 0 blue 0 filter 0.5] } // color_map scale 0.1 } // fin pigment finish { diffuse 0.2 ambient 0.6 reflection 0.1 roughness 0.01 specular 0.8 } } // texture // } // fin union 3 union { courbe(iter,umin,umax,r) // union 4 translate t240 texture { pigment { leopard color_map { [ 0.3 color red 0.7 green 1 blue 0.7] [ 0.2 color red 0.5 green 1 blue 0.5] [ 0.6 color red 0.3 green 0.8 blue 0.3] [ 0.8 color red 0 green 0.6 blue 0 filter 0.5] } // color_map scale 0.1 } // fin pigment finish { diffuse 0.2 ambient 0.6 reflection 0.1 roughness 0.01 specular 0.8 } } // fin texture // } // fin union 4 finish{ ambient 0.2 diffuse 0.2 roughness 0.0001 specular 0.3} } // fin union 1 // --------------------------------------- #declare co2=3 ; #declare bande=union { object {anneau } object {anneau translate co2*tx} object {anneau translate -co2*tx} object {anneau translate -2*co2*tx} // object {anneau translate 2*co2*tx} } // ----------- tracé du maillage ----------------- union { object {bande } object {bande translate co2*t60} object {bande translate 2*co2*t60 translate -co2*tx} }