// PoVRay 3.6 Include File "HexPen.inc" // author: Florian Simon // date: 2011/11/01 #ifndef( HexPen_Inc_Temp) #declare HexPen_Inc_Temp = version; #version 3.62; #macro Hex( Sl, Di ) // -------------------- dimensions #local D = 0.01*Di; #local S = Sl*1; #local Rl = 0.02*Di;// "edge" radius #local Rp = 0.04*Di;//"point" radius #local ru = S/(2*cos(54*2*pi/360)); // ------------------------- // Hexagon merge{ // the corners merge{ sphere{ <0,0,0>, Rp translate rotate <0,0,0>} sphere{ <0,0,0>, Rp translate rotate <0,60,0>} sphere{ <0,0,0>, Rp translate rotate <0,120,0>} sphere{ <0,0,0>, Rp translate rotate <0,180,0>} sphere{ <0,0,0>, Rp translate rotate <0,240,0>} sphere{ <0,0,0>, Rp translate rotate <0,300,0>} texture{ Corner_Texture } } // the edges merge{ cylinder{ <0,0,0>,, Rl rotate<0,60,0> translate<-S,0,0>} cylinder{ <0,0,0>,, Rl rotate<0,-60,0> translate<-S,0,0>} cylinder{ <0,0,0>,, Rl rotate<0,120,0> translate} cylinder{ <0,0,0>,, Rl rotate<0,-120,0> translate} cylinder{ <-0.5*S,0,0>,<0.5*S,0,0>, Rl translate<0,0,sin(pi/3)*S>} cylinder{ <-0.5*S,0,0>,<0.5*S,0,0>, Rl translate<0,0,-sin(pi/3)*S>} texture{ Edge_Texture } } // the faces object{ Column_N (6, sin(pi/3)*S, 2*D ) translate <0,-D,0> rotate<0,30,0>} texture{ Face_Texture } rotate <0,30,0> translate<0,0,-S>}// end of union ------------------ // end of Hexagon ---------------- #end //end of macro------------------------------- // Pentagon #macro Pen( Sl, Di ) // Die Flaechen: // -------------------- dimensions #local D = 0.01*Di; #local S = Sl*1; #local Rl = 0.02*Di;// "edge" radius #local Rp = 0.04*Di;//"point" radius #local ru = S/(2*cos(54*2*pi/360)); // ------------------------- merge{ // the corners merge{ sphere{ <0,0,0>, Rp translate <0,0,ru> rotate <0,0,0>} sphere{ <0,0,0>, Rp translate <0,0,ru> rotate <0,72,0>} sphere{ <0,0,0>, Rp translate <0,0,ru> rotate <0,144,0>} sphere{ <0,0,0>, Rp translate <0,0,ru> rotate <0,216,0>} sphere{ <0,0,0>, Rp translate <0,0,ru> rotate <0,288,0>} texture{ Corner_Texture } } // the edges merge{ cylinder{ <0,0,0>,<0,0,-S>, Rl rotate<0,54,0> translate<0,0,ru>} cylinder{ <0,0,0>,<0,0,-S>, Rl rotate<0,-54,0> translate<0,0,ru>} cylinder{ vrotate(<0,0,-ru>, <0,37,0>),vrotate(<0,0,-ru>, <0,-37,0> ), Rl } cylinder{ vrotate(<0,0,-ru>, <0,37,0>),vrotate(<0,0,-ru>, <0,37+72,0> ), Rl } cylinder{ vrotate(<0,0,-ru>, <0,-37,0>),vrotate(<0,0,-ru>, <0,-37-72,0> ), Rl } texture{ Edge_Texture } } // the faces object{ Column_N (5, S/10*sqrt(25+10*sqrt(5)), 2*D ) translate <0,-D,0> rotate<0,234,0>} texture{ Face_Texture } translate<0,0,-ru> }// end of union ------------------ // end of Pentagon ---------------- #end //end of macro---------------- // Hexagon and Pentagon without colours #macro Hex_C( Sl, Di ) // Die Flaechen: // -------------------- dimensions #local D = 0.01*Di; #local S = Sl*1; #local Rl = 0.02*Di;// "edge" radius #local Rp = 0.04*Di;//"point" radius #local ru = S/(2*cos(54*2*pi/360)); // ------------------------- // Hexagon merge{ // Die Eckpunkte merge{ sphere{ <0,0,0>, Rp translate rotate <0,0,0>} sphere{ <0,0,0>, Rp translate rotate <0,60,0>} sphere{ <0,0,0>, Rp translate rotate <0,120,0>} sphere{ <0,0,0>, Rp translate rotate <0,180,0>} sphere{ <0,0,0>, Rp translate rotate <0,240,0>} sphere{ <0,0,0>, Rp translate rotate <0,300,0>} } // Die Kanten merge{ cylinder{ <0,0,0>,, Rl rotate<0,60,0> translate<-S,0,0>} cylinder{ <0,0,0>,, Rl rotate<0,-60,0> translate<-S,0,0>} cylinder{ <0,0,0>,, Rl rotate<0,120,0> translate} cylinder{ <0,0,0>,, Rl rotate<0,-120,0> translate} cylinder{ <-0.5*S,0,0>,<0.5*S,0,0>, Rl translate<0,0,sin(pi/3)*S>} cylinder{ <-0.5*S,0,0>,<0.5*S,0,0>, Rl translate<0,0,-sin(pi/3)*S>} } // Die Fl?he object{ Column_N (6, sin(pi/3)*S, 2*D ) translate <0,-D,0> rotate<0,30,0>} rotate <0,30,0> translate<0,0,-S>}// end of union ------------------ // end of Hexagon ---------------- #end //end of macro------------------------------- // Pentagon #macro Pen_C( Sl, Di ) // Die Flaechen: // -------------------- dimensions #local D = 0.01*Di; #local S = Sl*1; #local Rl = 0.02*Di;// "edge" radius #local Rp = 0.04*Di;//"point" radius #local ru = S/(2*cos(54*2*pi/360)); // ------------------------- merge{ // Die Eckpunkte merge{ sphere{ <0,0,0>, Rp translate <0,0,ru> rotate <0,0,0>} sphere{ <0,0,0>, Rp translate <0,0,ru> rotate <0,72,0>} sphere{ <0,0,0>, Rp translate <0,0,ru> rotate <0,144,0>} sphere{ <0,0,0>, Rp translate <0,0,ru> rotate <0,216,0>} sphere{ <0,0,0>, Rp translate <0,0,ru> rotate <0,288,0>} } // Die Kanten merge{ cylinder{ <0,0,0>,<0,0,-S>, Rl rotate<0,54,0> translate<0,0,ru>} cylinder{ <0,0,0>,<0,0,-S>, Rl rotate<0,-54,0> translate<0,0,ru>} cylinder{ vrotate(<0,0,-ru>, <0,37,0>),vrotate(<0,0,-ru>, <0,-37,0> ), Rl } cylinder{ vrotate(<0,0,-ru>, <0,37,0>),vrotate(<0,0,-ru>, <0,37+72,0> ), Rl } cylinder{ vrotate(<0,0,-ru>, <0,-37,0>),vrotate(<0,0,-ru>, <0,-37-72,0> ), Rl } } // Die Fl?he object{ Column_N (5, S/10*sqrt(25+10*sqrt(5)), 2*D ) translate <0,-D,0> rotate<0,234,0>} translate<0,0,-ru> }// end of union ------------------ // end of Pentagon ---------------- #end //end of macro---------------- // Hexagon and Hexagon with Angle (Sidelength, Thickness, Angle) #macro HexHex (Sl, Di, Ang) merge { object{Hex(Sl,Di) rotate<0,-120,0> rotate<0,0,Ang+180>} object{Hex(Sl,Di) rotate<0,120,0> rotate<0,0,0> } } #end #macro HexPen (Sl, Di, Ang) merge { object{Pen(Sl,Di) rotate<0,-36,0> rotate} object{Hex(Sl,Di) rotate<0,-150,0> rotate<0,0,0>} } #end // Hexagon and Hexagon with Angle (Sidelength, Thickness, Angle) TextureLESS #macro HexHex_C (Sl, Di, Ang) merge { object{Hex_C(Sl,Di) rotate<0,-120,0> rotate<0,0,Ang+180>} object{Hex_C(Sl,Di) rotate<0,120,0> rotate<0,0,0> } } #end #macro HexPen_C (Sl, Di, Ang) merge { object{Pen_C(Sl,Di) rotate<0,-36,0> rotate} object{Hex_C(Sl,Di) rotate<0,-150,0> rotate<0,0,0>} } #end #version HexPen_Inc_Temp; #end