// Persistence of Vision Ray Tracer Scene Description File // File: StudWall.inc // Vers: 3.6 // Desc: StudWall Macro Include File // Date: 1-17-06 // Auth: Lawrence Winstead // ==== Standard POV-Ray Includes ==== #include "colors.inc" // Standard Color definitions #include "textures.inc" // Standard Texture definitions #include "functions.inc" // internal functions usable in user defined functions #default{pigment{Brown}} #macro StudWall(length, height, door, d_sec) // Stud Wall // ------------------------------------------------- // Variables #declare wall_len = length; #declare wall_ht = height; #declare i_len = 16; #declare s_width = 1.5; #declare stud_count = int(wall_len/(i_len+s_width)); #declare delta = wall_len - (stud_count * (i_len+s_width)); #declare stud = box{<0,0,0><1.5,wall_ht,3.5>}; union{ // ------------------------------------------------- // The Bottom Stud // ------------------------------------------------- box { <0,0,0> <1.5, wall_len, 3.5> // 2x4 - "wall_len" length by inches rotate <0,0,-90> translate <0,0,0> } // ------------------------------------------------- // The Top Stud // ------------------------------------------------- box { <0,0,0> <1.5, wall_len, 3.5> // 2x4 - "Wall_len" length by inches rotate <0,0,-90> translate <0,wall_ht+s_width,0> } // ------------------------------------------------- // ------------------------------------------------- // The loop for the inner wall // ------------------------------------------------- // Local Variable #declare SC = stud_count; #if (delta < (s_width*2)) #declare SC = SC - 1; #end #if (door) #while (SC >= 0) #if (SC = d_sec) object{ stud translate<(i_len*SC)+(s_width*SC)-s_width,0,0>} object{ stud translate<(i_len*(SC+2))+(s_width*(SC+2))+s_width,0,0>} #end #if (door) box{<0,0,0><1.5,35,3.5> rotate -90*z translate<(i_len*d_sec)+(s_width*d_sec)+s_width,84,0>} box{<0,0,0><1.5,12,3.5> translate<(i_len*(d_sec+0.8))+(s_width*(d_sec-1)),84,0>} box{<0,0,0><1.5,12,3.5> translate<(i_len*(d_sec+1.2))+(s_width*(d_sec+3)),84,0>} #end #if (SC = d_sec+1) #else object{ stud translate <(i_len*SC)+(s_width*SC),0,0>} #end #declare SC = SC - 1; #end #else #while (SC >= 0) object{ stud translate<(i_len*SC)+(s_width*SC),0,0>} #declare SC = SC - 1; #end #end // ------------------------------------------------- // End of Inner Wall Loop // ------------------------------------------------- // ------------------------------------------------- // ------------------------------------------------- // The Left-most Vertical Stud // ------------------------------------------------- box { <0, 0, 0> <1.5,wall_ht,3.5> // 2x4 x 8ft stud } // ------------------------------------------------- // The Right-most Stud // ------------------------------------------------- box { <0,0,0> <1.5,wall_ht,3.5> rotate <0,0,0> translate } // ------------------------------------------------- // END OF STUDWALL MACRO // ------------------------------------------------- translate <0,0.5,0>} #end