Printing top left

This commit is contained in:
Thomas Haukland
2024-05-28 21:17:03 +02:00
parent 93e2c46098
commit 733e8b490f
5 changed files with 157 additions and 246 deletions

View File

@@ -12,7 +12,6 @@ step = 0.05;
$fn=50;
mirror()
{
difference() {
@@ -21,8 +20,8 @@ mirror()
// magsafe_ring();
// The exported board from KiCad, for debug
translate([0,0,0])
board();
//translate([0,0,0])
// board();
switches(true);

View File

@@ -16,12 +16,12 @@ $fn=50;
difference()
{
bottom();
translate([13,11,2.1])
magsafe_ring();
//translate([13,11,2.1])
//magsafe_ring();
// The exported board from KiCad, for debug
//translate([0,0,0])
// board();
//board();
switches(false);

View File

@@ -1,158 +0,0 @@
use <hotswap.scad>
// height = 95.1738;
// width = 132.6134;
step = 0.05;
//$fn=30;
// hotswap socket is ~1.75 high at the highest.
// magsafe ring is 0.4 high
// 2.5 will leave 0.35 at the thinnest(between hotswap and magsafe).
height = 2.5;
$fn=30;
// bottom plate
module bottom()
{
color("pink")
translate([0,0,0])
linear_extrude(height)
offset( delta=0)
base();
}
module base()
{
import ("plate.svg", center=true);
}
module board()
{
color("#1f77b4")
translate([0,0,-1])
linear_extrude(1)
rotate([0,180,0])
import("cheapino-brd.svg", center=true);
}
//import("plate_and_holes.svg", center=true);
difference()
{
bottom();
translate([13,11,2.1])
magsafe_ring();
// The exported board from KiCad, for debug
//translate([0,0,0])
// board();
// Columns starting from MCU
translate([19.3,-2.84,0])
column();
translate([0.3,-0.3,0])
column();
translate([-18.7,6.05,0])
column();
translate([-37.7,-0.3,0])
column();
translate([-56.7,-10.308,0])
column();
// Thumb cluster
translate([14.6264,-24.52])
switch();
rotate([0,0,-10])
translate([40.3,-19.3])
switch();
rotate([0,0,-23])
translate([65.65,-7.09])
switch();
// The horizontal diodes
translate([-18, 10.21, 0]) diode();
translate([-28.59, 10.21, 0]) diode();
translate([-26.23, 29.18, 0]) diode();
translate([-9.463,21.97,0]) diode();
translate([0.8, 21.97, 0]) diode();
translate([14.106, 19.872, 0]) diode();
translate([16.138,1.066,0]) diode();
translate([5.888,-19.128,0]) diode();
translate([-5.018, 2.971, 0]) diode();
translate([-37.267,3.555,0]) diode();
translate([-47.627,3.555,0]) diode();
translate([-61.234,12.013,0]) diode();
translate([-61.6,-7.011,0]) diode();
translate([-47.616,22.504,0]) diode();
// The vertical(ish) diodes
translate([10.61, 24.7, 0]) rdiode();
translate([10.585, 7.061, 0]) rdiode();
translate([29.66, 25.106, 0]) rdiode();
translate([28.365, -2.935, 0]) rdiode();
translate([10.585, -13.146, 0]) rdiode();
translate([25.977, -31.18, 0]) rdiode();
translate([46.5, -35.5, 0])
rotate(76)
diode();
// rj 45 stabilizers
rj_hole();
translate([0,-11.43,0]) rj_hole();
// rj 45 housing through holes
translate([3.1,2,0]) rj_hole();
translate([3.1,-13.49,0]) rj_hole();
// rj 45 pins
rj_pin_hole();
translate([0,-2.54,0]) rj_pin_hole();
translate([0, -5.08,0]) rj_pin_hole();
translate([0,-7.62,0]) rj_pin_hole();
translate([0,-10.16,0]) rj_pin_hole();
translate([-2.54,-1.27,0]) rj_pin_hole();
translate([-2.54,-3.81,0]) rj_pin_hole();
translate([-2.54,-6.35,0]) rj_pin_hole();
translate([-2.54,-8.89,0]) rj_pin_hole();
mcu();
encoder();
// Mounting holes
mounting_hole();
translate([-27.432,4.572,0]) mounting_hole();
translate([-18.288,44.704,0]) mounting_hole();
translate([-36.132,25.02,0]) mounting_hole();
translate([-56.183,52.928,0]) mounting_hole();
translate([-75.399,46.599,0]) mounting_hole();
translate([-94.267,36.473,0]) mounting_hole();
translate([-94.241,17.313,0]) mounting_hole();
translate([-3.048,-16.256,0]) mounting_hole();
// Inserts for silicone bumpers
bumper();
translate([0, -46, 0]) bumper();
translate([10.3, -67, 0]) bumper();
translate([-29.5, -61.6, 0]) bumper();
translate([-64, 7.5, 0]) bumper();
translate([-64, -31, 0]) bumper();
translate([-101, -47.7, 0]) bumper();
translate([-101, -9, 0]) bumper();
// Inserts for magnets
translate([24,26,0]) magnet();
translate([24,-18,0]) magnet();
translate([-43,28,0]) magnet();
translate([-43,-9,0]) magnet();
}

View File

@@ -1,91 +1,40 @@
height = 95.1738;
width = 132.6134;
step = 0.05;
$fn=30;
step = 0.06;
$fn=50;
height_translation = 0;
include <modules.scad>
// Height of case is:
// 5.0mm from pcb to switch inset
// 1.6mm pcb height
// 2.5mm bottom plate
//
// for a total of 9.1mm.
//
// The case only adds 0.7mm extra height
// to the keyboard.
color("red")
for (i = [0:step:9.1])
{
factor = 0.0052 * pow(4,i) - 0.1224 * pow(3,i) + 0.7931 * pow(2,i) - 0.9362*i + 0.0004;
translate([0,0,i]) //height_translation])
base_line_extruded(factor, 1);
difference() {
case();
linear_extrude(4.1) offset(delta=0.1) base();
//translate([0,0,4.1])
// board();
translate([0,0,top_of_pcb]) switch_holes();
// Diodes
translate([0, 0, top_of_pcb]) diodes();
// RJ45 socket
color("cyan") {
translate([29.955, -10.3, 4.1])
linear_extrude(10)
square([30, 16]);
translate([45, -5.8, 2.5])
linear_extrude(10)
square([15, 7]);
}
/*
color("green")
translate([0,0,2.5]) //height_translation])
base_line_extruded(2.5, 1.6);
mcu_cutout();
// mounting holes
mounting_hole_inserts();
color("blue")
for (i = [4.1:step:6.6])
{
translate([0,0,i-1]) //height_translation])
base_line_extruded(6.6-i, 1);
}
*/
// Lip to stop pcb + bottom plate
color("yellow")
translate([0,0,1.6])
difference()
{
offset( delta=1)
base();
offset( delta=-1)
base();
}
// Top plate
color("pink")
translate([0,0,8.6])
linear_extrude(1.5)
offset( delta=0.5)
base();
module base_line_extruded (factor, extrusion)
{
linear_extrude(extrusion)
base_line(factor);
}
module base_extended (factor, extrusion)
{
linear_extrude(extrusion)
offset( delta=factor)
base();
}
module base()
{
import ("plate.svg", center=true);
}
module base_line(expanded)
{
difference()
{
offset( delta=expanded+1)
base();
offset( delta=expanded)
base();
}
}

View File

@@ -1,11 +1,15 @@
//$fn=50;
pcb_thickness = 1.6;
bottom_plate_thickness = 2.5;
top_of_pcb = bottom_plate_thickness + pcb_thickness;
// bottom plate
module bottom()
{
color("pink")
translate([0,0,0])
linear_extrude(2.5)
linear_extrude(bottom_plate_thickness)
offset( delta=0)
base();
}
@@ -18,8 +22,8 @@ module base()
module board()
{
color("#1f77b4")
translate([0,0,-1])
linear_extrude(1)
translate([0,0,-1.6])
linear_extrude(1.6)
rotate([0,180,0])
import("cheapino-brd.svg", center=true);
}
@@ -289,4 +293,121 @@ module mounting_holes() {
//color("green")
//translate([0,0,0])
// import("hotswap.stl");
// Height of case is:
// 5.0mm from pcb to switch inset
// 1.6mm pcb height
// 2.5mm bottom plate
//
// for a total of 9.1mm.
//
// The case only adds 0.7mm extra height
// to the keyboard.
module case() {
color("red")
for (i = [0:step:9.1])
{
// factor = sqrt(pow(9.1, 2) - pow(i, 2));
factor = min(3 - abs(i*0.7-3), 2.5);
//echo(pow(i, 2));
//echo(factor);
translate([0,0,i]) //height_translation])
linear_extrude(height=1)
offset( delta=factor + 1 )
base();
//base_extended(factor, 1);
}
}
module switch_holes() {
// Columns starting from mcu
hole_column();
translate([-19, 2.54, 0]) hole_column();
translate([-38, 8.89, 0]) hole_column();
translate([-57, 2.54, 0]) hole_column();
translate([-76, -7.468, 0]) hole_column();
// Thumb cluster
translate([-4.674, -59.69, 0]) switch_hole();
rotate(-10) translate([21, -54.45, 0]) switch_hole();
rotate(-23) translate([46.25, -42.25, 0]) switch_hole();
}
module hole_column() {
switch_hole();
translate([0, -19, 0]) switch_hole();
translate([0, -38, 0]) switch_hole();
}
module switch_hole() {
translate([11.64, 23.45, 0]){
color("green") {
linear_extrude(10) {
square(14);
translate([0.2,0.2,0]) circle(d=1);
translate([13.8,0.2,0]) circle(d=1);
translate([13.8,13.8,0]) circle(d=1);
translate([0.2,13.8,0]) circle(d=1);
}
}
linear_extrude(3.5) {
translate([4.5, -1, 0])
color("yellow") square([5, 1]);
translate([4.5, 14, 0])
color("yellow") square([5, 1]);
}
}
}
module base()
{
import ("plate.svg", center=true);
}
module base_line(expanded)
{
difference()
{
offset( delta=expanded+1)
base();
offset( delta=expanded)
base();
}
}
module mounting_hole_insert() {
color("#bcbd22")
translate([45.85, -23, 0]) {
translate([0,0,4.1])
cylinder(h=4, r=.7);
}
}
module mounting_hole_inserts() {
// Mounting holes
mounting_hole_insert();
translate([-27.432,4.572,0]) mounting_hole_insert();
translate([-18.288,44.704,0]) mounting_hole_insert();
translate([-36.132,25.02,0]) mounting_hole_insert();
translate([-56.183,52.928,0]) mounting_hole_insert();
translate([-75.399,46.599,0]) mounting_hole_insert();
translate([-94.267,36.473,0]) mounting_hole_insert();
translate([-94.241,17.313,0]) mounting_hole_insert();
translate([-3.048,-16.256,0]) mounting_hole_insert();
}
// MCU cutout
module mcu_cutout() {
color("pink") {
translate([29.5, 10.2, 4.1])
linear_extrude(10)
square([19.5, 25]);
// USB C port opening
translate([34.25, 25.2, 4.1])
linear_extrude(10)
square([10, 20]);
}
}