-
Notifications
You must be signed in to change notification settings - Fork 0
/
Accel Case.scad
49 lines (42 loc) · 923 Bytes
/
Accel Case.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
// Device
module draw_LIS3DH() {
color([0.0, 1.0, 0.0, 1.0]) {
cube([0.8, 0.8, 0.1]);
}
}
// Bottom
module bottom() {
color ([0.0, 0.0, 1.0, 1.0]) {
difference() {
cube([1.2, 1.2, 0.3]);
translate([0.15, 0.15, 0.15]) cube([0.9, 0.9, 0.15]);
}
}
}
// Top
module top() {
color([1.0, 0.0, 0.0, 1.0]) {
difference() {
cube([1.2, 1.2, 0.6]);
translate([0.15, 0.15, 0]) cube([0.9, 0.9, 0.4]);
translate([0.6, 0.6, 0.0]) cylinder(h = .7, d = 0.5, $fn = 20);
}
}
}
BUILD = 0;
TOGETHER = 1;
PRINT = 2;
STATE = BUILD;
if (STATE == BUILD) {
translate([0.2, 0.2, 0.5]) draw_LIS3DH();
bottom();
translate([0, 0, 1]) top();
}
if (STATE == TOGETHER) {
bottom();
translate([0, 0, .3]) top();
}
if (STATE == PRINT) {
bottom();
translate([0, -1.2, 0.6]) rotate([0, 180, 0]) top();
}