-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathback_shield.scad
71 lines (60 loc) · 2.09 KB
/
back_shield.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
$fn=24;
view = "cuts"; // 3d or cuts for sliced view
X = 85; // Internal X Size
Y = 42.5; // Internal Y Size
BORDER = 2.5; // Width of Border
CORNER_RADIUS = 5; // Radius of Corners
SCREW_DRILL = 3.2; // Diameter of Screw Holes
SCREW_ANULAR = 3.5; // Radius of Screw Mounts
SCREW_Y_OFF = 20; // Vertical Offset of Screw Mounts
module rounded_top_rect(x, y, r, d) {
union() {
cube([x, y - r, d]);
translate([r, 0, 0]) cube([x - 2*r, y, d]);
translate([r, y - r, 0]) cylinder(d, r=r);
translate([x - r, y - r, 0]) cylinder(d, r=r);
}
}
module screwmount(r, h) {
union() {
cylinder(h=h, r=r);
difference() {
translate([0, -r*2, 0]) cube([r, r*4, h]);
translate([0, r*2, 0]) cylinder(h=h, r=r);
translate([0, -r*2, 0]) cylinder(h=h, r=r);
}
}
}
module plate() {
difference() {
union() {
difference() {
rounded_top_rect(X + BORDER*2, Y + BORDER, r=CORNER_RADIUS, d=6);
translate([BORDER, 0, 2]) rounded_top_rect(X, Y, r=CORNER_RADIUS, d=4);
}
translate([SCREW_ANULAR + BORDER, SCREW_Y_OFF, 2])
rotate([0,0,180])
screwmount(SCREW_ANULAR, 3);
translate([X - SCREW_ANULAR + BORDER, SCREW_Y_OFF, 2])
screwmount(SCREW_ANULAR, 3);
}
translate([SCREW_ANULAR + BORDER, SCREW_Y_OFF, 0])
cylinder(h=6, d=SCREW_DRILL);
translate([SCREW_ANULAR + BORDER, SCREW_Y_OFF, 0])
cylinder($fn=6, h=2, d=6.25);
translate([X - SCREW_ANULAR + BORDER, SCREW_Y_OFF, 0])
cylinder(h=6, d=SCREW_DRILL);
translate([X - SCREW_ANULAR + BORDER, SCREW_Y_OFF, 0])
cylinder($fn=6, h=2, d=6.25);
}
}
if(view == "3d"){
plate();
} else if(view == "cuts"){
projection(true) plate();
translate([-40, 0, 0]) text("2mm");
projection(true) translate([0, Y*1.5, -3]) plate();
translate([-40, Y*1.5, 0]) text("3mm");
projection(true) translate([0, Y*3, -6]) plate();
translate([-40, Y*3, 0]) text("1mm");
}