--- /dev/null
+infty = 50;
+eps = 0.01;
+
+wall = 2;
+
+led_d = 10 + 0.5;
+led_l = 6;
+led_d1 = 12 + 0.3; // sirsi cast LEDky
+led_l1 = 3; // prostor pro vlozeni LEDky
+
+led_angle_pitch = 36.6 - 10;
+
+tube_inner_d = 23;
+tube_depth = 8;
+top_h = 15;
+
+module led() {
+ color("red") {
+ cylinder(r = led_d/2, h = led_l);
+ translate([0, 0, led_l]) sphere(led_d/2);
+ translate([0, 0, -led_l1]) cylinder(r=led_d1/2, h=led_l1+eps);
+ };
+/*
+ color("gray") {
+ translate([0, 0, -led_l1]) cylinder(r=led_d1/2, h=led_l1-wall+eps);
+ }
+*/
+}
+
+
+module bottom_body() {
+ cylinder(r = tube_inner_d/2 - wall/2, h = tube_depth+eps);
+ for (ang = [0:30:360])
+ rotate([0, 0, ang])
+ translate([tube_inner_d/2 - wall/2, 0, -eps])
+ cylinder(r = wall/2, h = tube_depth + 3*eps, $fn = 4);
+}
+
+module bottom() {
+ difference() {
+ bottom_body();
+ translate([0, 0, -eps])
+ cylinder(r = tube_inner_d/2 - 3*wall/2, h = tube_depth + 3*eps);
+ }
+}
+
+module top_body() {
+ hull() {
+ cylinder(r = tube_inner_d/2 + wall, h = wall);
+ rotate([0, led_angle_pitch, 0])
+ translate([0, 0, top_h])
+ cylinder(r = led_d/2 + wall, h = eps);
+ }
+}
+
+
+module top() {
+ difference() {
+ top_body();
+ rotate([0, led_angle_pitch, 0])
+ translate([0, 0, top_h-led_l])
+ difference() {
+ # led();
+ for (a = [0:60:360])
+ rotate([0, 0, a])
+ translate([0, led_d1/2, -led_l1-eps])
+ cylinder(r1 = wall/3, h = led_l1+3*eps, r2 = 0);
+ }
+ hull() {
+ translate([0, 0, -eps])
+ cylinder(r = tube_inner_d/2-3*wall/2, h = eps);
+ rotate([0, led_angle_pitch, 0])
+ translate([0, 0, top_h-led_l-led_l1])
+ cylinder(r = led_d1/2, h = eps);
+ };
+ };
+}
+
+module main() {
+ rotate([0, -led_angle_pitch, 0]) {
+ translate([0, 0, -tube_depth])
+ bottom();
+ top();
+ }
+}
+
+difference() {
+ main();
+/*
+ translate([0, 0, -infty/2])
+ rotate([0, 0, 45])
+ cube(infty);
+ translate([0, 0, -infty/2])
+ cube(infty);
+*/
+}
+
+