-
Notifications
You must be signed in to change notification settings - Fork 1
/
neopixel_fiber_adapter.scad
137 lines (121 loc) · 4.88 KB
/
neopixel_fiber_adapter.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
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
/* [Global] */
// Which one would you like to see?
part = "both"; // [top:Top Only,base:Base Only,both:Top and Base]
/* [Top] */
// number of holes for LEDs
led_count = 10;
// length of the tube for fiber optics
tube_height = 10;
// width of the base (wings at bottom)
width = 14.0;
// radius of the chamfer to the wings. Larger number is more gradual chamfer.
chamfer_radius = 3.0;
// radius of the fillet of the base. This is mainly there to make it easier to print
fillet_radius = 1.0;
// the height fo the base (wings) on the side. Chamfer radius + wing height must be less than the tube_height
wing_height = 1.5;
// LED size (ws2812b according to datasheet is 5.0 * 5.4 * 1.57 with a 0.05mm tolerance.)
led_size = [5.4, 5.6, 1.65];
/* [Base] */
// thickness of the wall for the base
wall_thickness = 2.5;
// base clearance factor for clearance issues on the base
clearance = 1.1;
// led strip thickness
strip_thickness = 1.1;
/* [Hidden] */
$fn=100;
print_part();
module print_part() {
if (part == "top") {
led_top();
} else if (part == "base") {
led_base();
} else {
led_top();
led_base();
}
}
module led_top() {
for (i=[0:led_count-1]) {
translate([0, 7 * i, 0]) {
difference() {
union() {
// wing and chamfer material
translate([0, 0, (chamfer_radius + wing_height)/2]){
cube([width, 7, chamfer_radius + wing_height], true);
}
// tube material
translate([0, 0, tube_height/2]) {
cylinder(tube_height, 3.5, 3.5, true);
}
}
// chamfer each side
for (side = [-1,1]) {
translate([side * (chamfer_radius + 3.5), 0, chamfer_radius + wing_height]) {
rotate([0, 90, 90]) {
cylinder(8, chamfer_radius, chamfer_radius, true);
}
}
translate([side * (width/2 + chamfer_radius + 3.5), 0, chamfer_radius + wing_height]) {
cube([width, 8, chamfer_radius*2], true);
}
}
// LED slot
translate([0, 0, led_size[2]/2 - 0.01]) {
cube(led_size, true);
}
// Fiber tube
cylinder(tube_height * 3, 2.2, 2.2, true);
}
}
}
}
module led_base() {
slot_depth = strip_thickness + wing_height;
translate([0, 0, wing_height/2]) {
for (i=[0:led_count-1]) {
translate([0, 7 * i, 0]) {
difference() {
// the overall base
cube([width + wall_thickness*2 + clearance*2, 7, slot_depth + wall_thickness*2 + clearance*2], true);
difference(){
// main LED slot in base
cube([width + clearance*2, 8, slot_depth + clearance*2], true);
// subtract out the fillet area
union() {
translate([width/2 + clearance, 0, slot_depth/2 + clearance]) {
difference(){
translate([-fillet_radius/2, 0, -fillet_radius/2]){
cube([fillet_radius, 8, fillet_radius], true);
}
translate([-fillet_radius, 0, -fillet_radius]){
rotate([0, 90, 90]) {
cylinder(9, fillet_radius, fillet_radius, true);
}
}
}
}
translate([-(width/2 + clearance), 0, slot_depth/2 + clearance]) {
difference(){
translate([fillet_radius/2, 0, -fillet_radius/2]){
cube([fillet_radius, 8, fillet_radius], true);
}
translate([fillet_radius, 0, -fillet_radius]){
rotate([0, 90, 90]) {
cylinder(9, fillet_radius, fillet_radius, true);
}
}
}
}
}
}
// the opening at the top of the base
translate([0, 0, (slot_depth + wall_thickness)/2 + clearance]) {
cube([width - clearance*2, 8, wall_thickness + 0.01], true);
}
}
}
}
}
}