| $fn=100;
|
|
|
| in=1;
|
| box_width=5.5*in;
|
| box_depth=20*in;
|
| box_height=7.5*in;
|
| sheet_thickness=.125*in;
|
|
|
| side_hole_diameter=1.5*in;
|
| side_hole_spacing=2.25*in;
|
|
|
| bottom_hole_width=.75*in;
|
| bottom_hole_length=2.5*in;
|
| bottom_hole_spacing=4*in;
|
|
|
| assembled_box();
|
|
|
| module assembled_box() {
|
| // A front panel, back panel, bottom panel, and two side panels.
|
| color("red")
|
| translate([0,box_depth+sheet_thickness,sheet_thickness])
|
| rotate([90,0,0])
|
| back_panel();
|
| color("blue")
|
| translate([0,sheet_thickness,sheet_thickness])
|
| rotate([90,0,0])
|
| front_panel();
|
| color("green")
|
| translate([box_width-sheet_thickness,0,box_height+sheet_thickness])
|
| rotate([0,90,0])
|
| side_panel();
|
| color("cyan")
|
| translate([0,0,box_height+sheet_thickness])
|
| rotate([0,90,0])
|
| side_panel();
|
| color("black")
|
| bottom_panel();
|
| }
|
|
|
| module bottom_panel() {
|
| linear_extrude(height=sheet_thickness)
|
| bottom_panel_primitive();
|
| }
|
|
|
| module bottom_panel_primitive() {
|
| difference() {
|
| square([box_width,box_depth]);
|
| bottom_panel_holes();
|
| }
|
| }
|
|
|
| module bottom_panel_holes() {
|
| for (i=[1:4], j=[1:2]) {
|
| translate([(box_width/3)*j,bottom_hole_spacing*i])
|
| scale([bottom_hole_width,bottom_hole_length])
|
| circle(d=1);
|
| }
|
| }
|
|
|
| module back_panel() {
|
| linear_extrude(height=sheet_thickness)
|
| back_panel_primitive();
|
| }
|
|
|
| module back_panel_primitive() {
|
| square([box_width,box_height]);
|
| }
|
|
|
| module front_panel() {
|
| linear_extrude(height=sheet_thickness)
|
| front_panel_primitive();
|
| }
|
|
|
| module front_panel_primitive() {
|
| scale([1,1/2])
|
| back_panel_primitive();
|
| }
|
|
|
| module side_panel() {
|
| linear_extrude(height=sheet_thickness)
|
| side_panel_primitive();
|
| }
|
|
|
| module side_panel_primitive() {
|
| difference() {
|
| square([box_height,box_depth]);
|
| side_panel_helper();
|
| side_holes();
|
| }
|
| }
|
|
|
| module side_panel_helper() {
|
| difference() {
|
| scale([1/2,1/2])
|
| square([box_height,box_depth]);
|
| translate([box_height/2,box_depth/2])
|
| scale([box_height,box_depth])
|
| circle(d=1);
|
| }
|
| }
|
|
|
| module side_holes() {
|
| for (packed_params = [ [1/4,7,7], [2/4,8.5,8], [3/4,8,8] ]) {
|
| translate([box_height*packed_params.x,box_depth-(side_hole_spacing)*packed_params.y])
|
| side_hole_line(packed_params.z);
|
| }
|
| }
|
|
|
| module side_hole_line(n) {
|
| for (i = [0:n-1]) {
|
| translate([0,0+side_hole_diameter/2+side_hole_spacing*i])
|
| circle(d=side_hole_diameter);
|
| }
|
| }
|