scad bottom plate wip

This commit is contained in:
Thomas Haukland
2024-05-18 23:10:57 +02:00
parent e25a6cba09
commit 3e60b1ece4
4 changed files with 5094 additions and 0 deletions

108
case/cheapino-bottom.scad Normal file
View File

@@ -0,0 +1,108 @@
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()
{
linear_extrude(1)
rotate([0,180,0])
import("cheapino-brd.svg", center=true);
}
//import("plate_and_holes.svg", center=true);
//difference()
//{
// bottom();
//v translate([13,11,-0.4])
// 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 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([-18,10.21,0]) diode();
/*
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
translate([-18,10.21,0]) diode();
*/
//}
// circle(55.3);

4812
case/cheapino-brd.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 128 KiB

81
case/cheapino-top.scad Normal file
View File

@@ -0,0 +1,81 @@
height = 95.1738;
width = 132.6134;
step = 0.05;
$fn=30;
height_translation = 0;
// Height of case is 5mm from pcb to switch inset,
// plus 1.6mm pcb height, for a total of 6.6mm
color("red")
for (i = [0.2:step:2.5])
{
translate([0,0,i]) //height_translation])
base_line_extruded(i, 1);
}
color("green")
translate([0,0,2.5]) //height_translation])
base_line_extruded(2.5, 1.6);
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
color("yellow")
translate([0,0,1.6])
difference()
{
offset( delta=1)
base();
offset( delta=-1)
base();
}
// Top plate
color("pink")
translate([0,0,5.1])
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();
}
}

93
case/hotswap.scad Normal file
View File

@@ -0,0 +1,93 @@
//$fn=50;
module hotswap_mx() {
thickness=1.85;
// Holes
translate([3.175,2.2,0])
linear_extrude(height=3.05)
circle(d=3);
translate([-3.175,-0.36,0])
linear_extrude(height=3.05)
circle(d=3);
// Body
linear_extrude(height=thickness)
square([11.1,4.2], center=true);
translate([0,1.9,0])
linear_extrude(height=thickness)
square([5.65, 2.09]);
// Metal soldering parts
translate([5.45,1.04,0])
linear_extrude(height=thickness)
square([2.5, 2.55]);
translate([-7.95,-1.7,0])
linear_extrude(height=thickness)
square([2.5, 2.55]);
}
module column() {
switch();
translate([0, 19, 0]) switch();
translate([0, 38, 0]) switch();
}
module switch() {
// hotswap socket
color("yellow")
translate([0,0,1.85])
rotate([180,0,0])
hotswap_mx();
// main pin of switch
// 4mm d, 2.8mm high, 1.6mm pcb
// means 1.2 of it sticks below, 1.3 for margin
color("teal")
translate([-0.57, -4.7, 0])
linear_extrude(height=1.3)
circle(d=4.2);
// The two switch alignment pins
// Could not find specs for these, assuming max 3.3=1.7 below
color("brown")
translate([-5.74, -4.7, 0])
linear_extrude(height=1.7)
circle(d=1.8);
color("brown")
translate([4.45, -4.7, 0])
linear_extrude(height=1.7)
circle(d=1.8);
}
module diode() {
color("blue")
linear_extrude(height=1.65)
square([9.5, 1.6]);
}
module magsafe_ring()
{
linear_extrude(height=0.5)
difference() {
circle(d=55.3);
circle(d=50.2);
}
}
/*
hotswap_mx();
color("green")
translate([0,0,0])
import("hotswap.stl");
*/