chiark / gitweb /
floating-phases: Correct a comment for parameterisation
[reprap-play.git] / lock-inframe-bracket.scad
index b688252eda9bb38be3beee4e13efba54a8201633..324f8134f374c61f5d3dd1e7cb0e4f3818a12df8 100644 (file)
@@ -10,14 +10,15 @@ lock_w = 42.5 + 0.5;
 lock_d = 28.0 + 0.5;
 main_h = 45.0;
 backflange_d = 12;
+backflange_hole_dy = -1;
 lockshaft_dia = 14.35;
 
 cliprecess_h = 16;
 total_h = 45;
 
-back_gap = 14.5;
-main_th = 3.25;
-tube_th = 2.50;
+back_gap = 12.5;
+main_th = 3.50;
+tube_th = 4.00;
 
 midweb_d = 3;
 clip_th = 3.5;
@@ -27,6 +28,8 @@ clip_d = 22.0;
 mountscrew_dia = 4 + 0.5;
 clipbolt_dia = 5 + 0.6;
 
+mountscrew_washer = 10;
+
 backflange_th = 4.5;
 
 $fn=50;
@@ -35,15 +38,18 @@ join_cr = 9;
 
 tube_rear_extra_th = 1;
 
-divide_shaft_w = 1.5;
+divide_shaft_w = 1.75;
 divide_shaft_l = 1.5;
-divide_head_dx = 1.5;
+divide_head_dx = 1.75;
 divide_head_th = 1.5;
 divide_gap = 0.50;
-divide_heads = 1;
+divide_heads = 2;
+
+divide_angle = 26;
+divide_fudge_r = 4.75;
+divide_around = 3.5;
 
-divide_angle = 35;
-divide_fudge_r = 3;
+backflange_angle = 20;
 
 // calculated
 
@@ -52,7 +58,7 @@ front_th = main_th;
 
 tube_or = tube_dia/2 + tube_th;
 back_ohw = back_gap/2 + backflange_th;
-backflange_ymin = tube_or+backflange_d;
+backflange_ymin = tube_dia/2 + backflange_d;
 
 lock_0y = tube_dia/2 + lock_d/2 + midweb_d;
 lock_0x = lock_w/2 - lock_d/2;
@@ -91,14 +97,14 @@ module JoinCircs(jr){
   }
 }
 
-module DividePlan(){
+module DividePlan(xl=10){
   w = divide_shaft_w;
   g = divide_gap;
   l = divide_shaft_l + g;
   t = divide_head_th + g;
   dx = divide_head_dx;
   for (m=[0,1]) mirror([m,0]) {
-    translate([w, 0]) square([10, g]);
+    translate([w, 0]) square([xl, g]);
     for (i=[0:divide_heads-1]) {
       translate([w, i*(l + t)]) {
        translate([0, 0]) square([g, l + g]);
@@ -113,10 +119,10 @@ module DividePlan(){
   }
 }
 
-module DividePlanInPlace(){
+module DividePlanInPlace(xl=10){
   rotate([0,0, -divide_angle])
     translate([ -tube_dia/2 -tube_th/2 - divide_fudge_r, 0])
-    DividePlan();
+    DividePlan(xl);
 }
 
 module MainPlan(){
@@ -129,7 +135,8 @@ module MainPlan(){
              translate([0, -t])
                circle(r = tube_or);
          }
-         translate([-back_ohw,0]) mirror([0,1])
+         rotate([0,0, backflange_angle])
+           translate([-back_ohw,0]) mirror([0,1])
            square([back_ohw*2, backflange_ymin]);
 
          translate([0, lock_0y]){
@@ -142,23 +149,24 @@ module MainPlan(){
          }
        }
 
-       translate([-back_gap/2,1]) mirror([0,1])
+       rotate([0,0, backflange_angle])
+         translate([-back_gap/2,1]) mirror([0,1])
          square([back_gap, backflange_ymin+2]);
 
-       translate([0, lock_0y]){
-         oval([lock_w/2, lock_d/2]);
-       }
-
        JoinCircs(join_cr);
       }
 
       hull(){
        minkowski(){
-         DividePlanInPlace();
-         circle(5);
+         DividePlanInPlace(0.1);
+         circle(divide_around);
        }
       }
     }
+    translate([0, lock_0y]){
+      oval([lock_w/2, lock_d/2]);
+    }
+
     circle(r = tube_dia/2);
 
     DividePlanInPlace();
@@ -206,18 +214,24 @@ module ExtrudeClipElevation(extra=0){
     children(0);
 }
 
-module ThroughHole(r, y, z) {
-  translate([-50, y, z])
+module ThroughHole(r, y, z, x=-50) {
+  translate([x, y, z])
     rotate([0, 90, 0])
     cylinder(r=r, h=100, $fn=20);
 }
 
-module ThroughHoles(){
+module MountingHoleCylinders(r, x=-50){
   for (z=[ 1/4, 3/4 ]) {
-    ThroughHole( mountscrew_dia/2,
-                -tube_or -0.5*backflange_d,
-                total_h * z );
+    rotate([0,0, backflange_angle])
+      ThroughHole( r,
+                  -tube_dia/2 -0.5*backflange_d + backflange_hole_dy,
+                  total_h * z,
+                  x);
   }
+}
+
+module ThroughHoles(){
+  MountingHoleCylinders(mountscrew_dia/2);
 
   ThroughHole( clipbolt_dia/2,
               lock_0y + lock_d/2 + clip_d/2 + front_th/2,
@@ -234,14 +248,14 @@ module MainPositive(){
   }
 }
 
-module Bracket(){ //// toplevel
+module Bracket(){ ////toplevel
   difference(){
     MainPositive();
     ThroughHoles();
   }
 }
 
-module TestTopEdge(){ //// toplevel
+module TestTopEdge(){ ////toplevel
   intersection(){
     translate([0,0, -total_h])
       translate([0,0, 4])
@@ -251,7 +265,7 @@ module TestTopEdge(){ //// toplevel
   }
 }
 
-module TestClipBoltHole(){ //// toplevel
+module TestClipBoltHole(){ ////toplevel
   intersection(){
     union(){
       translate([0, 0, -5])
@@ -264,6 +278,13 @@ module TestClipBoltHole(){ //// toplevel
   }
 }
 
+module Demo(){ ////toplevel
+  Bracket();
+  color("blue") MountingHoleCylinders(mountscrew_dia/2 - 0.1);
+  color("black") MountingHoleCylinders(mountscrew_washer/2,
+                                      back_ohw + 0.25);
+}
+
 //MainPlan();
 //ClipElevationPositive();
 //ClipElevation();
@@ -273,5 +294,5 @@ module TestClipBoltHole(){ //// toplevel
 //TestClipBoltHole();
 //DividePlan();
 
-Bracket();
+//Bracket();