-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyrexx_magnet.scad
More file actions
149 lines (144 loc) · 3.72 KB
/
Copy pathpyrexx_magnet.scad
File metadata and controls
149 lines (144 loc) · 3.72 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
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
// minimum angle for a fragment
$fa=1;
// minimum size of a fragment
$fs=0.2;
module plateprofile() {
offset(r=0.1) {
square([62, 52], center=true);
difference() {
offset(2.5) square([73, 3], center=true);
for(i=[-1, 1]) translate([35, 0]*i) circle(d=4.9);
}
}
for(i=[0, 1], j=[0, 1]) mirror([i, 0]) mirror([0, j]) translate([62, 52]/2) circle($fn=4);
}
//#plateprofile();
module dummy() difference() {
cylinder(5, d1=105, d2=115);
linear_extrude(30, center=true) square([60, 50], center=true);
translate([0, 0, 3.5]) linear_extrude(10, convexity=3) plateprofile();
}
latches = [0, 107, 220];
difference() {
// base
rotate_extrude() polygon([
[0, 0],
[53.5+0.25, 0],
[57+0.25, 3.5],
[57.25+0.25, 14.5],
[55.75+0.25, 14.5],
[54.5+0.5, 9],
[54.5+0.5, 5],
[0, 5],
]);
// magnet cutout
linear_extrude(30, center=true) square([60, 50], center=true);
// plate cutout
translate([0, 0, 3.5]) linear_extrude(10, convexity=3) plateprofile();
// latch cutouts
for(a=latches) rotate(a)
rotate_extrude(angle=23) polygon([
[56+0.25, 5],
[56+0.25, 15],
[54, 15],
[54, 5],
]);
// snap cutout
rotate(270) {
for(i=[0, 1]) mirror([0, i, 0])
translate([32, 2.5, -1]) cube([30, 0.5, 7]);
translate([32, -3, 5]) cube([30, 6, 1.5]);
rotate([90, 0, 0]) linear_extrude(6, center=true) polygon([
[32, 3.5],
[32, -1],
[33, -1],
[33, 1],
[36.9, 3.2],
[36.9, 3.5],
[37.3, 3.5],
[37.3, 3.2],
[39.15, 1],
[39.15, -1],
[40.15, -1],
[40.15, 1],
[42, 3.2],
[42, 3.5],
[42.4, 3.5],
[42.4, 3.2],
[46.3, 1],
[46.3, -1],
[47.3, -1],
[47.3, 3.5],
]);
translate([57, 0, 14.5]) cube([1, 1, 10], center=true);
}
}
for(a=latches) rotate(a) {
// latch side limit
rotate_extrude(angle=-1.5) polygon([
[57, 9],
[57.25, 14.5],
[54.75, 14.5],
[54.75, 9],
]);
// latch top limit
rotate_extrude(angle=10) polygon([
[57, 13],
[57.25, 14.5],
[54.75, 14.5],
[54.75, 13],
]);
// support back
rotate(0.5) rotate_extrude(angle=9.1) polygon([
[55.25, 5],
[55.25, 14.5],
[54.75, 14.5],
[54.75, 5],
]);
// support sides
for(r=[0.5, 9.5]) rotate(r) rotate_extrude(angle=0.5) polygon([
[55.25, 4],
[55.25, 13],
[53.75, 13],
[50.75, 4],
]);
}
rotate(295) {
// switch base
rotate_extrude(angle=15) polygon([
[57+0.25, 3.5],
[57.25+0.25, 14.5],
[53.75+0.25, 14.5],
[53.75+0.25, 16.5],
[49.75+0.25, 16.5],
[49.75+0.25, 3.5],
]);
// switch sides
for(a=[0, 12]) rotate(a)
rotate_extrude(angle=3) polygon([
[53.75+0.25, 14],
[53.75+0.25, 21.5],
[52.75+0.25, 21.5],
[52.75+0.25, 20.5],
[50.95+0.25, 20.5],
[50.95+0.25, 21.5],
[49.75+0.25, 21.5],
[49.75+0.25, 14],
]);
}
// snap
rotate(270) {
rotate([90, 0, 0]) linear_extrude(5, center=true) polygon([
[47.3+0.25, 4],
[47.3+0.25, 6.5],
[48.5+0.25, 6.5],
[48.5+0.25, 4],
]);
for(i=[0, 1]) mirror([0, i, 0])
translate([0, 2.5, 0]) rotate([90, 0, 0]) linear_extrude(1) polygon([
[47.3+0.25, 4],
[47.3+0.25, 6.5],
[49.5+0.25, 6.5],
[51+0.25, 5],
]);
}