chiark / gitweb /
digispark-with-cable: wip
[reprap-play.git] / topeak-mtx-tortec-expeditionrack-adapter.scad
index bc987fc9d8f75f93bb9523dd429184be3c64f683..c751f787081e7e3baf778d42e8c49eed23ff140d 100644 (file)
@@ -20,7 +20,7 @@ rear_elevation_nominal = 10.04;
 rear_to_front_distance = 230; // rack cross rail (fam) to very front end
 rear_to_cross_rail = 43.05; // bolt centre to rail centre, rail to rear
 rear_bolt_to_front_bolt = 155.4;
-front_elevation_nominal = 3;
+front_elevation_nominal = 0; // this parameter adjusts rear too somehow?
 
 cross_rail_distance = 232.09;
 
@@ -39,6 +39,9 @@ brk_bolt_dia = 5.0 + 0.5;
 brk_nearbolt_recess_dia = 8.86 + 1.5;
 brk_nearbolt_recess_depth = 1.09 + 0.25;
 
+bolt_nut_around = 5;
+bolt_nut_around_y_extra = 3;
+
 brk_bolt_eff_len = 11.78; // inside of recess, to end of bolt
 brk_bolt_len_slop = 0.5;
 brk_bolt_nut_th = 3.89;
@@ -255,22 +258,30 @@ module FamLinextr(){
 }
 
 module FamGraspElevation(){
-  hull(){
-    ybot = $rack_rail_y - rack_rail_dia/2 + grasp_large_r
-      - fit_slope_len * 0.5;
-    for (y = [
-             ybot,
-             adapt_main_top_y - grasp_large_r
-             ])
-      for (dx= [/*-1,*/ +1] * rack_rail_dia/2)
-       translate([ -$foreaftmaint_rail_z + dx, y ])
-         circle(r= grasp_large_r);
+  difference(){
+    hull(){
+      ybot = $rack_rail_y - rack_rail_dia/2 + grasp_large_r
+       - fit_slope_len * 0.5;
+      for (y = [
+               ybot,
+               adapt_main_top_y - grasp_large_r
+               ])
+       for (dx= [/*-1,*/ +1] * rack_rail_dia/2)
+         translate([ -$foreaftmaint_rail_z + dx, y ])
+           circle(r= grasp_large_r);
+    }
+    if ($foreaftmaint_cutoff) {
+      translate([ -$foreaftmaint_rail_z, 0 ])
+       rectfromto([-100, -100],
+                  [0, 100]);
+    }
   }
 }
 
 module FamStemElevation(){
   hull(){
-    rectfromto([ -$foreaftmaint_rail_z, adapt_main_top_y ],
+    rectfromto([ -$foreaftmaint_rail_z
+                , adapt_main_top_y ],
               [ 0, block_y_min]);
     translate([
               -$foreaftmaint_rail_z,
@@ -354,9 +365,12 @@ module Principal(){
          cube(center=true, 100);
       }
 
-      linextr_y_xz( adapt_main_top_y-2, adapt_main_top_y )
-       translate([ 0, brk_block_z/2 ])
-       circle(20);
+      linextr_y_xz( block_y_min - bolt_nut_around_y_extra , adapt_main_top_y )
+       intersection(){
+         translate([ 0, brk_block_z/2 ])
+           circle(r = bolt_nut_around + brk_bolt_nut_r );
+         rectfromto([-100, 0], [+100,+100]);
+      }
     }
 
     RackShear() linextr(-10, main_sz_lhs_z+main_sz_rhs_z) {
@@ -437,9 +451,10 @@ module RackForDemoCrosses(){
 }
 
 module Front(){ ////toplevel
-  // xxx elevation is wrong
+  rotate([180,0,0])
   Principal($reverse_sign = -1,
            $foreaftmaint_top_block = false,
+           $foreaftmaint_cutoff = true,
            $elevation_nominal=
       elevation_of_bolt_for(rear_to_cross_rail + rear_bolt_to_front_bolt),
            $foreaftmaint_dz= front_to_cross_rail);
@@ -448,6 +463,7 @@ module Front(){ ////toplevel
 module Rear(){ ////toplevel
   Principal($reverse_sign = +1,
            $foreaftmaint_top_block = true,
+           $foreaftmaint_cutoff = false,
            $elevation_nominal=
       elevation_of_bolt_for(rear_to_cross_rail),
            $foreaftmaint_dz= rear_to_cross_rail);
@@ -470,7 +486,7 @@ module SomeDemo(){
 }
 
 module FrontDemo(){ ////toplevel
-  SomeDemo() Front();
+  SomeDemo() rotate([180,0,0]) Front();
 }
 module RearDemo(){ ////toplevel
   SomeDemo() Rear();
@@ -479,7 +495,7 @@ module RearRackDemo(){ ////toplevel
   rotate([atan(rack_shear_ratio),0,0]) SomeDemo() {
     Rear();
     translate([0, 0, -rear_bolt_to_front_bolt])
-      Front();
+      rotate([180,0,0]) Front();
     %RackForDemoRails();
     color("blue") RackForDemoCrosses();
   }