-
Notifications
You must be signed in to change notification settings - Fork 0
/
RAM Stick Slots.scad
48 lines (42 loc) · 1.6 KB
/
RAM Stick Slots.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
rows = 6;
columns = 1;
wallThickness = 5;
cornerRadius = 3;
slotWidth = 7.1;
slotLength = 133.5;
holderHeight = 20;
$fn = 100;
module drawBase(width, length, height) {
translate([0, 0, height / 2])
union() {
minkowski() {
cube([width - cornerRadius * 2, length - cornerRadius * 2, height - cornerRadius * 2], center=true);
sphere(cornerRadius);
}
translate([0, 0, -height / 2 + cornerRadius / 2])
minkowski() {
cube([width - cornerRadius * 2, length - cornerRadius * 2, cornerRadius], center=true);
cylinder(cornerRadius, cornerRadius);
}
}
}
module drawHolder(rows, columns, wallThickness, cornerRadius, slotWidth, slotLength, holderHeight) {
cutWidth = rows * (slotWidth + wallThickness) - wallThickness;
cutLength = columns * (slotLength + wallThickness) - wallThickness;
cutHeight = holderHeight - wallThickness;
baseWidth = rows * (slotWidth + wallThickness) + wallThickness;
baseLength = columns * (slotLength + wallThickness) + wallThickness;
difference() {
drawBase(baseWidth, baseLength, holderHeight);
translate([-cutWidth / 2, -cutLength / 2, wallThickness])
union() {
for (column = [1:columns]) {
for (row = [1:rows]) {
translate([(row - 1) * (slotWidth + wallThickness), (column - 1) * (slotLength + wallThickness), 0])
cube([slotWidth, slotLength, cutHeight]);
}
}
}
}
}
drawHolder(rows, columns, wallThickness, cornerRadius, slotWidth, slotLength, holderHeight);