//Last edited on 2019-11-28 10:07:53 by jstolfi #include "bench_closet_chest.inc" #macro bench_closet_sampler(show_drawers, show_plates, what) // A set of chests of drawers for the lab bench with various numbers of drawers. // The X axis is back to front. // The Y axis is along the bench, left to right. // The Z axis is up. // The origin is at the back left bottom corner of the nominal dimensions. // If {what=1} returns the object, including gaps around and between chests. // If {what=0} returns the nominal dimensions (drawers closed, unexploded). // The nominal dims include the gaps around and between chests and // and the front drawer plates, but not the drawer handles. // Size of all chests, with gaps. #local chest4_dim = wh_chest(4, show_drawers, show_plates, 0); #local ygap = 2; // Gap to leave between chests. #local zgap = 50; // Gap to leave between chests. #local chset_dim = < chest4_dim.x, 4*chest4_dim.y + 3*ygap, 2*chest4_dim.z + ygap >; #if (what = 0) #local res = chset_dim; #else #local dy = chest4_dim.y + ygap; #local chset = union{ union{ #local ydisp = 0; object{ bench_closet_chest(3, show_drawers, show_plates, 1) translate ydisp*y } #local ydisp = ydisp + dy; object{ bench_closet_chest(6, show_drawers, show_plates, 1) translate ydisp*y } #local ydisp = ydisp + dy; object{ bench_closet_chest(4, show_drawers, show_plates, 1) translate ydisp*y } #local ydisp = ydisp + dy; object{ bench_closet_chest(8, show_drawers, show_plates, 1) translate ydisp*y } #local ydisp = ydisp + dy; } union{ #local ydisp = 0; object{ bench_closet_chest(5, show_drawers, show_plates, 1) translate ydisp*y } #local ydisp = ydisp + dy; object{ bench_closet_chest(10, show_drawers, show_plates, 1) translate ydisp*y } #local ydisp = ydisp + dy; object{ bench_closet_chest(7, show_drawers, show_plates, 1) translate ydisp*y } #local ydisp = ydisp + dy; translate (chest4_dim.z + zgap)*z } } #local res = object{ chset } #end res #end