chiark / gitweb /
air-hockey-puck: wip
[reprap-play.git] / poster-tube-lid.scad
index 4af0813a8923220fcbd10246123aa9f57d1eecc0..000dec775fabe10c90f7c9b31de28cc1cbcfc998 100644 (file)
@@ -5,6 +5,13 @@
 //   CoverPrint
 //   StrapMount
 //   CatchAssembly
+//
+// For attaching tube to wall, with base, for storing sticks etc.
+//
+//   WallMount             goes near top
+//   WallMountForBase      goes at bottom
+//   WallMountBase         attaches to bottom, glue some neoprene to it
+//   WallMountBaseCutJig   jig for cutting neoprene
 
 include <funcs.scad>
 include <utils.scad>
@@ -87,9 +94,33 @@ sm_bolt_y_over = 0.5;
 sm_closure_cnr = 3.0;
 
 wm_thick = 5;
-wm_screw_dia = 5;
-wm_screw_around = 5;
-wm_csink = 2.5;
+wm_screw_dia = 4.5; // Timco wood screw 40mm, use brown plug
+wm_screwdriver_dia = 6.3 + 1.5;
+wm_screw_around = 5.0;
+wm_screw_slot = 3.5;
+wm_screw_head = 8.0;
+
+wmb_screw_dia = 5;
+wmb_screw_head_dia = 8.7 + 0.5;
+wmb_screw_around_x = 4;
+wmb_screw_around_z = 6;
+wmb_screw_depth_min = 10;
+web_screw_len = 16 + 0.5;
+wmb_nut_across = 7.82 + 0.35;
+wmb_nut_around_min = 2;
+wmb_nut_behind_min = 5;
+wmb_nut_th = 3.84 + 0.75;
+wmb_mount_wall = 4.5;
+wmb_mount_gap_xy = 0.1;
+wmb_mount_gap_z = 0.2;
+wmb_mount_y_width = 10;
+wmb_bottom_gap = 35; // includes allowance for padding, etc.
+wmb_bottom_th = 7;
+wmb_bottom_th_min = 1;
+wmb_ring_gap = 1.0;
+wmb_base_extra_rad = 10;
+wmb_jig_th = 1;
+wmb_jig_around_gap = 1;
 
 catch_stalk_h = 4.5;
 catch_stalk_len = 50;
@@ -155,6 +186,53 @@ sm_outer_rad = sm_inner_rad + sm_main_thick;
 wm_main_width = sm_main_width;
 wm_y_min = sqrt( pow(sm_inner_rad, 2) -
                 pow(sm_inner_rad - (wm_thick - sm_main_thick), 2) );
+wm_y_screw = wm_y_min + wm_screw_around + wm_screw_dia/2;
+wm_y_max = wm_y_screw + wm_screw_dia/2 + wm_screw_around;
+wm_lhs_y_min = -wm_y_max;
+wm_y_slotc_screw = wm_y_screw + wm_screw_slot/2;
+wm_y_slot1_screw = wm_y_screw + wm_screw_slot;
+wm_y_slot1_max = wm_y_max + wm_screw_slot/2;
+wm_z_slot0_screw = wm_main_width + wm_screwdriver_dia/2;
+wm_z_slotc_screw = wm_z_slot0_screw + wm_screw_slot/2;
+wm_z_slot1_screw = wm_z_slot0_screw + wm_screw_slot;
+wm_z_max = wm_z_slot1_screw + wm_screw_around;
+
+wmb_mount_cut_rad = sm_outer_rad + wmb_ring_gap;
+wmb_nut_rad = wmb_nut_across / cos(30) * 0.5;
+wmb_x_screw_plus_around_r = max(
+                               wmb_screw_around_x + wmb_screw_dia/2,
+                               wmb_nut_around_min + wmb_nut_across/2
+                               );
+wmb_x_screw = -sm_outer_rad + wmb_x_screw_plus_around_r;
+wmb_x_outer = -sm_outer_rad + wmb_x_screw_plus_around_r * 2;
+function wmb_screw_thing_y_min(dia) = sqrt(
+                      pow(wmb_mount_cut_rad, 2) -
+                      pow(wmb_x_screw + dia/2, 2)
+                      );
+wmb_y_screw_end = wmb_screw_thing_y_min(wmb_screw_dia);
+wmb_y_nut_min = max(
+    wmb_screw_thing_y_min(wmb_nut_across + wmb_nut_around_min*2),
+    wm_y_slot1_max
+                   );
+wmb_y_mount_max = max(
+                     wmb_y_nut_min + wmb_nut_th + wmb_nut_behind_min,
+                     wmb_y_screw_end + wmb_screw_depth_min
+                     );
+wmb_z_screw = max(
+                 wmb_screw_around_z + wmb_screw_dia/2,
+                 wmb_nut_around_min + wmb_nut_rad
+                 );
+wmb_z_max = wmb_z_screw * 2;
+wmbb_y_max = max(
+                wmb_y_mount_max + wmb_mount_gap_xy + wmb_mount_wall,
+                wmb_y_screw_end + web_screw_len
+                );
+wmbb_x_outer = wmb_x_outer + (wmb_mount_gap_xy + wmb_mount_wall);
+wmbb_z_flat_max = -wmb_bottom_gap;
+wmbb_z_flat_whole_min = wmbb_z_flat_max - wmb_bottom_th_min;
+wmbb_z_min      = wmbb_z_flat_max - wmb_bottom_th;
+wmbb_r_top = main_dia/2 + wmb_base_extra_rad;
+wmbb_r_bottom = wmbb_r_top - (wmb_bottom_th - wmb_bottom_th_min);
 
 smc_pos = [ 0, sm_inner_rad, 0 ];
 
@@ -516,7 +594,7 @@ module ImplHeadCupTest(){ ////toplevel
       ImplHeadCup();
 }
 
-module SomeStrap(width){
+module SomeStrap(width, cut_width=0){
   // children(0) is to add, (1) subtract
   difference(){
     union(){
@@ -528,9 +606,9 @@ module SomeStrap(width){
       children(0);
     }
     translate([0,0,-1])
-      cylinder(r=sm_inner_rad, h=width+2);
+      cylinder(r=sm_inner_rad, h=max(width+2, cut_width));
     translate(smc_pos)
-      StrapMountBolt(10, width);
+      StrapMountBolt(5, width);
     translate(smc_pos)
       cube([ sm_bolt_tighten_allow, 40,100 ], center=true);
     children(1);
@@ -586,18 +664,204 @@ module StrapMount(){ ////toplevel
   }
 }
 
+module WallScrewHoleSlot(){ ////toplevel
+  ds = [-1,+1] * wm_screw_slot/2;
+  linextr_x_yz(-(wm_thick + 1), 1) {
+    hull(){
+      for (d = ds)
+       translate([d, 0])
+         circle(r = wm_screw_dia/2);
+    }
+  }
+  hull(){
+    for (d = ds){
+      translate([0, d, 0]){
+       linextr_x_yz(0, 1)
+         circle(r = wm_screw_head/2);
+       linextr_x_yz(-(wm_screw_head - wm_screw_dia)/2, 0)
+         circle(r = wm_screw_dia/2);
+      }
+    }
+  }
+}
+
+module WallMountMounts(){
+  linextr(0, wm_z_max){
+    translate([ -sm_outer_rad, 0 ])
+      rectfromto([ 0,        wm_lhs_y_min ],
+                [ wm_thick, wm_y_slot1_max ]);
+  }
+}
+module WallMountScrewHoles(){
+  translate([ -sm_outer_rad + wm_thick, 0, wm_z_slotc_screw ]) {
+    translate([ 0, wm_y_slotc_screw, 0 ])
+      WallScrewHoleSlot();
+    translate([ 0, -wm_y_slotc_screw, 0 ])
+      rotate([90,0,0])
+      WallScrewHoleSlot();
+  }
+}
+
 module WallMount(){ ////toplevel
-  SomeStrap(sm_main_width){
+  SomeStrap(sm_main_width, wm_z_max + 2){
+    WallMountMounts();
+    WallMountScrewHoles();
+  }
+}
+
+module WallMountBaseRingCut(){
+  circle(r = wmb_mount_cut_rad);
+}
+
+module WallMountBaseMounts(){
+  linextr(0, wmb_z_max) {
+    difference(){
+      rectfromto([ -sm_outer_rad, -wmb_y_mount_max ],
+                [ wmb_x_outer,   +wmb_y_mount_max ]);
+      WallMountBaseRingCut();
+    }
+  }
+}
+
+// screws, nuts, slots for nuts to go down into
+module WallMountBaseScrewsEtc(){ ////toplevel
+  for (my=[0,1]) {
+    mirror([0, my, 0]) {
+      translate([wmb_x_screw, 0, wmb_z_screw]) {
+       linextr_y_xz(wmb_y_screw_end,
+                    wmb_y_screw_end + 50)
+         circle(r = wmb_screw_dia/2);
+       linextr_y_xz(wmb_y_screw_end + web_screw_len,
+                    wmb_y_screw_end + 50)
+         circle(r = wmb_screw_head_dia/2);
+       linextr_y_xz(wmb_y_nut_min,
+                    wmb_y_nut_min + wmb_nut_th) {
+         hull(){
+           rotate(30)
+             circle(r = wmb_nut_rad, $fn = 6);
+           translate([0, 50])
+             square(wmb_nut_across, center=true);
+         }
+       }
+      }
+    }
+  }
+}
+
+module WallMountForBase(){ ////toplevel
+  SomeStrap(sm_main_width, wm_z_max + 2){
+    union(){
+      WallMountMounts();
+      WallMountBaseMounts();
+    }
     union(){
-      linextr(0, sm_main_width){
-       translate([ -sm_outer_rad, wm_y_min ])
-         square([ wm_thick, 20 ]);
+      WallMountScrewHoles();
+      WallMountBaseScrewsEtc();
+    }
+  }
+}
+
+module WallMountForBaseFixingsTest(){ ////toplevel
+  intersection(){
+    WallMountForBase();
+    linextr(-100,100)
+      rectfromto([ -sm_outer_rad-10, -wm_y_min ],
+                [ wmb_x_outer + 1, -100 ]);
+  }
+}
+
+module WallMountBaseFixingsTest(){ ////toplevel
+  intersection(){
+    WallMountBase();
+    linextr(-2,100)
+      rectfromto([ -sm_outer_rad-10, -wm_y_min ],
+                [ wmbb_x_outer + 1, -100 ]);
+  }
+}
+
+module WallMountBasePillarsPlan(){
+  for (my = [0,1]) {
+    mirror([0, my]) {
+      rectfromto([ -sm_outer_rad, wmbb_y_max - wmb_mount_y_width ],
+                [ wmbb_x_outer, wmbb_y_max ]);
+    }
+  }
+}
+
+// trim parts that are would foul the wall
+module WallMountTrimWallFoulPlan(){
+    translate([ -sm_outer_rad, 0])
+    rectfromto([ -wmbb_r_top, -(wmbb_r_top + 1) ],
+              [ 0,           +(wmbb_r_top + 1) ]);
+}
+
+module WallMountBase(){ ////toplevel
+  difference(){
+    union(){
+      // vertical blocks rising to join to wall mount
+      linextr(wmbb_z_min, wmb_z_max) {
+       difference(){
+         WallMountBasePillarsPlan();
+         WallMountBaseRingCut();
+       }
+      }
+
+      hull(){
+       linextr(wmbb_z_flat_whole_min, wmbb_z_flat_max)
+         circle(r = wmbb_r_top);
+       linextr(wmbb_z_min, wmbb_z_flat_max)
+         circle(r = wmbb_r_bottom);
+      }
+      linextr(wmbb_z_min, wmbb_z_flat_max) {
+       hull(){
+         WallMountBasePillarsPlan();
+         circle(r = wmbb_r_bottom);
+       }
       }
     }
-    union(){ }
+
+    // cutaway for mount part
+    linextr(-wmb_mount_gap_z, wmb_z_max+1) {
+      for (my = [0,1]) {
+       mirror([0, my])
+         rectfromto([ -sm_outer_rad-1, wmb_y_mount_max + wmb_mount_gap_xy ],
+                    [ wmb_x_outer + wmb_mount_gap_xy, 1 ]);
+      }
+    }
+
+    linextr(wmbb_z_min - 1, wmb_z_max + 1)
+      WallMountTrimWallFoulPlan();
+    WallMountBaseScrewsEtc();
   }
 }
 
+module WallMountBaseCutJigPlan(){ ////toplevel
+  difference(){
+    union(){
+      circle(r = wmbb_r_top);
+    }
+
+    translate([ wmb_jig_around_gap, 0 ])
+      WallMountTrimWallFoulPlan();
+
+    offset(delta = wmb_jig_around_gap)
+      WallMountBasePillarsPlan();
+  }
+}
+
+module WallMountBaseCutJig(){ ////toplevel
+  translate([ 0,0, wmbb_z_flat_max + 0.5 ])
+    linextr(0, wmb_jig_th)
+    WallMountBaseCutJigPlan();
+}
+
+module WallMountForBaseDemo(){ ////toplevel
+  render() WallMountForBase();
+  color("blue") render() WallMountBase();
+  %WallMountBaseScrewsEtc();
+  %WallMountBaseCutJig();
+}
+
 module CatchAssemblyCoreProfile(){
   difference(){
     union(){