fix board_to_xz_distance
authorClinton Ebadi <clinton@unknownlamer.org>
Sun, 11 Apr 2021 04:52:37 +0000 (00:52 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Sun, 11 Apr 2021 04:52:37 +0000 (00:52 -0400)
Don't apply to y offsets, and enlarge parts as needed on the x axis.

Still a mess of magic numbers and duplicated calculations...

box_frame/doc/complete-printer.scad
box_frame/z-axis.scad

index 4d7a656..71a4494 100644 (file)
@@ -150,12 +150,12 @@ if (frame_type == frame_alu) {
      // 6 = bottom_thickness
      translate([-board_w/2-5,0,board_h - 6/2])
          rotate(-90)
      // 6 = bottom_thickness
      translate([-board_w/2-5,0,board_h - 6/2])
          rotate(-90)
-         zrodholder(thickness=board_thickness * 2 + 5, ylen = board_thickness * 2 + 10, bottom_x=43 + zaxis_delta_x, bottom_thickness=6);
+         zrodholder(thickness=board_thickness * 2 + 5, ylen = board_thickness * 2 + 10, bottom_x=board_to_xz_distance + 17 + zaxis_delta_x, bottom_thickness=6);
 
      translate([board_w/2+5,0,board_h - 6/2])
          rotate(-90)
          mirror([0,1,0])
 
      translate([board_w/2+5,0,board_h - 6/2])
          rotate(-90)
          mirror([0,1,0])
-         zrodholder(thickness=board_thickness * 2 + 5, ylen = board_thickness * 2 + 10, bottom_x=43 + zaxis_delta_x, bottom_thickness=6);
+         zrodholder(thickness=board_thickness * 2 + 5, ylen = board_thickness * 2 + 10, bottom_x=board_to_xz_distance + 17 + zaxis_delta_x, bottom_thickness=6);
 } else {
      // Z motor mounts
      translate([-board_w/2-5,0,42])
 } else {
      // Z motor mounts
      translate([-board_w/2-5,0,42])
@@ -193,7 +193,7 @@ mirror([1,0,0])z_rods();
 // Z leadscrew
 module z_leadscrew()
 {
 // Z leadscrew
 module z_leadscrew()
 {
-     position_y = board_to_xz_distance + zaxis_delta_y + zmotor_delta_y;
+     position_y = 26 + zaxis_delta_y + zmotor_delta_y;
      position_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
        color("Orange")
        // fixme: 55 - 6 is mount thickness - bottom_thickness
      position_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
        color("Orange")
        // fixme: 55 - 6 is mount thickness - bottom_thickness
index f533396..ca011c8 100644 (file)
 include <configuration.scad>
 
 module zmotorholder(thickness=(frame_type == frame_single ? 38 : 23), bottom_thickness=5){
 include <configuration.scad>
 
 module zmotorholder(thickness=(frame_type == frame_single ? 38 : 23), bottom_thickness=5){
-     // fixme: board_to_xz_distance in position_y feels iffy
-    position_y = board_to_xz_distance + zaxis_delta_y + zmotor_delta_y;
+    // fixme: position_y magic number (x-end leadscrew placement has
+    // same issue -- should share some base value + offset for part
+    // being generated)
+    position_y = 26 + zaxis_delta_y + zmotor_delta_y;
     position_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
     difference(){
         union(){
             // Motor holding part
             difference(){
                 union(){
     position_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
     difference(){
         union(){
             // Motor holding part
             difference(){
                 union(){
-                    zrodholder(thickness=thickness, xlen=45 + zmotor_delta_x + zaxis_delta_x, ylen=48 + 5 + zmotor_delta_y + zaxis_delta_y, zdelta=((i_want_to_use_single_plate_dxf_and_make_my_z_weaker == 0) ? 0 : 5), bottom_x = 14 + zaxis_delta_x + zmotor_delta_x, bottom_y = 15 + zmotor_delta_y + zaxis_delta_y, am_top=0, bottom_thickness=bottom_thickness);
+                    zrodholder(thickness=thickness, xlen=board_to_xz_distance+21 + zmotor_delta_x + zaxis_delta_x, ylen=48 + 5 + zmotor_delta_y + zaxis_delta_y, zdelta=((i_want_to_use_single_plate_dxf_and_make_my_z_weaker == 0) ? 0 : 5), bottom_x = board_to_xz_distance-12 + zaxis_delta_x + zmotor_delta_x, bottom_y = 15 + zmotor_delta_y + zaxis_delta_y, am_top=0, bottom_thickness=bottom_thickness);
                     translate([position_x, position_y, 0]) {
                         nema17(places=[0, 1, 1, 1], h=bottom_thickness + layer_height, $fn=23, shadow=false/*layer_height + 2*/);
                     }
                     translate([position_x, position_y, 0]) {
                         nema17(places=[0, 1, 1, 1], h=bottom_thickness + layer_height, $fn=23, shadow=false/*layer_height + 2*/);
                     }
@@ -119,7 +121,11 @@ module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thick
                     }
                    // leadscrew bearing hole is cut from this
                    if (am_top) {
                     }
                    // leadscrew bearing hole is cut from this
                    if (am_top) {
-                        lead_bearing_y = board_to_xz_distance + zaxis_delta_y + zmotor_delta_y;
+                        // fixme: position_y magic number (x-end leadscrew placement has
+                        // same issue -- should share some base value + offset for part
+                        // being generated)
+                        // FIXME: share these values with the subtracted part
+                        lead_bearing_y = 26 + zaxis_delta_y + zmotor_delta_y;
                         lead_bearing_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
                         translate ([lead_bearing_x, lead_bearing_y, -(bearing_608[2] + layer_height * 6 - bottom_thickness)]) cylinder (d = bearing_608[0] + single_wall_width * 6, h = bearing_608[2] + layer_height*6);
                    }
                         lead_bearing_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
                         translate ([lead_bearing_x, lead_bearing_y, -(bearing_608[2] + layer_height * 6 - bottom_thickness)]) cylinder (d = bearing_608[0] + single_wall_width * 6, h = bearing_608[2] + layer_height*6);
                    }
@@ -175,7 +181,11 @@ module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thick
 
                // leadscrew hole
                if (am_top) {
 
                // leadscrew hole
                if (am_top) {
-                    lead_bearing_y = board_to_xz_distance + zaxis_delta_y + zmotor_delta_y;
+                    // fixme: position_y magic number (x-end leadscrew placement has
+                    // same issue -- should share some base value + offset for part
+                    // being generated)
+                    // FIXME: share these values with the solid part
+                    lead_bearing_y = 26 + zaxis_delta_y + zmotor_delta_y;
                     lead_bearing_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
                     translate ([lead_bearing_x, lead_bearing_y, bottom_thickness - bearing_608[2]]) {
                          union () {
                     lead_bearing_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
                     translate ([lead_bearing_x, lead_bearing_y, bottom_thickness - bearing_608[2]]) {
                          union () {
@@ -239,8 +249,8 @@ if (frame_type == frame_alu) {
          translate([0, -60, 0]) zmotorholder(thickness=55, bottom_thickness=6);
          translate([0, 60, 0]) mirror([0, 1, 0]) zmotorholder(thickness=55, bottom_thickness=6);
 
          translate([0, -60, 0]) zmotorholder(thickness=55, bottom_thickness=6);
          translate([0, 60, 0]) mirror([0, 1, 0]) zmotorholder(thickness=55, bottom_thickness=6);
 
-         translate([110 + board_thickness, board_thickness+10, 0])  rotate([0,0,90])  zrodholder(thickness=board_thickness * 2 + 5, ylen = board_thickness * 2 + 10, bottom_x=43 + zaxis_delta_x, bottom_thickness=6);
-         translate([110 + board_thickness, -(board_thickness+10), 0]) rotate([0, 0, -90]) mirror([0, 1, 0]) zrodholder(thickness=board_thickness * 2 + 5, ylen = board_thickness * 2 + 10, bottom_x=43 + zaxis_delta_x, bottom_thickness=6);
+         translate([110 + board_thickness, board_thickness+10, 0])  rotate([0,0,90])  zrodholder(thickness=board_thickness * 2 + 5, ylen = board_thickness * 2 + 10, bottom_x=board_to_xz_distance+17 + zaxis_delta_x, bottom_thickness=6);
+         translate([110 + board_thickness, -(board_thickness+10), 0]) rotate([0, 0, -90]) mirror([0, 1, 0]) zrodholder(thickness=board_thickness * 2 + 5, ylen = board_thickness * 2 + 10, bottom_x=board_to_xz_distance+17 + zaxis_delta_x, bottom_thickness=6);
      }
 }
 else {
      }
 }
 else {