-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSD Card Holder.scad
60 lines (50 loc) · 1.77 KB
/
SD Card Holder.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
$fn = 100;
row_count = 10;
column_count = 2;
slope_angle = 22.5;
edge_radius = 2;
edge_margin = 3;
slot_length = 24.2;
slot_width = 2.2;
slot_depth = 8;
slot_spacing = 2;
vertical_step = 1;
module rounded_cube(xyz, r) {
hull() {
translate([r, r, 0]) cylinder(xyz.z, r=r);
translate([xyz.x - r, r, 0]) cylinder(xyz.z, r=r);
translate([xyz.x - r, xyz.y - r, 0]) cylinder(xyz.z, r=r);
translate([r, xyz.y - r, 0]) cylinder(xyz.z, r=r);
}
}
module slot_column(slot_xyz, count, spacing, step) {
for (i = [0 : count - 1]) {
translate([0, i * (slot_xyz.y + spacing), i * step])
cube([slot_xyz.x, slot_xyz.y, slot_xyz.z]);
}
}
module slots_negative(slot_xyz, rows, columns, slot_spacing, column_spacing, step) {
for (i = [0 : columns - 1]) {
translate([i * (slot_xyz.x + column_spacing), 0, 0])
slot_column(slot_xyz, rows, slot_spacing, step);
}
}
module card_holder(slot_xyz, rows, columns, slot_spacing, column_spacing, step, r) {
box_width = (slot_xyz.x + column_spacing) * columns + column_spacing;
box_height = (slot_xyz.y + slot_spacing) * rows + slot_spacing / 2 + column_spacing;
difference() {
rounded_cube([box_width, box_height, step * (rows - 1) + slot_xyz.z + 2], r=r);
rotate([11.25, 0, 0]) translate([0, 0, slot_xyz.z])
cube([1000, 1000, 1000]);
translate([edge_margin, edge_margin, 2])
slots_negative(slot_xyz, rows, columns, slot_spacing, column_spacing, step);
}
}
card_holder([slot_length, slot_width, slot_depth],
row_count,
column_count,
slot_spacing,
edge_margin,
vertical_step,
edge_radius
);