chiark / gitweb /
fairphone-case: CatchPortion: take xwidth rather than width (nfc)
[reprap-play.git] / sewing-table.scad.m4
index a9315319c20475fc81a6f7e86fe783c5a27c5284..b71e04110cc327b69d281f314d33d066402a0221 100644 (file)
@@ -14,7 +14,7 @@ post_dia = 8;
 
 post_shorter = 1;
 
-screw_dia = 2.2;
+$screw_dia = 3.2;
 screw_big_dia = 3.6;
 screw_big_len = 4.0;
 
@@ -30,6 +30,33 @@ interlock_fine_lenslop = 1.0;
 
 demo_slop = 0.1;
 
+leg_height = 53.75 - 0.95;
+
+leg_hole_dia = 5 + 0.75;
+leg_big_dia = 37;
+leg_bot_dia = 15;
+leg_top_flat_z = 2;
+leg_top_thick = 8;
+
+leg_midspc_dia = 20;
+leg_bot_thick = 8;
+leg_bot_mid_dia = 12;
+
+leg_fin_top_w = 3;
+leg_fin_bot_w = 5;
+leg_fin_bot_rad = 30;
+leg_fin_bot_flat_z = 5;
+
+leg_n_fins = 4;
+leg_n_tubules = 4;
+leg_tubule_dia = 4;
+
+// spacer
+
+spacer_ext_slop = 0.25;
+spacer_int_slop = 0.25;
+spacer_height = 10;
+
 // cutout
 
 machine_rear_to_front = 84 + 0.25 - 1.4;
@@ -108,13 +135,18 @@ thehd_tl = [ -thehd_tr[0], thehd_tr[1] ];
 thehd_bl = -thehd_tr;
 thehd_br = -thehd_tl;
 
-tablet_z_slop = 0.25;
+tablet_z_slop = 1.00;
 
 interlock_rad = interlock_dia/2;
 interlock_negative_rad = interlock_rad + 0.125;
 
 interlock_sq_adj = 0.2; // arbitrary
 
+leg_fin_top_rad = sqrt( pow(leg_big_dia/2,2) -
+                       pow(leg_fin_top_w/2,2) );
+
+leg_tubule_pos_rad = leg_big_dia/2 * 0.6;
+
 m4_define(`POST_TCROSSSZ',
           `2*( tile_hard_edge_hole_dist - test_edge + 1 )')
 
@@ -125,7 +157,7 @@ module Post(){
        cylinder(r= post_dia/2, h= tile_th + ply_th - post_shorter);
        translate([0,0, tile_th]) {
          cylinder(r= screw_big_dia/2, h= screw_big_len);
-         cylinder(r= screw_dia/2, h= ply_th, $fn=20);
+         cylinder(r= $screw_dia/2, h= ply_th, $fn=20);
        }
       }
     }
@@ -207,6 +239,17 @@ module TileBase(botleft, topright){
          MachineEnvelope();
          cube(shufflesz, center=true);
        }
+       if (JIG) {
+         translate([0,0,-20]) linear_extrude(height=20) {
+           for (diag=[[ +1, botleft                   ],
+                      [ -1, [topright[0], botleft[1]] ]]) {
+             translate(diag[1])
+               rotate(atan2(size[1], diag[0] * size[0]))
+               translate([0, -test_edge/2])
+               square([vectorlen2d(size), test_edge]);
+           }
+         }
+       }
       }
     }
   }
@@ -446,6 +489,35 @@ module TestDemo(){ ////toplevel
     TestPiece2();
 }
 
+module PostTestPiece(){ ////toplevel
+  hole_sizes = [2.8, 3.0, 3.1, 3.134, 3.168, 3.2, 3.3, 3.5];
+  nholes = len(hole_sizes)*2;
+  nrows = 4;
+  stride = post_dia*1.5;
+  rect_sz = stride * [ nrows,
+                      ceil(nholes/nrows) ];
+  corners = Rectangle_corners(-stride * 0.5 * [1,1], rect_sz);
+  difference(){
+    union(){
+      TileBase(corners[0], corners[2]);
+      RoundEdge(corners[0], corners[1]);
+      for (i= [ 0: nholes-1 ]) {
+       $screw_dia = hole_sizes[ floor(i/2) ];
+       translate(stride * [ (nrows-1) - (i % nrows),
+                            floor(i / nrows),
+                            0
+                            ]) {
+         Posts([[0,0]]);
+         color("blue")
+           mirror([0,0,1])
+           translate([post_dia/2, -post_dia/2, 1])
+           cube([1, post_dia * (i / nholes), tile_th]);
+       }
+      }
+    }
+  }
+}
+
 module Machine_NewRearProfile(){
   // figures copied out of xfig edit boxes
   // best not to edit the posbox size if poss - just move it
@@ -636,6 +708,17 @@ module TestStrapPeg_Long(){ ////toplevel
   TestStrapPeg_any(60);
 }
 
+module PostSpacer(){ ////toplevel
+  $fn = 50;
+  difference(){
+    cylinder(r= ply_hole_dia_real/2 - spacer_ext_slop,
+            h= spacer_height);
+    translate([0,0,-1])
+      cylinder(r= post_dia/2 + spacer_int_slop,
+              h= ply_th + 2);
+  }
+}
+
 module Machine(){ ////toplevel
   Machine_NewArm();
   Machine_Curves();
@@ -656,6 +739,65 @@ module MachineEnvelope(){
   }
 }
 
+module Leg(){ ////toplevel
+  difference(){
+    union(){
+      hull(){
+       mirror([0,0,1])
+         cylinder(r= leg_big_dia/2, h=leg_top_flat_z, $fn=100);
+       translate([0,0, -leg_top_thick])
+         cylinder(r= leg_bot_dia/2, height=1, $fn=100);
+      }
+      if (!TEST)
+       translate([0,0,-leg_height])
+         cylinder(r= leg_bot_mid_dia/2, h=leg_bot_thick);
+      for (rot=[0: 360/leg_n_fins : 359]) rotate(rot) {
+         hull(){
+           mirror([0,0,1]) translate([0, -leg_fin_top_w/2, 0])
+             cube([ leg_fin_top_rad - 0.1,
+                    leg_fin_top_w,
+                    1 ])
+             ;
+           translate([0, -leg_fin_bot_w/2, -leg_height])
+             cube([ leg_fin_bot_rad,
+                    leg_fin_bot_w,
+                    leg_fin_bot_flat_z ]);
+         }
+       }
+    }
+    mirror([0,0,1]) translate([0,0,-1])
+      cylinder(r= leg_hole_dia/2,
+              h= (!TEST ? leg_height+2 : leg_height/2),
+              $fn=30);
+    mirror([0,0,1]) translate([0,0,leg_top_thick - 0.1])
+      hull(){
+        cylinder(r= (!TEST ? leg_midspc_dia/2 : 0.1),
+                h= leg_height - leg_top_thick - leg_bot_thick + 0.2,
+                $fn=30);
+       if (TEST)
+         cylinder(r= leg_midspc_dia/2,
+                  h= leg_height - leg_top_thick - leg_bot_thick
+                     + (!TEST ? 0.2 : -leg_midspc_dia/2),
+                  $fn=30);
+      }
+    cid_shear = (leg_fin_bot_w - leg_fin_top_w)/2 /
+                 (leg_height -leg_fin_bot_flat_z);
+    multmatrix([[ 1, 0, 0, leg_midspc_dia/2 ],
+                 [ 0, cid_shear,
+                         1, -leg_fin_bot_w/2 ],
+                 [ 0, 1, 0, -leg_height + leg_fin_bot_flat_z ],
+                 [ 0, 0, 0, 1 ]])
+      Commitid_BestCount([ leg_big_dia/2 - leg_midspc_dia/2,
+                            leg_height - leg_fin_bot_flat_z
+                             - leg_top_thick ]);
+    if (!TEST)
+      for (rot=[45: 360/leg_n_tubules : 359]) rotate(rot) {
+         mirror([0,0,1]) translate([ leg_tubule_pos_rad, 0, -1])
+           cylinder(r= leg_tubule_dia/2, h=leg_height+2, $fn=20);
+       }
+  }
+}
+
 function Rectangle_corners(c0, sz) =
   // returns the corners of a rectangle from c0 to c0+sz
   // if sz is positive, the corners are anticlockwise starting with c0
@@ -815,6 +957,7 @@ module Tile00(){ ////toplevel
   rcy = cty + frontcurve_avoid_y;
   posts = [ cnr_posts[0],
            cnr_posts[1],
+           0.5 * (cnr_posts[0] + cnr_posts[1]),
            cnr_posts[2] + [ 0,                             -rcy ],
            cnr_posts[2] + [ -sz[0] + frontedge_len - cutout_l_end_x, -cty ],
            cnr_posts[3] + [ 0,                             -cty ]
@@ -1027,6 +1170,12 @@ module Demo(){ ////toplevel
   translate(demo_slop*[-3,1]) color("blue")   Tile10();
   translate(demo_slop*[-3,0]) color("red")    Tile00();
   %Machine();
+  // Can also do this, to print reference sheet:
+  //  load this into openscad
+  //  select Ctrl-4 view, view all, scale appropriately
+  //  import sewing-table,Demo-flat.png
+  //  pngtopnm <sewing-table,Demo-flat.png | ppmbrighten -s -50 -v +100 >t.pnm
+  //  lpr t.pnm
 }
   
 //TestPiece1();