From 6a707e10d2de61b81b115e68a29aca676ed5b772 Mon Sep 17 00:00:00 2001 From: Correl Date: Mon, 20 Mar 2023 00:59:00 -0400 Subject: [PATCH] Add button housing --- button.scad | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 button.scad diff --git a/button.scad b/button.scad new file mode 100644 index 0000000..f8a14a3 --- /dev/null +++ b/button.scad @@ -0,0 +1,65 @@ +/* Simple button attachment */ + +$fn = 50; + +mode = "base"; // ["cap", "base", "all"] +tolerance = 0.4; + +base_width = 6; +base_depth = 6; +base_height= 3; +button_diameter = 3.4; +button_height = 2; + +movement = 0.4; + + +module button() { + translate([0,0,-0.001]) { + union() { + translate([-base_width/2, -base_depth/2, 0]) + cube([base_width,base_depth,base_height]); + translate([0,0,base_height - 0.001]) + cylinder(h=button_height,r=button_diameter/2); + } + } +} +if (mode == "cap" || mode == "all") { + union() { + cylinder(h=5, r=3.5); + cylinder(h=.5, r=5); + } + } +if (mode == "base" || mode == "all") { + translate([0,0,-2.5]) + difference() { + union() { + translate([-15, -.5, -3.1]) + cube([30, 1, 6.1]); + translate([-3.75, -3.75, -3.1]) + cube([7.5,7.5,6.1]); + translate([12,0,-3.1]) + cylinder(h=6.1,r=3); + translate([-12,0,-3.1]) + cylinder(h=6.1,r=3); + } + translate([-3.25, -3.25, -2.101]) + cube([6.5, 6.5, 5]); + translate([0,0,2]) + cylinder(h=1.01, r=5.5); + translate([0.5,0.5,-3.2]) + cube([2.75,2.75,5]); + translate([-3.25,0.5,-3.2]) + cube([2.75,2.75,5]); + translate([0.5,-3.25,-3.2]) + cube([2.75,2.75,5]); + translate([-3.25,-3.25,-3.2]) + cube([2.75,2.75,5]); + } + } + +if (mode == "all") { + translate([0,0,-4.6]) + color("gray") + button(); +}