chiark / gitweb /
crossbar-computer-led-mount: Base too, now adding registration lug
[reprap-play.git] / crossbar-computer-led-mount.scad
index ab337051d97a474f6fb64694d8e7351003425e2d..4bc474a38aaed7b2bd82fe25b3866e30c7217432 100644 (file)
@@ -3,25 +3,29 @@
 led_dia = 5 + 0.6;
 led_depth = 5;
 
-led_tip_z = 70;
+led_tip_height_above_crossbar = 70;
 led_angle = -60;
+crossbar_dia = 25; // fixme
 
 vert_space_inside = 8;
 backfront_space_inside = 12;
+width_space_inside = 10;
 
 backfront_mate_size = 25;
 tower_frontheight = 20;
-tower_width = 18;
 tower_slot_width = 3;
 
 cableclamp_ctie_width = 3 + 0.5;
 cableclamp_ctie_thick = 2 + 0.5;
 
-lidclamp_ctie_width = 3 + 0.5;
-lidclamp_ctie_thick = 2 + 0.5;
+lidclamp_ctie_width = 4.0 + 0.5;
+lidclamp_ctie_thick = 2.5 + 0.5;
 
-base_ctie_width = 4 + 0.5;
-base_ctie_thick = 2 + 0.5;
+base_ctie_width = 4.0 + 0.5;
+base_ctie_thick = 2.5 + 0.5;
+
+tube_ctie_width = 5 + 0.5;
+tube_ctie_thick = 3 + 0.5;
 
 // tuning
 
@@ -31,6 +35,8 @@ tower_base_height = 10;
 tower_forehead_angle = 30;
 lid_wall_thick = 1.6;
 lid_slop = 0.75;
+base_ctie_anchor = 5;
+tube_ctie_anchor = 5;
 
 //--- tests ---
 
@@ -58,7 +64,10 @@ module Tests(){ ////toplevel
 
 //--- real thing ---
 
+// calculated
+
 tower_overhang = led_dia * 2.5;
+tower_width = width_space_inside + tower_wall_thick*2;
 
 tower_over_max_y = tower_overhang * sin(tower_over_angle);
 tower_over_max_z = tower_frontheight + tower_overhang * cos(tower_over_angle);
@@ -68,6 +77,17 @@ led_head_y = tower_over_max_y/2;
 led_head_z = tower_frontheight + tower_overhang*sin(tower_over_angle)/2;
 backfront_mate_extra = (backfront_mate_size - (-tower_rearwall_y));
 
+tower_height_contribution = led_head_z + tower_base_height;
+
+base_ctie_anchor_eff = base_ctie_anchor+base_ctie_thick/2;
+tube_ctie_anchor_eff = tube_ctie_anchor+tube_ctie_thick/2;
+
+base_width = 0.7 * crossbar_dia;
+base_backfront = backfront_mate_extra - tower_rearwall_y;
+base_height = led_tip_height_above_crossbar - tower_height_contribution;
+
+echo(tower_height_contribution, base_height);
+
 module TowerWallCrossSection(){
   // generates a 2D shape - a polygon
   // x is what is going to be -y
@@ -210,9 +230,34 @@ module LidT(){ ////toplevel
   rotate([180,0,0]) Lid();
 }
 
+module Base(){ ////toplevel
+  difference(){
+    mirror([0,0,1]){
+      hull(){
+       translate([-tower_width/2, 0, 0])
+         cube([tower_width, base_backfront, 0.1]);
+       translate([-base_width/2, 0, base_height])
+         cube([base_width, base_backfront, crossbar_dia/2]);
+      }
+    }
+    translate([-50, base_backfront/2, -base_ctie_anchor_eff])
+      cube([100, base_ctie_width, base_ctie_thick], center=true);
+    translate([-50, base_backfront/2, -base_height + tube_ctie_anchor_eff])
+      cube([100, tube_ctie_width, tube_ctie_thick], center=true);
+    translate([0, -1, -(base_height + crossbar_dia/2)])
+      rotate([-90,0,0])
+      cylinder(r=crossbar_dia/2, h=101);
+  }
+}
+
+module BaseT(){ ////toplevel
+  rotate([90,0,0]) Base();
+}
+
 module Demo(){
   Tower();
   translate([0,0, 25]) Lid();
+  translate([0, tower_rearwall_y, -(tower_base_height+5)]) Base();
 }
 
 //TowerCrossSectionDemo();
@@ -222,4 +267,6 @@ module Demo(){
 //LidT();
 //Tower();
 //Lid();
+//Base();
+//BaseT();
 Demo();