From 7540ca028543a706acd3bcff1682974e8598e318 Mon Sep 17 00:00:00 2001 From: wholteza Date: Sat, 23 Aug 2025 09:59:24 +0200 Subject: [PATCH] Wip case --- rev2/3d-models/top-dampener.scad | 101 +++++++++++++++++-------------- 1 file changed, 57 insertions(+), 44 deletions(-) diff --git a/rev2/3d-models/top-dampener.scad b/rev2/3d-models/top-dampener.scad index 3d53e4b..73ce3f2 100644 --- a/rev2/3d-models/top-dampener.scad +++ b/rev2/3d-models/top-dampener.scad @@ -100,42 +100,32 @@ leftTopDampener(); } module case(){ + // TODO: Continue with applying baseHeight on all things belo + // Then adjust the shim, aux and pico. + // Last add magnets, don't forget the clearance. + $baseHeight = 6; module magnets(){ cylinder(h=$magnetHeight + $clearance, r=$magnetWidth + $clearance / 2); } - points = [ -[0,0], -[0, $switchDistance * $rows], -[$switchDistance * 2, $switchDistance * $rows], -[$switchDistance * 2, $switchDistance * $rows + $fingerStep], -[$switchDistance * 3, $switchDistance * $rows + $fingerStep], -[$switchDistance * 3, $switchDistance * $rows], -[$switchDistance * 4, $switchDistance * $rows], -[$switchDistance * 4, $switchDistance * $rows - $fingerStep], -[$switchDistance * 6, $switchDistance * $rows - $fingerStep], -[$switchDistance * 6, 0 - $fingerStep], -[$switchDistance * 4, 0 - $fingerStep], -[$switchDistance * 4, 0], -[$switchDistance * 3, 0], -[$switchDistance * 3, 0 + $fingerStep], -[$switchDistance * 2, 0 + $fingerStep], -[$switchDistance * 2, 0], -]; -difference(){ -union() { - linear_extrude($shellHeight){ - difference(){ - offset(r=$shellWidth/2 + $clearance, chamfer=true) polygon(points); - offset(r=$clearance) polygon(points); + module aux(){ + translate([-$shellWidth,75,0]) + rotate([0,90,0]) + cylinder(h=$shellWidth + 15,r=2.5); + translate([0,0,5]) + magnets(); + } + module pico(){ + translate([10, $switchDistance * 5, -2]){ + union() { + cube([10,$shellWidth,5]); + translate([-5,-$shellWidth + $clearance - 40,0]) + cube([20,$shellWidth + 40,5]); + + } } } - translate([0,0,-3]){ - linear_extrude(3){ - offset(r=$shellWidth/2 + $clearance, chamfer=true) polygon(points); - } -} -} - rotate([90,0,0]) { + module shim(){ + rotate([90,0,0]) { translate([0,0,-500]){ linear_extrude(99999){ polygon( @@ -148,23 +138,46 @@ union() { } } } - // usb - translate([10, $switchDistance * 5, -2]){ + } + module body(){ + points = [ + [0,0], + [0, $switchDistance * $rows], + [$switchDistance * 2, $switchDistance * $rows], + [$switchDistance * 2, $switchDistance * $rows + $fingerStep], + [$switchDistance * 3, $switchDistance * $rows + $fingerStep], + [$switchDistance * 3, $switchDistance * $rows], + [$switchDistance * 4, $switchDistance * $rows], + [$switchDistance * 4, $switchDistance * $rows - $fingerStep], + [$switchDistance * 6, $switchDistance * $rows - $fingerStep], + [$switchDistance * 6, 0 - $fingerStep], + [$switchDistance * 4, 0 - $fingerStep], + [$switchDistance * 4, 0], + [$switchDistance * 3, 0], + [$switchDistance * 3, 0 + $fingerStep], + [$switchDistance * 2, 0 + $fingerStep], + [$switchDistance * 2, 0], + ]; union() { - cube([10,$shellWidth,5]); - translate([-5,-$shellWidth + $clearance - 40,0]) - cube([20,$shellWidth + 40,5]); - + linear_extrude($shellHeight){ + difference(){ + offset(r=$shellWidth/2 + $clearance, chamfer=true) polygon(points); + offset(r=$clearance) polygon(points); + } + } + translate([0,0,-3]) + linear_extrude(3){ + offset(r=$shellWidth/2 + $clearance, chamfer=true) polygon(points); + } } } - // aux - translate([-$shellWidth,75,0]) - rotate([0,90,0]) - cylinder(h=$shellWidth + 15,r=2.5); - translate([0,0,5]) - magnets(); -} + difference(){ + body(); + shim(); + pico(); + aux(); + } } //topDampeners();