#macro front_wall_small_gate( tag, g_dim, g_dx, g_open ) // The small (pedestrian) gate. // {tag} tag for part identification. // {g_dim} dimensions of gate. // {g_dx} X coordinate of back face of gate. // {g_open} If 1, show gate half-open. #local g_frame_sy = 40; // Y width of frame. // The wing (mobile part) of the gate: #local g_wing_tag = concat( tag, ".w1" ) #local g_wing_dim = g_dim - 2*g_frame_sy*y; #local g_grille = object{ front_wall_grille( g_wing_tag, g_wing_dim ) texture { tx_grille } } #local g_wing = object{ g_grille } // The fixed part of the gate: #local g_frame = sphere{ g_dim/2, 20 texture{ tx_bug } } // !!! Define !!! // Opening angle: #local g_open_deg = 60*g_open; #local gate = union{ object{ g_frame } object{ g_wing translate - g_wing_dim.x*x rotate g_open_deg*z translate + g_wing_dim.x*x + g_frame_sy*y } } gate #end