-
Notifications
You must be signed in to change notification settings - Fork 0
/
assembly.scad
128 lines (99 loc) · 3.33 KB
/
assembly.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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
use <appliances.scad>;
module positioned_green_led() {
translate([35,81.5,15]) rotate([-90,0,0]) led([0,1,0]);
}
module positioned_switch() {
translate([45,73.5,25]) rotate([-90,0,0]) switch();
}
module positioned_yellow_led() {
translate([25,24.5,42.5]) led([1,1,0]);
}
module positioned_button() {
translate([43,24.5,33.5]) button();
}
module positioned_display() {
translate([-35,15,40.5]) 7segmentdisplay();
}
// appliances
module appliances() {
translate([48,5,0]) union() {
translate([5,0,0]) breadboard();
translate([47,0,0]) arduinopromini();
translate([55,50,28]) rotate([90,90,0]) v9battery();
positioned_display();
positioned_yellow_led();
positioned_button();
positioned_green_led();
positioned_switch();
}
}
// case
width = 125;
depth = 90;
height = 45;
// Top Case
module topCase() {
union() {
cube([2, depth, height]); // left
cube([width, 2, height]); // front
difference() {
union() {
translate([0, 0, height]) cube([width, depth, 2]); // top
translate([0, depth-2, 0]) cube([width, 2, height]); // back
}
translate([48,5,0]) union() {
positioned_display();
positioned_yellow_led();
positioned_button();
positioned_green_led();
positioned_switch();
}
}
translate([width-2, 0, 0]) cube([2, depth, height]); // right
// screws: 3x16
translate([2,2,0]) mountingHoleCorner(); // front left
translate([width-2,2,0]) rotate([0,0,90]) mountingHoleCorner(); // front right
translate([2,depth-2,0]) rotate([0,0,270]) mountingHoleCorner(); // back left
translate([width-2,depth-2,0]) rotate([0,0,180]) mountingHoleCorner(); // back right
}
}
// Bottom Case
module bottomCase() {
color([1,0,0,1]) union() {
$fn = 40;
difference() {
translate([0, 0, -2]) cube([width, depth, 2]); // bottom
// front left
translate([5,5,-4]) cylinder(r=1.5, h=6);
translate([5,5,-2.1]) cylinder(r2=1.5, r1=3, h=1.1);
// front right
translate([width-5,5,-4]) cylinder(r=1.5, h=6);
translate([width-5,5,-2.1]) cylinder(r2=1.5, r1=3, h=1.1);
// back left
translate([5,depth-5,-4]) cylinder(r=1.5, h=6);
translate([5,depth-5,-2.1]) cylinder(r2=1.5, r1=3, h=1.1);
// back right
translate([width-5,depth-5,-4]) cylinder(r=1.5, h=6);
translate([width-5,depth-5,-2.1]) cylinder(r2=1.5, r1=3, h=1.1);
}
translate([99, 2, 0]) cube([2, 50, height-2]); // battery divider
translate([65, 2, 0]) cube([2, 50, height/2-2]); // arduino divider
}
}
module mountingHoleCorner() {
$fn = 40;
difference() {
cube([3, 3, height]);
translate([3,3,-1]) cylinder(r=3, h=height+2);
}
translate([3,3,0]) mountingHole(height);
}
module mountingHole(height) {
difference() {
cylinder(r=3, h=height);
translate([0,0,-1]) cylinder(r=1, h=18);
}
}
//appliances();
topCase();
//bottomCase();