chiark / gitweb /
sewing-table: commitids (non-TEST): break out cidsz (nfc)
[reprap-play.git] / sewing-table.scad.m4
index 37b46b6dafa2a6db10922af8ce04aab812ab2347..458d00e7ec1378c2c610ad07e2ed02c2e5568163 100644 (file)
@@ -98,6 +98,7 @@ reartablet_y = 5;
 
 frontcurve_side_skew = 3.5 / 72;
 frontcurve_avoid_y = 70;
+frontcurve_z_slop = 0.75;
 
 // calculated
 
@@ -129,6 +130,9 @@ interlock_sq_adj = 0.2; // arbitrary
 
 first_front = machine_front_profile[len(machine_front_profile)-1];
 
+m4_define(`POST_TCROSSSZ',
+          `2*( tile_hard_edge_hole_dist - test_edge + 1 )')
+
 module Post(){
   mirror([0,0,1]) {
     difference(){
@@ -139,10 +143,9 @@ module Post(){
       }
     }
     if (TEST) {
-      tsz = tile_hard_edge_hole_dist - test_edge + 1;
       translate([0,0, tile_th/2]) {
-       cube([post_dia, tsz*2, tile_th], center=true);
-       cube([tsz*2, post_dia, tile_th], center=true);
+       cube([post_dia,      POST_TCROSSSZ, tile_th], center=true);
+       cube([POST_TCROSSSZ, post_dia,      tile_th], center=true);
       }
     }
   }
@@ -164,15 +167,19 @@ module TileBase(botleft, topright){
       translate(concat(botleft, [0]))
       cube(concat(size, [tile_th]));
     if (!TEST) {
+      cidsz = topright_post-botleft_post
+       + [-post_dia,-post_dia]
+       + [0, thehd[1]];
       translate( concat(botleft_post, [ -tile_th ])
                 + 0.5 * [ post_dia, post_dia, 0 ] )
-       Commitid_BestCount_M( topright_post-botleft_post
-                             + [-post_dia,-post_dia]
-                             + [0, thehd[1]]);
+       Commitid_BestCount_M(cidsz);
     }
     if (TEST) {
-      translate( concat(botleft + [thehd[0], 0], [0]) )
-       Commitid_BestCount([ size[0] - thehd[0]*2, thehd[1] ]);
+      crossoff = tile_hard_edge_hole_dist + POST_TCROSSSZ/2;
+      cidsz = [ thehd[0], size[1] - 2*crossoff ];
+      cidszr = [ cidsz[0], min(cidsz[1], 50) ];
+      translate( concat(botleft + [0, crossoff] + (cidsz-cidszr)/2, [0]) )
+       Commitid_BestCount(cidszr);
       difference(){
        mirror([0,0,1]) {
          translate(concat(botleft + [test_edge,test_edge], [test_tile_th]))
@@ -445,7 +452,7 @@ module Machine_Curves(){ ////toplevel
   }
   translate([ tile01_tr[0] - cutout_l_end_x + rearedge_len,
              cutout_tile11_y,
-             0 ]){
+             frontcurve_z_slop ]){
     translate([ 0, -first_front[0] , 0 ])
       multmatrix([[1, -frontcurve_side_skew, 0, 0],
                  [0,  1,   0, 0],
@@ -621,7 +628,7 @@ module Tile10(){ ////toplevel
   cty = cutout_tile11_y;
   rcy = cty + rearcurve_avoid_y;
   posts = [ cnr_posts[0] + [ 0,                             cty ],
-           cnr_posts[1] + [ -sz[1] + rearedge_len - cutout_l_end_x, cty ],
+           cnr_posts[1] + [ -sz[0] + rearedge_len - cutout_l_end_x, cty ],
            cnr_posts[1] + [ 0,                             rcy ],
            cnr_posts[2],
            cnr_posts[3] ];
@@ -650,7 +657,7 @@ module Tile00(){ ////toplevel
   posts = [ cnr_posts[0],
            cnr_posts[1],
            cnr_posts[2] + [ 0,                             -rcy ],
-           cnr_posts[2] + [ -sz[1] + rearedge_len - cutout_l_end_x, -cty ],
+           cnr_posts[2] + [ -sz[0] + rearedge_len - cutout_l_end_x, -cty ],
            cnr_posts[3] + [ 0,                             -cty ]
            ];
   rcs = [R_EDGE(c,1)];