// Last edited on 2019-06-29 00:27:38 by jstolfi #include "fume_hood_plates_front.inc" #macro fume_hood_plates(fr_dim,ctz,dr_dims,drz, what) // The steel plates surrounding the fume hood. // Assumes that the frame has dimensions {fr_dim}. // Assumes that the top surface of the counter is at {ctz} above the // bottom of the bottom plate. // Assumes that the drawers have nominal dimensions {dr_dims[kk]} // incuding the inter-drawer gaps. Uses only the {z} coordinate // of each dimension vector. // Assumes that the nominal box of the bottom drawer is {drz} above // the bottom surface of the frame. // The plates have thickness {plate_th} and surround the frame on // all sides. // If {what=1} returns the object. If {what=0} returns its nominal dimensions // instead (size of a tightbox that encloses all plates after placed on // the frame, ignoring {xplode} and {dropen}. #local th = plate_th; // Plate thickness. #local ins = tube_or + plate_xins; // Inset of plates from nominal frame edges. #local eps = 0.001; // Fudge displacement to avoid coincident surfaces. #local xp = 1.0*xplode; // Max explosion displacement. // Dimension of all plates after stuck on frame: #local plates_dim = fr_dim + < 2*th, 2*th, 2*th >; // Center and radius or exhaustor hole on top of top plate: #local hole_ctr = < th + 250, plates_dim.y/2, plates_dim.z-0.5*th >; #local hole_rad = 100; #if (what=0) #local res = plates_dim; #else // Left side plate, final position, exploded: #local side_plate = box{ < 0, 0, 0 > + < eps,eps,eps>, < fr_dim.x-2*ins, th, fr_dim.z-2*ins > - translate < th+ins, 0, th+ins > translate -xp*y texture{ tx_plate } } // Back wall plate, final position, exploded: #local back_plate = box{ < 0, 0, 0 > + < eps,eps,eps>, < th, fr_dim.y-2*ins, fr_dim.z-2*ins > - translate < 0, th+ins, th+ins > translate -xp*x texture{ tx_plate } } // Front plates, final position, exploded: #local front_plates = object{ fume_hood_plates_front(fr_dim,ctz,dr_dims,drz, 1) translate < plates_dim.x-th, th+ins, th + ins > translate xp*x } // Bottom slab plate, final position, UNEXPLODED: #local slab_plate = box{ < 0, 0, 0 >, < fr_dim.x-2*ins, fr_dim.y-2*ins, th > translate < 0, th+ins, ins > texture{ tx_plate } } // Bottom slab plate, final position,exploded: #local bot_plate = object{ slab_plate translate -xp*z } // Top slab plate, final position, exploded: #local top_plate = difference{ object{ slab_plate scale <1,1,-1> translate plates_dim.z*z } cylinder{ hole_ctr-3*th*z, hole_ctr+3*th*z, hole_rad texture { tx_cut } } translate +xp*z } #local res = union{ object{ side_plate } object{ side_plate scale <1,-1,1> translate plates_dim.y*y } object{ back_plate } object{ front_plates } object{ bot_plate } object{ top_plate } } #end res #end