#macro front_wall_fixed_section( tag, w_dim, w_ay, w_by, show_new, show_grille, gr_sx, gr_dx, gr_dz, fb_tz ) // A section of fixed wall with a fixed grille. // {tag} tag for par identification. // {w_dim} overall dimensions of wall, excluding foundation. // {w_ay} Y width of left grille-less section. // {w_by} Y width of right grille-less section. // {show_new} if true, uses the {tx_new} texture instead of the natural one. // {show_grille} if true, shows the grille // {gr_sx} X thickness of grille. // {gr_dx} X coord of back of grille rel to back of wall. // {gr_dz} Z coord of bottom of grille rel to sidewalk level. // {fb_tz} Z coord of top of foundation beam. // Origin is at front right edge, sidewalk level. // Solid wall minus foundation: #local w_solid = box{ < 0 + eps, 0 - eps, fb_tz - eps >, < w_dim.x - eps, w_dim.y + eps, w_dim.z - eps > } // Gap to be subtracted from solid wall: #debug concat("!! w_dim.y = ", str(w_dim.y,1,0), "\n") #debug concat("!! w_by = ", str(w_by,1,0), "\n") #local w_gap = box{ < 0 - eps, w_ay - 2*eps, gr_dz - eps >, < w_dim.x + eps, w_dim.y - w_by + 2*eps, w_dim.z + eps > } // The brick part of the wall: #local w_bricks = difference{ object{ w_solid } object{ w_gap } #if (show_new) texture{ tx_wall_new } #else texture{ tx_wall } #end } #local gr_sy = w_dim.y - (w_ay + w_by); #if (show_grille & (gr_sy > 200)) // The grille: #local w_gr_tag = concat(tag, ".g") #local w_gr_dim = < gr_sx, gr_sy, w_dim.z - gr_dz >; #local w_grille = object{ front_wall_grille( w_gr_tag, w_gr_dim ) #if (show_new) texture{ tx_grille_new } #else texture{ tx_grille } #end } // Together: #local wall = union{ object{ w_bricks translate - w_dim.x*x } object{ w_grille translate < gr_dx, w_ay, gr_dz > } } #else #local wall = object{ w_bricks translate - w_dim.x*x } #end wall #end