chiark / gitweb /
topeak-mtx-tortec-expeditionrack-adapter: demo wip
[reprap-play.git] / topeak-mtx-tortec-expeditionrack-adapter.scad
index d8f7f59e4b96972db7f377bfd6df1346d03b0bff..607a367e9680a623fc2f28402b582f1879dbdbd1 100644 (file)
@@ -20,9 +20,10 @@ 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_to_cross_rail = 43.05; // XXX // bolt centre to rail centre, rail to front
 front_elevation_nominal = 3;
 
+cross_rail_distance = 232.09;
+
 general_gap_y = 1.0;
 
 strap_w = 8.0 + 1.0;
@@ -96,6 +97,11 @@ strap_barrel_x = rack_width_inner/2 + strap_barrel_dia/2;
 
 rack_shear_ratio = -rear_elevation_nominal / rear_to_front_distance;
 
+front_to_cross_rail =
+  cross_rail_distance * sqrt(1 - rack_shear_ratio * rack_shear_ratio)
+  - rear_bolt_to_front_bolt
+  - rear_to_cross_rail;
+
 brk_bolt_nut_top_y = -brk_nearbolt_recess_depth
   - brk_bolt_eff_len + brk_bolt_nut_th + brk_bolt_len_slop;
                       
@@ -254,6 +260,19 @@ module FamGraspElevation(){
   }
 }
 
+module FamStemElevation(){
+  hull(){
+    rectfromto([ -$foreaftmaint_rail_z, adapt_main_top_y ],
+              [ 0, block_y_min]);
+    translate([
+              -$foreaftmaint_rail_z,
+              $rack_rail_y +
+              rack_shear_ratio * $foreaftmaint_rail_z * $reverse_sign,
+              ])
+      square([0.1, rack_rail_dia * 0.5], center=true);
+  }
+}
+
 module Principal(){
   // calculated
   $rack_rail_y = rack_rail_y_of_elevation($elevation_nominal);
@@ -307,16 +326,18 @@ module Principal(){
       }
 
       FamLinextr(){
-       rectfromto([ -$foreaftmaint_rail_z, adapt_main_top_y ],
-                  [ 0, block_y_min]);
        rectfromto([ -foreaftmaint_top_block_zs[0] + bolt_z, 0 ],
                   [ -foreaftmaint_top_block_zs[1] + bolt_z, block_y_min] );
        FamGraspElevation();
       }
       intersection(){
-       RackShear()
+       union(){
+         RackShear()
+           FamLinextr()
+           FamGraspElevation();
          FamLinextr()
-         FamGraspElevation();
+           FamStemElevation();
+       }
        translate([ 0,
                    adapt_main_top_y - 50,
                    $foreaftmaint_rail_z ])
@@ -366,21 +387,35 @@ module Principal(){
   }
 }
 
-module RackForDemo(){ ////toplevel
+module ForRackForDemo(){
   elevation = elevation_of_bolt_for(rear_to_cross_rail);
   rack_rail_y = rack_rail_y_of_elevation(elevation);
 
   rotate([-atan(rack_shear_ratio), 0,0])
-    translate([0, rack_rail_y, brk_block_z/2 + rack_rail_y*rack_shear_ratio]) {
-      for (m=[0]) mirror([m,0,0]) {
-        linextr(-50, 50 + rear_to_cross_rail)
-         translate([rack_rail_x, 0])
-         circle(r= rack_rail_dia/2);
-       }
-      translate([0,0, rear_to_cross_rail])
-       linextr_x_yz(rack_rail_x, -rack_rail_x)
+    translate([0, rack_rail_y, brk_block_z/2 + rack_rail_y*rack_shear_ratio])
+    children();
+}
+
+module RackForDemoRails(){
+  ForRackForDemo() {
+    for (m=[0]) mirror([m,0,0]) {
+      linextr(-(50 + cross_rail_distance), 50 + rear_to_cross_rail)
+       translate([rack_rail_x, 0])
        circle(r= rack_rail_dia/2);
     }
+  }
+}
+
+module RackForDemoCrosses(){
+  ForRackForDemo() {
+    translate([0,0, rear_to_cross_rail])
+      linextr_x_yz(rack_rail_x, -rack_rail_x)
+      circle(r= rack_rail_dia/2);
+
+    translate([0,0, rear_to_cross_rail - cross_rail_distance])
+      linextr_x_yz(rack_rail_x, -rack_rail_x)
+      circle(r= rack_rail_dia/2);
+  }
 }
 
 module Front(){ ////toplevel
@@ -423,6 +458,9 @@ module RearDemo(){ ////toplevel
 module RearRackDemo(){ ////toplevel
   rotate([atan(rack_shear_ratio),0,0]) SomeDemo() {
     Rear();
-    %RackForDemo();
+    translate([0, 0, -rear_bolt_to_front_bolt])
+      Front();
+    %RackForDemoRails();
+    %RackForDemoCrosses();
   }
 }