-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusb_cable_holder_m.scad
74 lines (65 loc) · 2.42 KB
/
usb_cable_holder_m.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
//
// A holder for USB cables when used to charge devices
//
in_width = 16.0;
in_length = 30.0;
in_depth = 0.7;
base_height = in_depth + 1.7;
module holder_base () {
// The base is open on one short side (with a 1.6 mm extension)
// in order to admit the tongue of a Command glue strip.
difference () {
translate([0, 0, base_height/2])
cube([in_length+2.0, in_width+2.0, base_height], center=true);
translate ([1.6/2, 0, in_depth/2 - 0.1])
cube([in_length + 1.6, in_width, in_depth], center=true);
}
}
module holder_fixture () {
fixture_r = 10.0;
fixture_th = 11.0;
fixture_ext = 6.0;
// translate([0, in_width/2, base_height]) {
union () {
// The half-cylinder with cutouts
difference () {
// The main body half-cylinder
intersection () {
cylinder(fixture_th, fixture_r, fixture_r);
translate([0, (fixture_r/2)*-1, fixture_th/2]) {
cube([fixture_r*2, fixture_r, fixture_th], center=true);
}
}
// Cutout for the Mini-B or Micro-B connector
cylinder(fixture_th - 2.0, fixture_r*0.8, fixture_r*0.8);
// Cutout for the USB cable
cable_r = 5.0;
translate([0, (fixture_r/2)*-1, fixture_th - cable_r/2])
cube([cable_r, fixture_r + 0.1, fixture_th], center=true);
}
// The little extension border
difference () {
translate([fixture_r*-1, 0, 0])
cube([fixture_r*2, fixture_ext, fixture_th]);
// Cutout for the Mini-B or Micro-B connector in the extension
translate([(fixture_r*0.8)*-1, -0.1, 0])
cube([(fixture_r*0.8)*2, fixture_ext + 0.2,
fixture_th - 2.0]);
// Cutout for the USB cable in the extension
translate([0, fixture_r*0.8 - 0.5, fixture_th - 2.0 - 0.1])
cylinder(2.0 + 0.2, fixture_r*0.8, fixture_r*0.8);
}
}
// }
}
module holder () {
// It's better to print on the side, so flip it.
translate ([0, 0, (in_width+2.0)/2]) rotate(90, [1,0,0]) {
union () {
holder_base();
translate([0, 1.7, base_height])
holder_fixture();
}
}
}
holder();