Fixed aux and pico

This commit is contained in:
2025-08-23 14:50:24 +02:00
parent 7540ca0285
commit 5b83a62367

View File

@@ -100,44 +100,60 @@ leftTopDampener();
} }
module case(){ module case(){
// TODO: Continue with applying baseHeight on all things belo
// Then adjust the shim, aux and pico. // Then adjust the shim, aux and pico.
// Last add magnets, don't forget the clearance. // Last add magnets, don't forget the clearance.
$baseHeight = 6; $baseHeight = 6;
module magnets(){ module magnets(){
cylinder(h=$magnetHeight + $clearance, r=$magnetWidth + $clearance / 2); cylinder(h=$magnetHeight + $clearance, r=$magnetWidth + $clearance / 2);
} }
module aux(){ module aux(){
translate([-$shellWidth,75,0]) $topToCenterOfAux = 15.4;
$auxHoleRadius = 4;
$auxHoleLength = 17 + $shellWidth/2;
// Move to the position along the wall the aux will be
translate([-($shellWidth/2 + $clearance),$switchDistance * $rows - $topToCenterOfAux,0])
// Make cylinder perpendicular with the wall
rotate([0,90,0]) rotate([0,90,0])
cylinder(h=$shellWidth + 15,r=2.5); cylinder(h=$auxHoleLength,r=$auxHoleRadius);
// TODO: move magnets to somewhere else.
translate([0,0,5]) translate([0,0,5])
magnets(); magnets();
} }
module pico(){ module pico(){
translate([10, $switchDistance * 5, -2]){ $edgeToCenterOfUsb = 23;
$usbHoleWidth = 12;
$usbHoleHeight = 9;
$usbOffsetFromPcb = 2.4;
$picoPcbClearanceFromBase = 3.8;
$picoWidth = 25;
$picoLength = 53;
// Move to position along the wall the usb will be
translate([$edgeToCenterOfUsb - ($usbHoleWidth/2), $switchDistance * $rows, -$usbOffsetFromPcb]){
union() { union() {
cube([10,$shellWidth,5]); // Create a hole for the usb cable to go through
translate([-5,-$shellWidth + $clearance - 40,0]) cube([$usbHoleWidth,$shellWidth,$usbHoleHeight]);
cube([20,$shellWidth + 40,5]); // Move inside the shell
translate([-(($picoWidth - $usbHoleWidth)/2),$clearance - $picoLength, +$usbOffsetFromPcb - $picoPcbClearanceFromBase])
// Make clearance downwards for the pico board
cube([$picoWidth,$picoLength, $picoLength]);
} }
} }
} }
module shim(){ module shim(){
rotate([90,0,0]) { $shimPoints = [
translate([0,0,-500]){ [0 - $shellWidth / 2, - $baseHeight],
linear_extrude(99999){ [$switchDistance * $columns + $shellWidth/2 + $clearance, 0],
polygon( [$switchDistance * $columns + $shellWidth/2 + $clearance, - $baseHeight]
[ ];
[0 - $shellWidth/2, -3], // Face z/x-plane
[$switchDistance * 6 + $switchDistance/2,0], rotate([90,0,0])
[$switchDistance * 6 + $shellWidth/2, -3] // Move in front of model on the y-axis
] translate([0,0,-500])
); // Extrude it through the case
} linear_extrude(99999)
} polygon($shimPoints);
}
} }
module body(){ module body(){
points = [ points = [
@@ -165,8 +181,8 @@ module case(){
offset(r=$clearance) polygon(points); offset(r=$clearance) polygon(points);
} }
} }
translate([0,0,-3]) translate([0,0,-$baseHeight])
linear_extrude(3){ linear_extrude($baseHeight){
offset(r=$shellWidth/2 + $clearance, chamfer=true) polygon(points); offset(r=$shellWidth/2 + $clearance, chamfer=true) polygon(points);
} }
} }