chiark / gitweb /
topeak-mtx-tortec-expeditionrack-adapter: demo wip
[reprap-play.git] / topeak-mtx-tortec-expeditionrack-adapter.scad
index fc013bd35c53c0bcf14cf59dc915e090ec9e3c1d..607a367e9680a623fc2f28402b582f1879dbdbd1 100644 (file)
@@ -7,7 +7,7 @@
 include <utils.scad>
 
 // strength factor, set to 1 for real prints
-//$strf = 0.25;
+//$strf = 0.33;
 $strf = 1;
 
 brk_recess_actual = 5.20;
@@ -20,6 +20,9 @@ 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;
+
+cross_rail_distance = 232.09;
 
 general_gap_y = 1.0;
 
@@ -50,14 +53,14 @@ foreaftmaint_r_slop = 0.0;
 foreaftmaint_y_slop = -0.25;
 foreaftmaint_top_block_zs = [34.0, 39.0]; // rearwards from bolt hole
 
-main_sz_y = $strf * 18;
+main_sz_y = $strf * 12;
 grasp_sz = $strf * 6;
 grasp_thin_sz = $strf * 0.5;
 beside_strap_sz = $strf * 8;
-main_sz_core_z = $strf * 18;
+main_sz_core_z = $strf * 12;
 
 // "length" in for-aft direction of interaction with rack rail
-min_on_rail_sz_z = $strf * 25;
+min_on_rail_sz_z = $strf * 18;
 
 // when printer produces support
 support_around = 1.7; // how far does the support extend around (in XY)
@@ -94,12 +97,18 @@ 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;
                       
 brk_bolt_nut_r = brk_bolt_nut_across_flats/2 / cos(360/12);
 
 function elevation_of_bolt_for(z) = rear_elevation_nominal
+  + front_elevation_nominal
   + (z - brk_block_z/2) * rack_shear_ratio;
 
 function rack_rail_y_of_elevation(elevation_nominal) =
@@ -148,7 +157,7 @@ module MainExtrude(z){
     children();
 }
 module RackShear(){
-  s = rack_shear_ratio;
+  s = rack_shear_ratio * $reverse_sign;
   multmatrix([ [ 1, 0,  0, 0 ],
               [ 0, 1, s , 0 ],
               [ 0, 0,  1, 0 ],
@@ -238,20 +247,29 @@ module FamLinextr(){
 }
 
 module FamGraspElevation(){
-  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);
-    }
-    translate([0, adapt_main_top_y])
-      rectfromto([-500, 0], [500, 500]);
+  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);
+  }
+}
+
+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);
   }
 }
 
@@ -268,6 +286,9 @@ module Principal(){
 
   $foreaftmaint_rail_z = brk_block_z/2 + $foreaftmaint_dz - foreaftmaint_y_slop;
 
+  translate([0,0,brk_block_z/2])
+  mirror([0,0, $reverse_sign > 0 ? 0 : 1])
+  translate([0,0,-brk_block_z/2])
   difference(){
     union(){
       MainExtrude(main_sz_lhs_z){
@@ -305,15 +326,23 @@ 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();
       }
-      RackShear()
-       FamLinextr()
-       FamGraspElevation();
+      intersection(){
+       union(){
+         RackShear()
+           FamLinextr()
+           FamGraspElevation();
+         FamLinextr()
+           FamStemElevation();
+       }
+       translate([ 0,
+                   adapt_main_top_y - 50,
+                   $foreaftmaint_rail_z ])
+         cube(center=true, 100);
+      }
     }
 
     RackShear() linextr(-10, main_sz_lhs_z+main_sz_rhs_z) {
@@ -358,32 +387,48 @@ 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
   // xxx elevation is wrong
-  Principal($elevation_nominal=
+  Principal($reverse_sign = -1,
+           $elevation_nominal=
       elevation_of_bolt_for(rear_to_cross_rail + rear_bolt_to_front_bolt),
-           $foreaftmaint_dz= 0);
+           $foreaftmaint_dz= front_to_cross_rail);
 }
 
 module Rear(){ ////toplevel
-  Principal($elevation_nominal=
+  Principal($reverse_sign = +1,
+           $elevation_nominal=
       elevation_of_bolt_for(rear_to_cross_rail),
            $foreaftmaint_dz= rear_to_cross_rail);
 }
@@ -413,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();
   }
 }