// Constants
//units are in mm
$fn = 128;
neopixel_radius = 4.95;
led_radius = 2.0;
material_thickness = 1;
cable_holder_height = 5.5;
cable_holder_depth = 30;
cable_radius = 2;
pcb_height = 2.00;
cover_dist = 12.0;
show_neopixel = false;
show_cable = false;
show_holder = true;
show_cover = true;
cable_holder_width = (neopixel_radius * 2) + (2 * material_thickness);
if(show_neopixel){
translate([0,0, (cable_holder_height/2) - 2.05])
neopixel(r=neopixel_radius, w= 2);
}
if(show_cable){
translate([0,-neopixel_radius - 1,0.2])
cable(r=cable_radius, l=40);
rotate([0,0,180])
translate([0,-neopixel_radius - 1,0.2])
cable(r=cable_radius, l=40);
}
group(){
if(show_holder){
cable_holder(
w = cable_holder_width,
h = cable_holder_height,
d = cable_holder_depth,
t = material_thickness,
r = neopixel_radius,
cable_r = cable_radius,
pcb_h = pcb_height
);
}
if(show_cover){
translate([0, 0, (cable_holder_height/2) + cover_dist])
cable_holder_cover(
w = cable_holder_width,
h = cable_holder_height,
d = cable_holder_depth,
t = material_thickness,
r1 = neopixel_radius,
r2 = led_radius,
cable_r = cable_radius
);
}
}
module cable_holder_cover(w, h, d, t, r1, r2, cable_r){
gap = 0.1;
dimming = 0.25;
difference(){
group(){
// pöcök 1
rotate([0, 180, 90])
translate([
-(d - (2*t))/2,
(-w/2) + t,
t + gap+dimming
])
prism(l = (d - (2*t)), w = t/2, h = t/2);
translate([
(w/2)- (2.5*t),
-d/2 + t,
- t - (t/2) -dimming - gap
])
cube([(t), (d - (2*t)), 2*t + gap], false);
//rotate([0, 0, 180])
translate([
(w/2)- (2*t) + t/2,
-d/2 + t,
-t - gap - dimming
])
cube([t/2, (d - (2*t)), dimming ], false);
// pöcök 2
rotate([0,0, 180])
group(){
rotate([0, 180, 90])
translate([
-(d - (2*t))/2,
(-w/2) + t,
t + gap+dimming
])
prism(l = (d - (2*t)), w = t/2, h = t/2);
translate([
(w/2)- (2.5*t),
-d/2 + t,
- t - (t/2) -dimming - gap
])
cube([(t), (d - (2*t)), 2*t + gap], false);
//rotate([0, 0, 180])
translate([
(w/2)- (2*t) + t/2,
-d/2 + t,
-t - gap - dimming
])
cube([t/2, (d - (2*t)), dimming ], false);
}
translate([0, 0, t/2])
cube([w, d, t],true);
}
//led hole
cylinder(h = h/2, r1=r2/2, r2 = r2*2, center = true);
extra = 1;
translate([
-(r1+0.1),
-(r1+extra),
-h/2
])
cube([((r1+extra) * 2), ((r1+extra) * 2), h/2], center = false);
}
//cable upper holder
cable_holder_gap = -0.03;
//Here
rotate([90,0,0])
translate([0, -cable_r-0.53, (d/2)-(t/2)])
difference(){
group(){
cylinder(h = t, r = cable_r+t, center = true);
translate([0,2*(t+0.1),0])
cube([2*cable_r+t,t,t], center = true);
}
cylinder(h = (2 * t)+2, r = cable_r, center = true);
translate([0, -cable_r - (t), 0])
cube([2*(cable_r+t),2*(cable_r+t),(2 * t)+2], center = true);
translate([-cable_r - (t/2)+cable_holder_gap, cable_r, 0])
cube([t, 2*cable_r,(2 * t)+2], center = true);
rotate([0,180,0])
translate([-cable_r - (t/2)+cable_holder_gap, cable_r, 0])
cube([t, 2*cable_r,(2 * t)+2], center = true);
cube([2 * cable_r + 2, 2*t,(2 * t)+2], center = true);
}
rotate([90,0,180])
translate([0, -cable_r-0.53, (d/2)-(t/2)])
difference(){
group(){
cylinder(h = t, r = cable_r+t, center = true);
translate([0,2*(t+0.1),0])
cube([2*cable_r+t,t,t], center = true);
}
cylinder(h = (2 * t)+2, r = cable_r, center = true);
translate([0, -cable_r - (t), 0])
cube([2*(cable_r+t),2*(cable_r+t),(2 * t)+2], center = true);
translate([-cable_r - (t/2)+cable_holder_gap, cable_r, 0])
cube([t, 2*cable_r,(2 * t)+2], center = true);
rotate([0,180,0])
translate([-cable_r - (t/2)+cable_holder_gap, cable_r, 0])
cube([t, 2*cable_r,(2 * t)+2], center = true);
cube([2 * cable_r + 2, 2*t,(2 * t)+2], center = true);
}
}
module cable_holder(w, h, d, t, r, cable_r, pcb_h){
difference(){
group(){
difference(){
cube([w, d, h], true);
translate([0, 0, t])
cube([w - (2 * t), d + (2* t), h], true);
}
//perem 1
translate([
(w/2) - t,
0,
(h/2) - (t/2)
])
cube([t/2, d, t], true);
//perem 2
rotate([0, 00, 180])
translate([
(w/2) - t,
0,
(h/2) - (t/2)
])
cube([t/2, d, t], true);
}
translate([0,0,t])
cylinder(h = h, r = r, center = true);
}
difference(){
group(){
cylinder(h = h, r = r + t, center = true);
translate([(w/2) - (3*t), -(r+2*t)/2 - 2, -h/2])
cube([2*t,2*t,h], center = false);
rotate([180,0,0])
translate([(w/2) - (3*t), -(r+2*t)/2 - 2, -h/2])
cube([2*t,2*t,h], center = false);
rotate([180,180,0])
translate([(w/2) - (3*t), -(r+2*t)/2 - 2, -h/2])
cube([2*t,2*t,h], center = false);
rotate([0,180,0])
translate([(w/2) - (3*t), -(r+2*t)/2 - 2, -h/2])
cube([2*t,2*t,h], center = false);
}
cylinder(h = h+1, r = r, center = true);
cube([w/1.8, d, h+1], true);
}
// oldal fal 1
difference(){
translate([0,(d-t)/2,0])
cube([w, t, h], center = true);
rotate([90, 0, 0])
translate([0, cable_r/9, -(d/2) + (t/2)])
cylinder(h = (2 * t), r = cable_r, center = true);
rotate([90, 0, 0])
translate([0, cable_r+cable_r/9, -(d/2) + (t/2)])
cube([(2*cable_r)+0.1,2*cable_r,cable_r], center = true);
}
// oldal fal 2
difference(){
translate([0,-(d-t)/2,0])
cube([w, t, h], center = true);
rotate([90, 0, 0])
translate([0, cable_r/9, (d/2) - (t/2)])
cylinder(h = (2 * t), r = cable_r, center = true);
rotate([90, 0, 180])
translate([0, cable_r+cable_r/9, -(d/2) + (t/2)])
cube([(2*cable_r)+0.1,2*cable_r,cable_r], center = true);
}
//PCB holders
rotate([90, 0, 90])
translate([-t/2, -(h/2) + t, -(w/2) + (t)])
cube([t,pcb_h,t], center = false);
rotate([90, 0, -90])
translate([-t/2, -(h/2) + t, -(w/2) + (t)])
cube([t,pcb_h,t], center = false);
}
module prism(l, w, h){
polyhedron(
points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],
faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]
);
}
module neopixel(r, w){
pcb_h = 0.9;
led_s = 4.9;
led_h = 2.65 - pcb_h;
color([0,0.6,0])
cylinder(h = pcb_h, r =r);
color(c=[0.2,0.2,0.20])
translate([0, 0,1])
cube([led_s,led_s,led_h], center = true);
}
module cable(r, l){
color([0.6,0,0],alpha=0.2)
rotate([90,0,0])
cylinder(h=l, r = r, center = false);
}
Comments