// Last edited on 2003-06-26 11:21:09 by stolfi // BRICK DIMENSIONS: #declare mb_L = 0.240; // Brick length #declare mb_H = 0.120; // Brick height #declare mb_W = 0.5*mb_L; // Brick width // GRILE BAR THICKNESS: #declare mb_wnd_A_bar_r = 0.012; #declare mb_wnd_B_bar_r = 0.008; // ROOM DIMENSIONS: #declare mb_room_dims_approx = < 2.500, 2.500, 3.500 >; #declare mb_room_nbricks = < floor(mb_room_dims_approx.x/mb_L+0.5), floor(mb_room_dims_approx.y/mb_L+0.5), 2*floor(mb_room_dims_approx.z/(2*mb_H)+0.5)>; #declare mb_room_dims = < mb_room_nbricks.x*mb_L, mb_room_nbricks.y*mb_L, mb_room_nbricks.z*mb_H >; // ====================================================================== // FRONT WALL - BOTTOM PART // Brick rows below bottom part: #declare mb_wall_front_b_dz = 0; // Width and height of front wall, bottom section: #declare mb_wall_front_b_nx = mb_room_nbricks.x; #declare mb_wall_front_b_nz = 2*ceil(0.400/(2*mb_H)); #declare mb_wall_front_b_sync = mod(mb_wall_front_b_dz,2); #declare mb_wall_front_b_section = object{ mb_wall_section( mb_wall_front_b_nx, mb_wall_front_b_nz, mb_wall_front_b_sync, mb_L, 1.1*mb_W, mb_H ) } // ====================================================================== // FRONT WALL - MIDDLE PART // Brick rows below middle part: #declare mb_wall_front_m_dz = mb_wall_front_b_dz + mb_wall_front_b_nz; // Height of middle section of front wall: #declare mb_wall_front_m_nz = 2*ceil(2.200/(2*mb_H)); // Width and height of wall sections at left and right of main window: #declare mb_wall_front_ml_nx = floor((mb_room_dims.x - 1.600)/(mb_L/2)/2 + 0.5)/2; #declare mb_wall_front_mr_nx = mb_wall_front_ml_nx; // Width of center wall section, containing main window: #declare mb_wall_front_mc_nx = mb_room_nbricks.x - mb_wall_front_ml_nx - mb_wall_front_mr_nx; // Brick rows in middle section below and above window: #declare mb_wall_front_m_wdz = 1; #declare mb_wall_front_m_whz = 0; // Height of main window: #declare mb_wall_front_m_wnz = mb_wall_front_m_nz - mb_wall_front_m_wdz - mb_wall_front_m_whz; // Wall sections in middle part: left, center, right #debug concat("\nfront wall: ml_nx = ", str(mb_wall_front_ml_nx,4,1), "\n") #debug concat("\nfront wall: mc_nx = ", str(mb_wall_front_mc_nx,4,1), "\n") #debug concat("\nfront wall: mr_nx = ", str(mb_wall_front_mr_nx,4,1), "\n") #declare mb_wall_front_ml_sync = mod(mb_wall_front_b_sync + mb_wall_front_b_nz,2); #debug concat("\nfront wall: ml sync = ", str(mb_wall_front_ml_sync,4,1), "\n") #declare mb_wall_front_ml_section = object{ mb_wall_section( mb_wall_front_ml_nx, mb_wall_front_m_nz, mb_wall_front_ml_sync, mb_L, mb_W, mb_H ) } #declare mb_wall_front_mc_sync = mod(mb_wall_front_ml_sync + floor(2*mb_wall_front_ml_nx + 0.5), 2); #debug concat("\nfront wall: mc sync = ", str(mb_wall_front_mc_sync,4,1), "\n") #declare mb_wall_front_mc_section = object{ mb_wnd_wall_section( mb_wall_front_mc_nx, mb_wall_front_m_nz, mb_wall_front_m_wdz, mb_wall_front_m_wnz, mb_wall_front_mc_sync, mb_wnd_A_bar_r, mb_L, mb_W, mb_H ) } #declare mb_wall_front_mr_sync = mod(mb_wall_front_mc_sync + floor(2*mb_wall_front_mc_nx + 0.5), 2); #debug concat("\nfront wall: mr sync = ", str(mb_wall_front_mr_sync,4,1), "\n") #declare mb_wall_front_mr_section = object{ mb_wall_section( mb_wall_front_mr_nx, mb_wall_front_m_nz, mb_wall_front_mr_sync, mb_L, mb_W, mb_H ) } #declare mb_wall_front_m_section = union{ object { mb_wall_front_ml_section } object { mb_wall_front_mc_section translate mb_wall_front_ml_nx*mb_L*x } object { mb_wall_front_mr_section translate (mb_wall_front_ml_nx + mb_wall_front_mc_nx)*mb_L*x } } // ====================================================================== // FRONT WALL - TOP PART // Brick rows below top part: #declare mb_wall_front_t_dz = mb_wall_front_b_nz + mb_wall_front_m_nz; // Height of top part: #declare mb_wall_front_t_nz = mb_room_nbricks.z - mb_wall_front_t_dz; // Width of wall sections containing secondary windows: #declare mb_wall_front_tl_nx = floor(0.600/(mb_L/2) + 0.5)/2; #declare mb_wall_front_tr_nx = mb_wall_front_tl_nx; // Width of wall section between secondary windows: #declare mb_wall_front_tc_nx = mb_room_nbricks.x - mb_wall_front_tl_nx - mb_wall_front_tr_nx; // Brick rows in top section below and above windows: #declare mb_wall_front_t_wdz = 0; #declare mb_wall_front_t_whz = 1; // Height of main window, : #declare mb_wall_front_t_wnz = mb_wall_front_t_nz - mb_wall_front_t_wdz - mb_wall_front_t_whz; // Wall sections in top part: left, center, right #declare mb_wall_front_tl_sync = mod(mb_wall_front_ml_sync + mb_wall_front_m_nz,2); #declare mb_wall_front_tl_section = object{ mb_wnd_wall_section( mb_wall_front_tl_nx, mb_wall_front_t_nz, mb_wall_front_t_wdz, mb_wall_front_t_wnz, mb_wall_front_tl_sync, mb_wnd_B_bar_r, mb_L, mb_W, mb_H ) } #declare mb_wall_front_tc_sync = mod(mb_wall_front_tl_sync + floor(2*mb_wall_front_tl_nx + 0.5), 2); #declare mb_wall_front_tc_section = object{ mb_wall_section( mb_wall_front_tc_nx, mb_wall_front_t_nz, mb_wall_front_tc_sync, mb_L, mb_W, mb_H ) } #declare mb_wall_front_tr_sync = mod(mb_wall_front_tc_sync + floor(2*mb_wall_front_tc_nx + 0.5), 2); #declare mb_wall_front_tr_section = object{ mb_wnd_wall_section( mb_wall_front_tr_nx, mb_wall_front_t_nz, mb_wall_front_t_wdz, mb_wall_front_t_wnz, mb_wall_front_tc_sync, mb_wnd_B_bar_r, mb_L, mb_W, mb_H ) } #declare mb_wall_front_t_section = union{ object { mb_wall_front_tl_section } object { mb_wall_front_tc_section translate mb_wall_front_tl_nx*mb_L*x } object { mb_wall_front_tr_section translate (mb_wall_front_tl_nx + mb_wall_front_tc_nx)*mb_L*x } } // // ====================================================================== // // LEFT AND RIGHT WALLS // // // Width of wall section containing "C" windows // #declare mb_wall_side_fwd_nx = 2*mb_wall_front_ml_nx; // #declare mb_wall_side_bck_nx = mb_room_nbricks.y - mb_wall_side_fwd_nx; // // // Rest of side wall: // // #declare mb_wall_C_section = // object{ // mb_wall_section( // mb_wall_side_bck_nx, mb_room_nbricks.z, 0, // mb_L,mb_W,mb_H // ) // } // ====================================================================== // BACK WALL - BOTTOM PART // Brick rows below bottom part: #declare mb_wall_back_b_dz = mb_wall_front_b_dz; // Width and height of back wall, bottom section; #declare mb_wall_back_b_nx = mb_room_nbricks.x; #declare mb_wall_back_b_nz = mb_wall_front_b_nz; #declare mb_wall_back_b_sync = mod(mb_wall_front_b_dz,2); #declare mb_wall_back_b_section = object{ mb_wall_section( mb_wall_back_b_nx, mb_wall_back_b_nz, mb_wall_back_b_sync, mb_L, 1.1*mb_W, mb_H ) } // ====================================================================== // BACK WALL - MIDDLE PART // Brick rows below middle part: #declare mb_wall_back_m_dz = mb_wall_back_b_dz + mb_wall_back_b_nz; // Width and height of middle section of back wall: #declare mb_wall_back_m_nx = mb_room_nbricks.x; #declare mb_wall_back_m_nz = mb_room_nbricks.z - mb_wall_back_m_dz; #declare mb_wall_back_m_sync = mod(mb_wall_back_m_dz,2); #declare mb_wall_back_m_section = object{ mb_wall_section( mb_wall_back_m_nx, mb_wall_back_m_nz, mb_wall_back_m_sync, mb_L, mb_W, mb_H ) } // ====================================================================== // ROOM WALLS #declare mb_room_walls = union { // Front wall: union { object { mb_wall_front_b_section translate mb_wall_front_b_dz*mb_H*z } object { mb_wall_front_m_section translate mb_wall_front_m_dz*mb_H*z } object { mb_wall_front_t_section translate mb_wall_front_t_dz*mb_H*z } translate -0.5*mb_room_nbricks.x*mb_L * x translate -0.5*mb_room_nbricks.y*mb_L * y } // Left wall: // union { // object { mb_wall_C_section } // object { mb_wall_B_section translate mb_wall_side_bck_nx*mb_L * x } // translate -0.5*mb_room_nbricks.y*mb_L * x // rotate -90*z // translate -0.5*mb_room_nbricks.x*mb_L * x // } // Right wall: // union { // object { mb_wall_B_section } // object { mb_wall_C_section translate mb_wall_side_fwd_nx*mb_L * x } // translate -0.5*mb_room_nbricks.y*mb_L * x // rotate 90*z // translate +0.5*mb_room_nbricks.x*mb_L * x // } // Back wall: union { object { mb_wall_back_b_section translate mb_wall_back_b_dz*mb_H*z } object { mb_wall_back_m_section translate mb_wall_back_m_dz*mb_H*z } translate -0.5*mb_room_nbricks.x*mb_L * x rotate 180*z translate +0.5*mb_room_nbricks.y*mb_L * y } } #declare mb_room = union { object { mb_room_walls } }