Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // https://commons.wikimedia.org/wiki/Category:Golden_rhombohedra_in_Bilinski_dodecahedron_(brown)
- // for i in $(seq -f "%03g" 0 719); do povray rhombo.pov +H600 +W445 -D -k$i -O$i; done
- #version 3.6;
- global_settings { assumed_gamma 1.0 }
- #default{ finish{ ambient 0.1 diffuse 0.9 conserve_energy } }
- #include "colors.inc"
- #include "math.inc"
- ///////////////////////////// values
- #declare RadVert = .15;
- #declare RadEdge = .045;
- #declare Factor = 1.5;
- #declare Phi = (1 + sqrt(5)) / 2;
- #declare C0 = Factor;
- #declare C1 = Factor * Phi;
- #declare C2 = Factor * Phi * Phi;
- #declare C3 = Factor * Phi * Phi * Phi;
- ///////////////////////////// poins and arrays of points
- #declare P = array[16]{ // The last two entries are the inner points.
- <0, -C2, 0>, <0, C2, 0>,
- <0, -C0, -C0>, <0, -C0, C0>, <0, C0, -C0>, <0, C0, C0>,
- <-C1, -C1, 0>, <C1, -C1, 0>, <-C1, C1, 0>, <C1, C1, 0>,
- <-C1, 0, -C0>, <-C1, 0, C0>, <C1, 0, -C0>, <C1, 0, C0>,
- <0, -2*C1 + C2, 0>, <0, 2*C1 - C2, 0>
- }
- #declare Variant = "acute"
- #if (Variant = "acute")
- #declare EdgeArrays = array[12]{
- array[2]{0,6}, array[2]{6,10}, array[2]{10,8}, array[2]{8,15}, array[2]{15,3}, array[2]{3,0},
- array[2]{2,0}, array[2]{2,10}, array[2]{2,15},
- array[2]{11,8}, array[2]{11,3}, array[2]{11,6}
- }
- #declare LightEdgeArrays = array[8]{
- array[2]{0,7}, array[2]{6,14}, array[2]{2,12}, array[2]{10,4},
- array[2]{3,13}, array[2]{11,5}, array[2]{15,9}, array[2]{8,1}
- }
- #declare FaceArrays = array[6]{
- array[5]{2,0,6,10,2}, array[5]{2,10,8,15,2}, array[5]{2,15,3,0,2},
- array[5]{11,3,0,6,11}, array[5]{11,6,10,8,11}, array[5]{11,8,15,3,11}
- }
- #end
- #if (Variant = "obtuse")
- #declare EdgeArrays = array[12]{
- array[2]{0,6}, array[2]{6,10}, array[2]{10,4}, array[2]{4,12}, array[2]{12,7}, array[2]{7,0},
- array[2]{2,0}, array[2]{2,10}, array[2]{2,12},
- array[2]{14,4}, array[2]{14,7}, array[2]{14,6}
- }
- #declare LightEdgeArrays = array[8]{
- array[2]{0,3}, array[2]{7,13}, array[2]{2,15}, array[2]{12,9},
- array[2]{6,11}, array[2]{14,5}, array[2]{10,8}, array[2]{4,1},
- }
- #declare FaceArrays = array[6]{
- array[5]{2,10,4,12,2}, array[5]{2,12,7,0,2}, array[5]{2,0,6,10,2},
- array[5]{14,7,0,6,14}, array[5]{14,6,10,4,14}, array[5]{14,4,12,7,14}
- }
- #end
- #declare BlackVerticesArray = array[2]{ P[0], P[1] }
- #declare RedVerticesArray = array[4]{ P[2], P[3], P[4], P[5] }
- #declare GreenVerticesArray = array[4]{ P[6], P[7], P[8], P[9] }
- #declare BlueVerticesArray = array[4]{ P[10], P[11], P[12], P[13] }
- #declare InnerVerticesArray = array[2]{ P[14], P[15] }
- ///////////////////////////// camera and light
- #declare PerspCameraLocation = 37 * vnormalize(<13.2, 3, -45>);
- camera{
- location PerspCameraLocation
- look_at <0, .03, 0>
- right x*image_width/image_height
- angle 9.5
- }
- light_source{ <-400, 500, -300> color White*0.9 shadowless}
- light_source{ <400, 200, 100> color White*0.4 shadowless}
- light_source{ PerspCameraLocation color rgb<0.9,0.9,1>*0.2 shadowless}
- sky_sphere{ pigment{ White } }
- ///////////////////////////// define elements
- #declare BlackVertices = union { // top and bottom
- #for( Index, 0, 1 )
- sphere{ BlackVerticesArray[Index], RadVert }
- #end
- pigment{ color rgb .1 }
- }
- #declare RedVertices = union { // x
- #for( Index, 0, 3 )
- sphere{ RedVerticesArray[Index], RadVert }
- #end
- pigment{ color Red }
- }
- #declare GreenVertices = union { // right-hand y (left-hand z)
- #for( Index, 0, 3 )
- sphere{ GreenVerticesArray[Index], RadVert }
- #end
- pigment{ color rgb<0, .5, 0> }
- }
- #declare BlueVertices = union { // right-hand z (left-hand y)
- #for( Index, 0, 3 )
- sphere{ BlueVerticesArray[Index], RadVert }
- #end
- pigment{ color rgb<.03, .03, 1> }
- }
- #declare InnerVertices = union {
- #for( Index, 0, 1 )
- sphere{ InnerVerticesArray[Index], RadVert }
- #end
- pigment{ color Orange }
- }
- #declare LightEdges = union {
- #for( Index, 0, 7 )
- #local EdgeArray = LightEdgeArrays[Index];
- cylinder{ P[EdgeArray[0]], P[EdgeArray[1]], RadEdge }
- #end
- pigment{ color rgbt .7 }
- }
- #declare Edges = union {
- #for( Index, 0, 11 )
- #local EdgeArray = EdgeArrays[Index];
- cylinder{ P[EdgeArray[0]], P[EdgeArray[1]], RadEdge }
- #end
- }
- #declare Faces = union {
- #for( Index, 0, 5 )
- #local FaceArray = FaceArrays[Index];
- polygon{ 4,
- #for(VertexIndexInFace, 0, 3)
- P[FaceArray[VertexIndexInFace]]
- #end
- }
- #end
- }
- ///////////////////////////// show
- union{
- object{BlackVertices}
- object{RedVertices}
- object{BlueVertices}
- object{GreenVertices}
- object{InnerVertices}
- object{LightEdges}
- object{
- Edges
- pigment{ color rgb <189,143,91>/255 }
- }
- object{
- Edges
- scale -1
- pigment{ color rgb <132,100,63>/255 }
- }
- object{
- Faces
- pigment{ color rgbt <189,143,91,100>/255 }
- }
- object{
- Faces
- scale -1
- pigment{ color rgbt <132,100,63,100>/255 }
- }
- rotate y*clock/2
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement