3d/Turris_Omnia_LED_Bezel.scad

52 lines
1.3 KiB
OpenSCAD
Raw Normal View History

2018-01-23 22:05:53 +00:00
LED_HEIGHT=9;
LED_WIDTH=5;
LED_DEPTH=8;
LED_SPACING=5;
LED_AMOUNT=12;
BEARING_SPACING=5;
BEARING_DIAMETER=3;
THICKNESS=1;
$fn = 36;
module led_frame() {
// left spacer
cube([LED_SPACING/2-THICKNESS, LED_DEPTH + THICKNESS, THICKNESS]);
// the box
translate([LED_SPACING/2 - THICKNESS, 0, 0])
difference() {
cube([LED_WIDTH + THICKNESS*2, LED_DEPTH + THICKNESS, LED_HEIGHT + THICKNESS]);
translate([THICKNESS, 0, 0])
cube([LED_WIDTH, LED_DEPTH, LED_HEIGHT]);
}
// right spacer
translate([LED_SPACING/2 + LED_WIDTH + THICKNESS, 0, 0])
cube([LED_SPACING/2 - THICKNESS, LED_DEPTH + THICKNESS, THICKNESS]);
}
module bearing() {
// the bearing "circles"
translate([0, (LED_DEPTH + THICKNESS)/2, 0])
difference() {
cylinder(d=LED_DEPTH + THICKNESS, THICKNESS);
cylinder(d=BEARING_DIAMETER, THICKNESS);
}
// the connection bar to the LED frames
difference() {
cube([BEARING_SPACING, LED_DEPTH + THICKNESS, THICKNESS]);
translate([0, (LED_DEPTH + THICKNESS)/2, 0])
cylinder(d=BEARING_DIAMETER, THICKNESS);
}
}
translate([-BEARING_SPACING, 0, 0])
bearing();
for(i = [0 : LED_AMOUNT - 1]) {
translate([i * (LED_WIDTH + LED_SPACING), 0, 0])
led_frame();
}