/* -------------------------- Entry: 0018 WWW: http:// Title: Golden Section Author: Georg Mogk The picture “Golden Section” is a fractal similar the well known Sirpinski gasket. The attractors are the vertexes of a regular pentagon an the scaling factor for each iteration is the Golden Section. If you choose a scaling factor less then the Golden Section you get a totally unconnected set of points. The golden area shows the “Golden Section Gasket” after seven iterations. The silver wire represents the path of each point during the iteration (approximated by a spline). ---------------------------*/ // Golden Section // 2004-04-13 //***************************** Global *************************** camera { location <0, 1.5, 0 > look_at <0,0,0> right x } light_source { <3, 4, 2> color <1,1,1>} //******************** Materials ************************************************* #declare P_Silver1 = color rgb <0.94, 0.93, 0.80>; #declare F_MetalA = finish { ambient 0.35 brilliance 2 diffuse 0.3 metallic specular 0.80 roughness 1/20 reflection 0.1 }; #declare P_Gold1 = rgb <1.00, 0.875, 0.575> - <0.00, 0.20, 0.40>; #declare T_Silver_1A = texture { pigment { P_Silver1 } finish { F_MetalA } }; #declare T_Gold_1A = texture { pigment { P_Gold1 } finish { F_MetalA } }; #declare T_Grnt15 = texture { pigment {granite turbulence 0.6 color_map {[0.000, 0.104 color rgbt <0.161, 0.133, 0.118, 0.000> color rgbt <0.110, 0.082, 0.071, 0.000>] [0.104, 0.252 color rgbt <0.110, 0.082, 0.071, 0.000> color rgbt <0.161, 0.133, 0.118, 0.000>] [0.252, 0.383 color rgbt <0.161, 0.133, 0.118, 0.000> color rgbt <0.000, 0.000, 0.000, 0.000>] [0.383, 0.643 color rgbt <0.000, 0.000, 0.000, 0.000> color rgbt <0.161, 0.133, 0.118, 0.000>] [0.643, 0.783 color rgbt <0.161, 0.133, 0.118, 0.000> color rgbt <0.220, 0.149, 0.137, 0.000>] [0.783, 0.922 color rgbt <0.220, 0.149, 0.137, 0.000> color rgbt <0.000, 0.000, 0.000, 0.000>] [0.922, 0.983 color rgbt <0.000, 0.000, 0.000, 0.000> color rgbt <0.220, 0.149, 0.137, 0.000>] [0.983, 1.001 color rgbt <0.220, 0.149, 0.137, 0.000> color rgbt <0.161, 0.133, 0.118, 0.000>] } } } //******************** Basic Definitions ***************************************************** // Vertexes of a regular n-side (3d) #macro nEck(n) #declare NECK=array[n]; #local num =0; #while (num; #local num =num +1; #end // while NECK #end // Vertexes of a regular n-side (2d) #macro nEckuv(n) #declare NECKUV=array[n]; #local num =0; #while (num; #local num =num +1; #end // while NECKUV #end #declare phi=1-(-1 +sqrt(5))/2; // golden Section // Pentagon #declare ppp =nEckuv(5); #declare Penta= prism { linear_sweep linear_spline 0, 0.005, 6, ppp[0],ppp[1],ppp[2],ppp[3],ppp[4],ppp[0] }; // Draw a Spline // pu : Points // dick : tickness // typ : Type of Spline #macro DrawSpline(pu,dick,typ) sphere_sweep{ #switch (typ) #case (0) linear_spline dimension_size(pu,1), #break #case (1) cubic_spline dimension_size(pu,1), #break #case(2) b_spline dimension_size(pu,1)+3, pu[0],dick pu[0],dick #break #end //switch #local num=0; #while (num; object{ende translate PuList[dimension_size(PuList,1)-1]} DrawSpline(PuList,dick,2) #else #local org = PuList; #local num=0; #while (num < dimension_size(attrac,1)) #local PuList = org; #local PuList[itLevel] =AttracFactor*attrac[num]; #local ind =itLevel+1; #while (ind , 0.0001 }},0.03) texture { T_Silver_1A finish { ambient 0.15 diffuse 0.75 phong 1} } } object{ CopyAndClone (7, object{Penta}, nEck(5), , phi) texture { T_Gold_1A normal { bumps 0.5 scale 0.15} finish { ambient 0.15 diffuse 0.75 phong 1} } } plane { y, -0.0 texture { T_Grnt15 normal { agate 0.15 scale 0.15} finish { ambient 0.15 diffuse 0.95 phong 0.5 } scale 1 } }