use global variables for everything
[challenge-bot] / caster-standoff.scad
index f61ac3aa90d27f62a4dd8e84e3ca3543971c87ed..f4a730d13e9f90fb9336b21718cb3dac1e8b1636 100644 (file)
@@ -4,31 +4,60 @@
 // https://gitorious.org/ozzloy/challenge-bot
 // https://github.com/waynegramlich/challenge-bot
 
-$fn = 100;
-
-module ball_screws(){
-  between = 14.732;  // 0.580 inches
-  screw_radius = 2.286/2;  // 0.090 inches
-  screw_length = 15;  // i made this up
-  translate([between/2, 0, 0]) cylinder(h = screw_length, r = screw_radius);
-  translate([-between/2, 0, 0]) cylinder(h = screw_length, r = screw_radius);}
-
-module fixture(){
-  height = 2.9464;
-  width = 20.32;
-  between = 14.732;
-  side_radius = (width - between)/2;
-  translate([between/2, 0, 0]) cylinder(h = height, r = side_radius);
-  translate([-between/2, 0, 0]) cylinder(h = height, r = side_radius);
-  }
+standoff_height = 55; // eyeballed
+nut_short_side = 4.7; // from calipers
+nut_height = 1.6; // from calipers
+standoff_radius = 14.732 / 2; // 0.580 / 2 inches from spec sheet
+screw_radius = 2.286/2;  // 0.090 inches
+caster_flange_screw_length = 8; // eyeballed
+// eyeballed caster flange height, (0.580/5) inches, times 2 to be stronger
+caster_flange_height = 2.9464 * 2;
+caster_flange_width = 20.32;  // 0.800 inches
+ziptie_width = 4.7625; // 3/16 inch
+ziptie_height = 3; // i'm guessing
+
+module caster_flange_screws(){
+  translate([standoff_radius, 0, 0])
+    cylinder(h = caster_flange_screw_length, r = screw_radius, $fn = 20);
+  translate([-standoff_radius, 0, 0])
+    cylinder(h = caster_flange_screw_length, r = screw_radius, $fn = 20);}
+
+module caster_flange(){
+  side_radius = caster_flange_width / 2 - standoff_radius;
+  hull(){
+    cylinder(h = caster_flange_height, r = standoff_radius);
+    translate([standoff_radius, 0, 0])
+      cylinder(h = caster_flange_height, r = side_radius);
+    translate([-standoff_radius, 0, 0])
+      cylinder(h = caster_flange_height, r = side_radius);}}
+
+module nut(size, height){
+    width = size/1.75;
+    for (r = [-60, 0, 60]) rotate([0,0,r]) cube([width, size, height], true);}
+
+module nuts(){
+  translate([standoff_radius, 0, nut_height/2])
+    nut(nut_short_side, nut_height);
+  translate([-standoff_radius, 0, nut_height/2])
+    nut(nut_short_side, nut_height);}
+
+module ziptie(){
+  translate([-standoff_radius, -ziptie_width/2, 0])
+    cube([standoff_radius * 2, ziptie_width, ziptie_height]);}
 
 module caster_standoff(){
-  height = 43;
-  caster_radius = 14.732/2;
   difference(){
     union(){
-      cylinder(h = height, r = caster_radius);
-      fixture();}
-    scale([1, 1, 1.1]) translate([0, 0, -.1]) ball_screws();}}
+      cylinder(h = standoff_height, r = standoff_radius);
+      caster_flange();}
+    translate([0, 0, -.1]) scale([1, 1, 1.1])
+      caster_flange_screws();
+    translate([0, 0, caster_flange_height])
+      nuts();
+    translate([0, 0, standoff_height * 3 / 4]) scale([1.1, 1, 1])
+      ziptie();
+    rotate([0, 0, 90]) translate([0, 0, standoff_height * 1 / 2])
+      scale([1.1, 1, 1])
+        ziptie();}}
 
 caster_standoff();