camera{location<0,0,-8> up y*.5 right x look_at 0} //camera{location -z*10000 up y*6 right x*6 look_at 0 angle .02} light_source{<10,0,-20>*10 color 1} #declare Tex1=texture{pigment{bozo color_map{[0 rgb <1,.98,.95>*.8][1 rgb <1,.98,.95>]} scale <.2,.4,.2>} finish{ambient 0 brilliance 2 metallic specular .3 roughness .04}} #declare Tex2=texture{pigment{granite color_map{[0 rgb <.6,.55,.548>*.8][.7 rgb <.6,.55,.548>]} scale .04} normal{granite .07 scale .04}} //NC - Number of sides //NH - Number of rows //H - Height of first row (0-1) //T1&T2 - textures #macro Triangles(NC,NH,H,T1,T2) #local CLen=(1/cos(2*pi/NC/2)); #declare A= prism{conic_sweep linear_spline -1,0,NC, #declare C=0; #while(C #declare C=C+1; #end translate y } #local Longer=CLen*CLen-1; #local Scale=(CLen*CLen)*(H/(Longer+H)); #local B=object{A scale rotate y*360/NC/2} /*#local O=object{A pigment{rgb x} clipped_by{object{B}} clipped_by{plane{-y,-.0001}} }*/ #local O=intersection{object{A texture{T1}}object{B texture{T2}}} union{ #declare C=0; #declare S=1; #declare T=0; #declare R=0; #while(C