$fn=45; width = 244 + 15; height = 168; radius = 7.0; radius2 = 3.0; radius3 = 5.5; radius4 = 9.0; PART = "all"; /* cube([10, 10, 10]); %sphere(10); cylinder(10, 5, 5); #translate([10, 0, 0]) cube([10, 10, 10]); rotate(a = 90, v= [1, 0, 0]) cylinder(20, 5, 5); for (i = [10:10:100]) { translate([15, i, 0]) cylinder(20, 5, 1); } */ include include module snapfits() { translate([0, -height / 2.0, 5]) snapfit(); translate([0, -height / 2.0, 13]) snapfit(); translate([0, height / 2.0, 5]) rotate(180, [1, 0, 0]) snapfit(); translate([0, height / 2.0, 13]) rotate(180, [1, 0, 0])snapfit(); } module snapfits_neg() { translate([0, -height / 2.0, 5]) snapfit_neg(); translate([0, -height / 2.0, 13]) snapfit_neg(); translate([0, height / 2.0, 5]) rotate(180, [1, 0, 0]) snapfit_neg(); translate([0, height / 2.0, 13]) rotate(180, [1, 0, 0])snapfit_neg(); translate([19, height / 2.0 - 12, -5]) cube([6, 6, 10]); translate([-10, height / 2.0 - 12, -5]) cube([6, 6, 10]); translate([19, -height / 2.0 + 12, -5]) cube([6, 6, 10]); translate([-10, -height / 2.0 + 12, -5]) cube([6, 6, 10]); } module cutout(h, r, r1, r2) { hull() { translate([width / 2.0 - r, -height / 2.0 + r, 0]) cylinder(h, r1, r2); translate([-width / 2.0 + r, -height / 2.0 + r, 0]) cylinder(h, r1, r2); translate([width / 2.0 - r, height / 2.0 - r, 0]) cylinder(h, r1, r2); translate([-width / 2.0 + r, height / 2.0 - r, 0]) cylinder(h, r1, r2); } } module support(sw, sz, w, h, t) { union() { difference() { translate([0, 0, 0]) cube([sw, h, sz]); translate([t / 2.0, - 2.0, t / 2.0]) cube([sw - t, h + 4, sz - t]); } } translate([0, 0, 0]) cube([sw, 30.0, sz]); difference() { hull() { translate([0, 0.0, sz + 20.0]) rotate(90, [0, 1, 0]) cylinder(sw, 6.0, 6.0); translate([0, 0.0, sz - 16.0]) rotate(90, [0, 1, 0]) cylinder(sw, 6.0, 6.0); } translate([-4.0, 0.0, sz + 20.0]) rotate(90, [0, 1, 0]) cylinder(sw + 8.0, 3.15, 3.15); } } module vents() { w = width + 60.0; hull() { translate([-w / 2.0, 0, 4.0]) rotate(90, [0, 1, 0]) cylinder(w, 1.8, 1.8); translate([-w / 2.0, 0, 16.0]) rotate(90, [0, 1, 0]) cylinder(w, 1.8, 1.8); } } module main_shell() { color([0, 0.6, 0.5]) translate([0, 0, 0]) hull() { translate([width / 2.0 - radius + 4, -height / 2.0 + radius - 4, radius4 / 1.5]) sphere(radius4); translate([-width / 2.0 + radius - 4, -height / 2.0 + radius - 4, radius4 / 1.5]) sphere(radius4); translate([width / 2.0 - radius + 4, height / 2.0 - radius + 4, radius4 / 1.5]) sphere(radius4); translate([-width / 2.0 + radius - 4, , height / 2.0 - radius + 4, radius4 / 1.5]) sphere(radius4); translate([width / 2.0 - radius + 4, -height / 2.0 + radius - 4, 22.0 - radius4 / 1.5]) sphere(radius4); translate([-width / 2.0 + radius - 4, -height / 2.0 + radius - 4, 22.0 - radius4 / 1.5]) sphere(radius4); translate([width / 2.0 - radius + 4, height / 2.0 - radius + 4, 22.0 - radius4 / 1.5]) sphere(radius4); translate([-width / 2.0 + radius - 4 , height / 2.0 - radius + 4, 22.0 - radius4 / 1.5]) sphere(radius4); } } module main_cutout() { translate([0, 0, 0]) cutout(20.1, radius, radius3, radius3); translate([0, 0, 20]) cutout(2.1, radius, radius, radius); translate([0, 0, 22.0]) cutout(6.5, radius, radius2, radius); translate([0, -100, -50]) cube([15, 200, 100]); } module main_model() { union() { difference() { union() { main_shell(); translate([-width / 2.0 - 20.0 - radius2, -height / 2.0 - radius4 / 1.5, 0]) support(20.0, 22.0, width, height, 5.0); translate([width / 2.0 + radius2, -height / 2.0 - radius4 / 1.5, 0]) support(20.0, 22.0, width, height, 5.0); } union() { main_cutout(); snapfits_neg(); for (i = [0: 3.6 + 3.0: 130.0]) { translate([0, -height / 2.0 + i + 30.0, 0]) vents(); echo(i); } translate([-65, -50, -5]) cube([130, 100, 20]); translate([-80, -45, -10]) cube([160, 90, 20]); translate([-60, -60, -10]) cube([120, 120, 20]); } } difference() { translate([-70, -55, -5]) cube([140, 110, 15]); union() { translate([0, -100, -50]) cube([15, 200, 100]); translate([-65, -50, -10]) cube([130, 100, 15]); translate([-80, -45, -15]) cube([160, 90, 20]); translate([-60, -60, -15]) cube([120, 120, 20]); translate([-35, -40, -15]) cube([70, 80, 30]); } } snapfits(); } } if (PART == "all") { main_model(); bottom_model(); } else if (PART == "left") { intersection() { main_model(); translate([-210, -110, -200]) cube([220, 220, 400]); } } else if (PART == "right") { intersection() { main_model(); translate([10, -110, -200]) cube([220, 220, 400]); } } else if (PART == "bottom_left") { intersection() { bottom_model(); translate([-210, -110 - 220, -200]) cube([220, 220, 400]); } } else if (PART == "bottom_right") { intersection() { bottom_model(); translate([10, -110 - 220, -200]) cube([220, 220, 400]); } }