]> www.fi.muni.cz Git - things.git/commitdiff
RC plane battery hatch
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 27 Nov 2019 11:08:52 +0000 (12:08 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 27 Nov 2019 11:08:52 +0000 (12:08 +0100)
kaze-battery-hatch.scad [new file with mode: 0644]

diff --git a/kaze-battery-hatch.scad b/kaze-battery-hatch.scad
new file mode 100644 (file)
index 0000000..85d3877
--- /dev/null
@@ -0,0 +1,82 @@
+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]);
+               }
+       }
+}
+