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(){
// 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);
}
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])
cylinder(h=$shellWidth + 15,r=2.5);
cylinder(h=$auxHoleLength,r=$auxHoleRadius);
// TODO: move magnets to somewhere else.
translate([0,0,5])
magnets();
}
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() {
cube([10,$shellWidth,5]);
translate([-5,-$shellWidth + $clearance - 40,0])
cube([20,$shellWidth + 40,5]);
// Create a hole for the usb cable to go through
cube([$usbHoleWidth,$shellWidth,$usbHoleHeight]);
// 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(){
rotate([90,0,0]) {
translate([0,0,-500]){
linear_extrude(99999){
polygon(
[
[0 - $shellWidth/2, -3],
[$switchDistance * 6 + $switchDistance/2,0],
[$switchDistance * 6 + $shellWidth/2, -3]
]
);
}
}
}
$shimPoints = [
[0 - $shellWidth / 2, - $baseHeight],
[$switchDistance * $columns + $shellWidth/2 + $clearance, 0],
[$switchDistance * $columns + $shellWidth/2 + $clearance, - $baseHeight]
];
// Face z/x-plane
rotate([90,0,0])
// 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(){
points = [
@@ -165,8 +181,8 @@ module case(){
offset(r=$clearance) polygon(points);
}
}
translate([0,0,-3])
linear_extrude(3){
translate([0,0,-$baseHeight])
linear_extrude($baseHeight){
offset(r=$shellWidth/2 + $clearance, chamfer=true) polygon(points);
}
}