-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuttons.scad
30 lines (25 loc) · 1.34 KB
/
buttons.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function switch_hole_dia() = 12.7;
function switch_head_dia() = 14.3;
function switch_inner_height() = 17.65;
function button_size() = [12, 3.85, 12];
function button_hole_dia() = 13;
function button_cap_bottom_dia() = 13;
function button_total_height() = 12.3;
function button_top_height() = 4.3;
contacts_length = 5.2;
module Button() {
union() {
color("gray") translate([0, button_total_height() - button_size().y]) cube(button_size());
color("blue") translate([button_size().x / 2, + button_top_height(), button_size().z / 2]) rotate([90])
cylinder(d = button_hole_dia() - 1.3, h = button_top_height(), $fn = 30);
s = 6;
color("gray") translate([(button_size().x - s) / 2, button_top_height(), (button_size().z - s) / 2]) cube([s, 5, s]);
}
}
module Switch(fatness) {
color("black") translate([-1, - (switch_hole_dia() - 6.6) / 2, - contacts_length]) cube([2, 6.6, contacts_length]);
color("black") translate([0, 0, switch_inner_height() - fatness - 4.6]) cylinder(d = 16.35, h = 4.6, $fn = 30);
color("black") cylinder(d = switch_hole_dia() - .3, h = switch_inner_height(), $fn = 30);
color("black") translate([0, 0, switch_inner_height()]) cylinder(d = switch_head_dia(), h = 2.2, $fn = 30);
color("red") translate([0, 0, switch_inner_height() + 2.2]) cylinder(d = 9, h = 4.15, $fn = 30);
}