From cf1e97643aff2ec1c094b2c948e86affedb13285 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 21 Apr 2025 12:12:35 +0100 Subject: [PATCH] toolbox-inserts: fix z Signed-off-by: Ian Jackson --- toolbox-inserts.scad | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/toolbox-inserts.scad b/toolbox-inserts.scad index 2337d6b..79b7c26 100644 --- a/toolbox-inserts.scad +++ b/toolbox-inserts.scad @@ -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); +} -- 2.30.2