From 0271921948bd74bb5cec55b8cb084cbee650bed9 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 14 Jun 2019 15:04:18 +0100 Subject: [PATCH] Begin designing housing --- iot/Housing.scad | 101 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 iot/Housing.scad diff --git a/iot/Housing.scad b/iot/Housing.scad new file mode 100644 index 0000000..6a3787b --- /dev/null +++ b/iot/Housing.scad @@ -0,0 +1,101 @@ +//////////////// +/// Settings /// +//////////////// + +// The thickness of the walls +wall_thickness = 2; + +// The dimensions of the box on the inside +box_inside = [ + 110, // X + 130, // Y + 110 // Z +]; + +screw_diameter = 3; +screw_length = 6.3; + + +// ------------------------------------------- + +box_outside = [ + box_inside[0] + (wall_thickness * 2), + box_inside[1] + (wall_thickness * 2), + box_inside[2] + (wall_thickness - 0.1) +]; + +// ------------------------------------------- + +// Misc. Utility functions +// ------------------------------------------- + +module screw_port() { + difference() { + color("purple") cylinder( + h = screw_length + wall_thickness, + d = screw_diameter + (wall_thickness * 2), + $fn = 25 + ); + + color("mediumpurple") translate([0, 0, wall_thickness + 0.1]) cylinder( + h = screw_length, + d = screw_diameter, + $fn = 25 + ); + }; +} + +// Box +// ------------------------------------------- + +difference() { + color("green") cube(box_outside); + + translate([wall_thickness, wall_thickness, wall_thickness]) { + cube(box_inside); + } +}; + +// Screw holes +// ------------------------------------------- + +translate([0, 0, 200]) screw_port(); + +// Corners +// ------------------------------------------- +corner_piece_size = screw_diameter + (wall_thickness * 2); +module corner_piece() { + color("red") difference() { + cube([ + corner_piece_size, + corner_piece_size, + box_inside[2] + ]); + translate([ + corner_piece_size / 2, + corner_piece_size / 2, + box_inside[2] - screw_length + 0.1 + ]) cylinder(h = screw_length, d = screw_diameter, $fn = 25); + } +} + +translate([ + wall_thickness, + wall_thickness, + wall_thickness +]) corner_piece(); +translate([ + wall_thickness + box_inside[0] - corner_piece_size, + wall_thickness, + wall_thickness +]) corner_piece(); +translate([ + wall_thickness, + wall_thickness + box_inside[1] - corner_piece_size, + wall_thickness +]) corner_piece(); +translate([ + wall_thickness + box_inside[0] - corner_piece_size, + wall_thickness + box_inside[1] - corner_piece_size, + wall_thickness +]) corner_piece(); \ No newline at end of file