chiark / gitweb /
toolbox-inserts: rails wip reorg
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 May 2025 21:54:58 +0000 (22:54 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 May 2025 23:11:51 +0000 (00:11 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
toolbox-inserts.scad

index df5312d26413baa437ca7ce7957fad9839e817e4..f3f6461310dbaa37ba9b08475603d07894edde2d 100644 (file)
@@ -228,13 +228,17 @@ module RailMountPositiveElevation() {
     ellipse([ rail_mount_mid_nom_r_w, rail_mount_mid_depth ]/2);
 }
 
-// x origin is LHS of box
+// origin is LHS of box, y is along the rail (ie, x in the rest of the model)
+module RailSpaceNegative(length) {
+  translate([ 0, rail_mount_back_brace,0 ]) {
+    linextr_y_xz(rail_mount_tongue_len, length)
+      RailSpaceCutoutElevation();
+  }
+}
 module RailMountNegative(length) {
   translate([ 0, rail_mount_back_brace,0 ]) {
     linextr_y_xz(0, rail_mount_tongue_len + 1)
       RailMountCutoutElevation();
-    linextr_y_xz(rail_mount_tongue_len, length)
-      RailSpaceCutoutElevation();
   }
 }
 module RailMountPositive() {
@@ -244,8 +248,16 @@ module RailMountPositive() {
   }
 }
 
-//---------- plates and the fixing holes ----------
+module AtRails() {
+  for (mx = [0,1])
+    for (y = rail_y)
+      mirror([mx, 0, 0])
+       translate([-box_x/2, y, 0])
+       rotate([0, 0, -90])
+       children();
+}
 
+//---------- plates and the fixing holes ----------
 
 module FullPlate(right) { ////toplevel
   render() union() {
@@ -255,12 +267,8 @@ module FullPlate(right) { ////toplevel
        linextr(-20, 0) square(1000, center=true);
       }
 
-      for (mx = [0,1]) for (y = rail_y) {
-       mirror([mx, 0, 0])
-         translate([-box_x/2, y, 0])
-         rotate([0, 0, -90])
-         RailMountNegative(box_x/2);
-      }
+      AtRails() RailSpaceNegative(box_x/2);
+      AtRails() RailMountNegative(box_x/2);
 
       AtPlateFixings() render() {
        linextr(-20, fixing_head_top_z)
@@ -400,6 +408,7 @@ module RailMountTest(){ ////toplevel
     linextr_y_xz(0, 30)
       rectfromto([-15, -below_plane_z ],
                 [+15,  0             ]);
+    RailSpaceNegative(30);
     RailMountNegative(30);
   }
   RailMountPositive();