--- /dev/null
+eps = 0.01;
+infty = 200;
+
+// Ita ma 45-35 delka 70 + zaklopka
+//body_w1 = 50;
+//body_w2 = 40;
+//hole_l = 70;
+// Kaze
+body_w1 = 38;
+body_w2 = 43;
+hole_l = 65;
+
+magnet_d = 10;
+top_w = 2.5;
+body_l = hole_l + magnet_d + 2*top_w;
+body_h = 7;
+wall = 0.6;
+
+module tri_tube(w, l, h)
+{
+ // bottom
+ hull() {
+ for (y = [-1, 1]) scale ([1, y, 1]) {
+ translate([0, w/2-wall, 0]) cube(wall);
+ translate([l-wall, w/2-wall, 0]) cube(wall);
+ }
+ }
+ // rear
+ hull() {
+ for (y = [-1, 1]) scale ([1, y, 1]) {
+ translate([0, w/2-wall, 0]) cube(wall);
+ translate([0, w/2-wall, h-wall]) cube(wall);
+ }
+ }
+ // angled front
+ hull() {
+ for (y = [-1, 1]) scale ([1, y, 1]) {
+ translate([0, w/2-wall, h-wall]) cube(wall);
+ translate([l-wall, w/2-wall, 0]) cube(wall);
+ }
+ }
+}
+
+module beams() {
+ // front
+ tri_tube(2*body_w2, top_w, body_h);
+ // rear
+ translate([body_l, 0, 0])
+ rotate([0, 0, 180])
+ tri_tube(2*body_w1, top_w, body_h);
+ // sides
+ for (y = [-1, 1]) scale([1, y, 1])
+ translate([0, body_w2/2, 0])
+ rotate([0, 0, -90 - atan((body_w2-body_w1)/(2*body_l))])
+ translate([0, body_l/2, 0])
+ tri_tube(2*body_l, top_w, body_h);
+}
+
+module clip(w, l, magnet_r) {
+ difference() {
+ translate([0, -w/2, 0])
+ cube([l, w, wall]);
+ translate([l/2, 0, -eps])
+ cylinder(r = magnet_r, h = wall + 2*eps);
+ }
+}
+
+intersection() {
+ union() {
+ beams();
+ clip(2*body_w2, magnet_d + 2*top_w, magnet_d/2);
+ }
+ hull() {
+ for (y = [-1, 1]) scale ([1, y, 1]) {
+ translate([0, body_w2/2-eps, 0])
+ cube([eps, eps, body_h]);
+ translate([body_l-eps, body_w1/2-eps, 0])
+ cube([eps, eps, body_h]);
+ }
+ }
+}
+