-
Notifications
You must be signed in to change notification settings - Fork 0
/
sandwich.scad
166 lines (150 loc) · 2.57 KB
/
sandwich.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
//
screw_placements = [
[ 6, -15 ],
[ 52, -15 ],
[ 123, -27 ],
[ 153, -27 ],
[ 230, -13 ],
[ 286, -13 ],
[ 289, -96 ],
[ 233, -96 ],
[ 149, -111 ],
[ 124, -111 ],
[ 49, -98 ],
[ 2, -98 ],
];
module
screw_hole()
{
circle(r = 1.15, $fn = 30);
}
module
plate()
{
offset(6) import("plate.dxf");
}
module pcb()
{
offset(0.5) import("plate.dxf");
}
module
switch_hole()
{
import("switch-hole.dxf");
}
module
promicro_and_socket_placement()
{
union()
{
polygon(points = [
[ 129, 0 ],
[ 129, -64 ],
[ 149, -64 ],
[ 149, 0 ],
]);
polygon(points = [
[ 128, -85 ],
[ 128, -106 ],
[ 138, -106 ],
[ 138, -85 ],
]);
polygon(points = [
[ 144.5, -85 ],
[ 144.5, -106 ],
[ 154.5, -106 ],
[ 154.5, -85 ],
]);
}
}
module
sandwich_bottom()
{
difference()
{
plate();
for (i = [0:len(screw_placements) - 1]) {
translate(screw_placements[i]) screw_hole();
}
}
}
module 2u()
{
union()
{
translate([ -19, 9.5 ]) import("2u.dxf");
rotate([ 0, 0, 180 ]) translate([ -19, 9.5 ]) import("2u.dxf");
}
}
module 2us()
{
union()
{
translate([ 107.0746, -95.03 ]) rotate([ 0, 0, -10 ]) 2u();
translate([ 177.4591, -92.965 ]) rotate([ 0, 0, 10 ]) 2u();
}
}
module
sandwich_plate()
{
difference()
{
plate();
switch_hole();
for (i = [0:len(screw_placements) - 1]) {
translate(screw_placements[i]) screw_hole();
}
promicro_and_socket_placement();
2us();
}
}
module
wall()
{
difference()
{
plate();
pcb();
promicro_and_socket_placement();
for (i = [0:len(screw_placements) - 1]) {
translate(screw_placements[i]) screw_hole();
}
}
}
module
north_wall()
{
difference()
{
wall();
translate([0, -80, 0]) square(size=[600, 100], center=true);
}
}
module west_wall()
{
difference()
{
wall();
translate([13, -120, 0]) square(size=[400, 400], center=false);
}
}
module south_wall()
{
difference()
{
wall();
translate([0, -40, 0]) square(size=[600, 100], center=true);
}
}
module east_wall()
{
difference()
{
wall();
translate([-120, -120, 0]) square(size=[400, 400], center=false);
}
}
east_wall();
// sandwich_bottom();
// translate([ 0, 95, 0 ]) sandwich_plate();
// sandwich_plate();