#ifndef(Has_color) #declare Has_color = false; #end #ifndef(col1) #declare col1 = pigment { rgb <1,0,0> } #end #ifndef(col2) #declare col2 = pigment { rgb <0,1,0> } #end #ifndef(col3) #declare col3 = pigment { rgb <0,0,1> } #end #ifndef(col4) #declare col4 = pigment { rgb <1,1,0> } #end #declare txtr1 = texture { pigment { col1 } } #declare txtr2 = texture { pigment { col2 } } #declare txtr3 = texture { pigment { col3 } } #declare txtr4 = texture { pigment { col4 } } #macro rad(A) radians(A) #end #declare a0 = 60; #declare a1 = 90; #declare a2 = a1+120; #declare a3 = a2+120; #declare p1 = ; #declare p2 = ; #declare p3 = ; #declare p4 = <0,abs(p1.x+p2.x),0>; #declare h2 = p4.y/2; #declare H = p4.y; #declare shape_1 = mesh { #if(!Has_color) triangle { p1,p2,p3 } triangle { p1,p2,p4 } triangle { p2,p3,p4 } triangle { p1,p3,p4 } #else triangle { p1,p2,p3 texture { txtr1 } } triangle { p1,p2,p4 texture { txtr2 } } triangle { p2,p3,p4 texture { txtr3 } } triangle { p1,p3,p4 texture { txtr4 } } #end } #ifndef(Radius) #declare Radius=0.1; #end #declare shape_2 = blob { threshold 0.6 #if(!Has_color) cylinder { p1,p2,Radius,100 } cylinder { p2,p3,Radius,100 } cylinder { p3,p1,Radius,100 } cylinder { p1,p4,Radius,100 } cylinder { p2,p4,Radius,100 } cylinder { p3,p4,Radius,100 } #else cylinder { p1,p2,Radius,100 pigment { col1 } } cylinder { p2,p3,Radius,100 pigment { col2 } } cylinder { p3,p1,Radius,100 pigment { col3 } } cylinder { p1,p4,Radius,100 pigment { col4 } } cylinder { p2,p4,Radius,100 pigment { col3 } } cylinder { p3,p4,Radius,100 pigment { col1 } } #end } #declare shape_3 = blob { threshold 0.6 #if(!Has_color) cylinder { 0,p1,Radius,100 } cylinder { 0,p2,Radius,100 } cylinder { 0,p3,Radius,100 } cylinder { 0,p4,Radius,100 } #else cylinder { 0,p1,Radius,100 pigment { col1 } } cylinder { 0,p2,Radius,100 pigment { col2 } } cylinder { 0,p3,Radius,100 pigment { col3 } } cylinder { 0,p4,Radius,100 pigment { col4 } } #end } #declare p5 = p1*.5; #declare p6 = p2*.5; #declare p7 = p3*.5; #declare p8 = p4*.5; #macro Tetra2(a,Lvl) #if (Lvl>0) #declare b = union { object { a scale .5 translate p5 } object { a scale .5 translate p6 } object { a scale .5 translate p7 } object { a scale .5 translate p8 } } #end #undef a #if(Lvl!=1) Tetra2(b,Lvl-1) #else object { b } #end #end #declare l1 = union { light_source { <10,10,-10> rgb 1 } light_source { <0,0,0> rgb <.2,.2,.3> shadowless} } #declare l2 = union { light_source { p1 rgb <1,0,0> shadowless} light_source { p2 rgb <0,1,0> shadowless} light_source { p3 rgb <0,0,1> shadowless} light_source {-p4 rgb <1,1,0> shadowless} rotate y*30 scale 4 } #declare l3 = union { light_source {< 2,0,0> rgb <1,0,0> shadowless} light_source {<-2,0,0> rgb <1,1,0> shadowless} light_source {<0, 2,0> rgb <0,1,0> shadowless} light_source {<0,-2,0> rgb <0,1,1> shadowless} light_source {<0,0, 2> rgb <0,0,1> shadowless} light_source {<0,0,-2> rgb <1,0,1> shadowless} rotate y*30 }