chiark / gitweb /
toolbox-inserts: fix z
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 21 Apr 2025 11:12:35 +0000 (12:12 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 21 Apr 2025 11:12:35 +0000 (12:12 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
toolbox-inserts.scad

index 2337d6b2a3eca50eef3de4c0d519e923b95720cf..79b7c263d4584b6fa29201361e6decda26f7983e 100644 (file)
@@ -61,11 +61,10 @@ module AtFixingPositions(screws) {
 //     SomethingPositive();
 // }
 //
-// SomethingPositive must extend in z
-//     from -half_height to at least 0, and probably to half_height
-// IOW its z==0 must be where the top of the wall is,
-// and half_height is the depth of the well below that.
+// SomethingPositive is the representation of the object to be retained
+// Retaining walls will be made up to its z=0.
 module WellSurround(
+  // Amount by which the object protrudes above z==0
   half_height,
   // gaps for picking up object, [ [ x_min, x_max ], ... ]
   gaps,
@@ -78,13 +77,15 @@ module WellSurround(
   wall=well_surround_wall
 ) {
 
+  dz = box_main_z - below_plane_z - half_height;
+
   render() difference(){
 //    minkowski(){
 //      WallMinkowskiSphere(wall);
 
     difference(){
       union(){
-       translate(concat(offset, [0])) linextr(-10, half_height){
+       translate(concat(offset, [0])) linextr(-10, dz){
          offset($fn=8, r = wall)
            projection(cut=false)
            children(0);
@@ -106,7 +107,7 @@ module WellSurround(
 
 //     minkowski(){
 //       WallMinkowskiSphere(wall);
-      translate(concat(offset, [0])) translate([0, 0, half_height]) {
+      translate(concat(offset, [0])) translate([0, 0, dz]) {
        children(0);
       }
 //     }
@@ -178,3 +179,16 @@ module OverallDemo() { ////toplevel
   color("grey") BoxBottomModel();
   color("red") OdAt(-5,-5) DriverHandleHolder();
 }
+
+module OverallDemoLidded() { ////toplevel
+  OverallDemo();
+
+  %translate([0,0, box_main_z - below_plane_z*2])
+     rotate([180,0,0])
+     BoxBottomModel();
+
+  color("yellow")
+    translate([-box_x/2 - 5, 0, -below_plane_z])
+    linextr(0, box_main_z)
+    circle(r=3, $fn=3);
+}