chiark / gitweb /
fairphone-case: reformat a bit (nfc)
[reprap-play.git] / bike-lipo-box-gland.scad
index 59a78f8de39367384444ffc2c6e113c79c467f8b..0e9228b379d7c5c5debe9cae9ed1a6055dcb0908 100644 (file)
@@ -2,38 +2,58 @@
 
 include <commitid.scad>
 
-module Gland(){
-    hull(){
-      for (m=[0,1]) {
-       mirror([0,0, m]) {
-         translate([0,0, 8]) cylinder(r=13, h=0.5);
-         translate([0,0, 1.5]) cylinder(r=20, h=0.5);
-       }
-      }
-    }
+cable_dias = [6.5, 8.2];
+
+cd = cable_dias[1] + 0.5;
+wall = 2.5;
+
+function Gland_xlen(cabledia)    = cabledia * 1.5;
+function Gland_xdia(cabledia)    = cabledia * 2.0;
+function Gland_xoutdia(cabledia) = Gland_xdia(cabledia) * 1.1 + 0.5;
+
+// origin is centre, on outside
+// outside is in direction of positive X axies
+module GlandNegative(cabledia){
+  xlen = Gland_xlen(cabledia);
+  xdia = Gland_xdia(cabledia);
+
+  hull(){
+    rotate([0,90,0]) cylinder(r= cabledia/2, h=1);
+    translate([xdia,0,0]) rotate([0,90,0]) cylinder(r= xdia/2, h=1);
+  }
+  translate([-10,0,0])
+    rotate([0,90,0])
+    cylinder(r= cabledia/2, h=11);
 }
 
+module GlandPositive(cabledia){
+  translate([-0.1, 0,0])
+    rotate([0,90,0])
+    cylinder(r= Gland_xoutdia(cabledia)/2, h= Gland_xlen(cabledia) + 0.1);
+}  
+
+platesz = [wall, 24, 28];
+plateoff = [-platesz[0]/2, -platesz[1]/2, -platesz[2] + platesz[1]/2];
+
 module Plate(){
   difference(){
     union(){
-      Gland();
-      translate([-30,-30,0])
-       cube([60,60,3]);
+      GlandPositive(cd);
+      translate(plateoff)
+       cube(platesz);
     }
-    translate([0,0,-50])
-      cylinder(r=12.5, h=100);
+    GlandNegative(cd);
   }
 }
 
-module Test(){
-  rotate([90,0,0])
-    translate([0, 30, 0])
-    Plate();
-  difference(){
-    translate([-20,-20,0])
-      cube([40,20,1.2]);
-    Commitid_BestCount([40,20]);
+module Test(){ ////toplevel
+  Plate();
+  translate(plateoff){
+    difference(){
+      cube([15, 20, 1.2]);
+      Commitid_BestCount_M([15, 20]);
+    }
   }
 }
 
-Test();
+//Test();