// Last edited on 2022-04-16 23:04:19 by stolfi #macro light_box( libox_dim, bot_thk, top_thk, side_thk ) // Light box to be placed behind holder. // {libox_dim} overall dimension vector of light box. // {bot_thk} thickness of bottom plate. // {top_thk} thickness of top plate. // {side_thk} thickness of side plates. // Materials: "psai.o" = PSAI (high impact polystyrene) white opaque, "ps.d" = PS (polystyrene) white diffusing. #local front_thk = 1.7; // Thickness of fromt diffuser plate. #local back_thk = 3.0; // Thickness of back plate. #local sex = 2*libox_dim.x; // Reference displacement for exploded view. // Top plate, with bottom left back corner at origin: #local top_sx = libox_dim.x - front_thk - back_thk; #local top_sy = libox_dim.y; #local top_plate = box{ < 0, 0, 0 > + eps3, < top_sx, top_sy, top_thk > - eps3 texture{ tx_plate_z } } write_pieces( "psai.o", "LTop", 1, top_sy, top_sx, top_thk, "libox top plate" ) // Bottom plate, with bottom left back corner at origin: #local bot_sx = libox_dim.x - front_thk - back_thk; #local bot_sy = libox_dim.y; #local bot_plate = box{ < 0, 0, 0 > + eps3, < bot_sx, bot_sy, bot_thk > - eps3 texture{ tx_plate_z } } write_pieces( "psai.o", "LBot", 1, bot_sy, bot_sx, bot_thk, "libox bottom plate" ) // Left side plate, with bottom left back corner at origin: #local side_sx = libox_dim.x - front_thk - back_thk; // {X} size of side plates. #local side_sz = libox_dim.z - top_thk - bot_thk; // Height of side plates. #local side_plate = box{ < 0, 0, 0 > + eps3, < side_sx, side_thk, side_sz, > - eps3 texture{ tx_plate_y } } write_pieces( "psai.o", "LSid", 2, side_sz, side_sx, side_thk, "libox side wall" ) // Back plate, with bottom left back corner at origin: #local back_sy = libox_dim.y; // {Y} width of back plates. #local back_sz = libox_dim.z; // Height of back plate. #local back_plate = box{ <0,0,0> + eps3, < back_thk, back_sy, back_sz > - eps3 texture{ tx_plate_x } } write_pieces( "psai.o", "LBak", 1, back_sy, back_sz, back_thk, "libox back wall" ) // Front plate, with bottom left front corner at origin: #local front_sy = libox_dim.y; // {Y} width of front plates. #local front_sz = libox_dim.z; // Height of front plate. #local front_plate = box{ <0,0,0> + eps3, < front_thk, front_sy, front_sz > - eps3 texture{ tx_plate_x } } write_pieces( "ps.d", "LFrn", 1, front_sy, front_sz, front_thk, "libox front wall" ) union{ union{ object{ bot_plate } object{ top_plate translate < 0, 0, libox_dim.z - top_thk > translate xplode*sex*< 0, 0, +2 > } union{ object{ side_plate translate < 0, 0, bot_thk > translate xplode*sex*< 0, -1, +1 > } object{ side_plate scale < +1, -1, +1 > translate < 0, libox_dim.y, bot_thk > translate xplode*sex*< 0, +1, +1 > } } translate back_thk*x } object{ back_plate translate xplode*sex*< -1, 0, +1 > } object{ front_plate translate (libox_dim.x - front_thk)*x translate xplode*sex*< +1, 0, +1 > } } #end