-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuzz_box.scad
More file actions
101 lines (79 loc) · 2.56 KB
/
buzz_box.scad
File metadata and controls
101 lines (79 loc) · 2.56 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
module shape(d){
translate([-d/2,0])circle(d/2);
translate([d/2,0])circle(d/2);
square(d,center=true);
}
module shell_shape(d,t){
difference() {
union(){
translate([-d/2,0])circle(d/2+t);
translate([d/2,0])circle(d/2+t);
square([d,d+t+t],center=true);
}
translate([-d/2,0])circle(d/2);
translate([d/2,0])circle(d/2);
square(d,center=true);
}
}
module batt_end(d,t,h){
difference(){
union(){
translate([0,0,h-t])linear_extrude(t) shape(d+t);
linear_extrude(h) shell_shape(d,t);
}
//battery connector holes
translate([-d/2,0,h])cylinder(r=1,h= h, center=true);
translate([d/2,0,h])cylinder(r=1,h= h,center=true);
}
}
//batt_end(11,2);
module screw_end(d,t,h){
difference(){
union(){
linear_extrude(t+t)
difference(){
square([d+d+t+t+h+h,d+t+t],center=true);
shape(d); //cut out shape
}
linear_extrude(8) shell_shape(d,t);
}
//drill holes
// assume m3 with bolt diam of 5
translate([d+h-t,0,0])cylinder(r=1.5,h= h+h,center=true);
translate([d+h-t,0,t+t])cylinder(r=2.5,h= t+t,center=true,$NA=6);
translate([-(d+h-t),0,0])cylinder(r=1.5,h= h+h,center=true);
translate([-(d+h-t),0,t+t])cylinder(r=2.5,h= t+t,center=true);
}
}
module screw_cap(d,t,h){
difference(){
union(){
cube([d+d+t+t+h+h,d+t+t,t],center=true);
translate([0,0,d/2])cube([d+d+t+t,d+t+t,10],center=true);
}
translate([0,t,d/2-t/2])cube([d+h+t+t,d+t+t,8],center=true);
//drill holes
// assume m3 with bolt diam of 5
translate([d+h-t,0,0])cylinder(r=1.5,h= h+h,center=true);
translate([d+h-t,0,t+t])cylinder(r=2.5,h= t+t,center=true,$NA=6);
translate([-(d+h-t),0,0])cylinder(r=1.5,h= h+h,center=true);
translate([-(d+h-t),0,t+t])cylinder(r=2.5,h= t+t,center=true);
//battery connector holes
translate([-d/2,0,0])cylinder(r=1,h= t+t, center=true);
translate([+d/2,0,0])cylinder(r=1,h= t+t,center=true);
}
}
module batt_join(d,t,h,l,sd){
screw_end(d,t,h);
translate([0,0,l-h]) batt_end(d,t,h);
translate([0,d/2+t/2,l/2])cube([d+d,t,l],center=true);
}
module buzzer(d,t,h,l,sd) {
difference(){
batt_join(d,t,h,l);
translate([0,h,l/2+sd/2])rotate([90,0,0])cylinder(r=2,h=6,center=true);
translate([0,h,l/2-sd/2])rotate([90,0,0])cylinder(r=2,h=6,center=true);
}
}
rotate([-90,0,0])buzzer(12,2,8,42,30);
translate([0,-12,0])rotate([90,0,0])screw_cap(12,2,8,42,30);