This commit is contained in:
zhao
2022-11-05 18:47:13 -04:00
parent 5edad72862
commit d81b129686
27 changed files with 535 additions and 20902 deletions

111
cases/rpi/frontPlate.scad Normal file
View File

@ -0,0 +1,111 @@
include <../common.scad>
include <../rack/screws.scad>
include <../sinusoid.scad>
vU = 2;
uHeight = 10;
plateScrewDiffV = uHeight*vU;
plateScrewDiffH = 180;
plateScrewToHEdge = 4.5;
plateScrewToVEdge = 5.5;
frontPlateThickness = 2.5;
frontPlateV = plateScrewDiffV + 2*plateScrewToHEdge;
frontPlateH = plateScrewDiffH + 2*plateScrewToVEdge;
plateScrewToBoxMin = 6;
length = 170;
resolution = 250;
period = PI/6;
shift = 0.0;
amplitudeFunction = function(x) 2;
module _frontPlateBody() {
difference() {
translate(v = [- plateScrewToVEdge, 0, - plateScrewToHEdge])
cube(size = [frontPlateH, frontPlateThickness, frontPlateV]);
}
translate(v=[5,-3,-1])
rotate(a=[180,0,0])
sineWaveHull(length, resolution, amplitudeFunction, period+0.02, 2, 5);
translate(v=[5,-3,4-1])
rotate(a=[180,0,0])
sineWaveHull(length, resolution, amplitudeFunction, period, 2 , 5);
translate(v=[5,-3,8-1])
rotate(a=[180,0,0])
sineWaveHull(length, resolution, amplitudeFunction, period+0.03, 2.5, 5);
translate(v=[5,-3,12-1])
rotate(a=[180,0,0])
sineWaveHull(length, resolution, amplitudeFunction, period+0.1, 3.3, 5);
translate(v=[5,-3,16-1])
rotate(a=[180,0,0])
sineWaveHull(length, resolution, amplitudeFunction, period+0.1, 5, 5);
translate(v=[5,-3,20-1])
rotate(a=[180,0,0])
sineWaveHull(length, resolution, amplitudeFunction, period+0.1, 6, 5);
translate(v=[5,-3,24-1])
rotate(a=[180,0,0])
sineWaveHull(length, resolution, amplitudeFunction, period+0.08, 7, 5);
}
module _plateHole() {
rotate(a=[90,0,0])
cylinder(r=m4RadiusSlacked, h=inf, center=true);
}
module frontPlate() {
difference() {
_frontPlateBody();
union() {
// TODO: introduce helper modules for this pattern
_plateHole();
translate(v=[plateScrewDiffH,0,0])
_plateHole();
translate(v=[0,0,plateScrewDiffV])
_plateHole();
translate(v=[plateScrewDiffH,0,plateScrewDiffV])
_plateHole();
}
}
}
difference() {
difference() {
union() {
rotate(a=[-90,0,0])
frontPlate();
}
// lug holes
union() {
translate(v=[160,-3,-frontPlateThickness])
cube(size=[5.2, 5.2, 3]);
translate(v=[160-91.1,-3,-frontPlateThickness])
cube(size=[5.2, 5.2, 3]);
}
}
for (i=[0:5]) {
translate(v=[5,i*4 - 0.5,-10])
cube(size=[170, 2, 20]);
}
}

BIN
cases/rpi/frontPlate.stl Normal file

Binary file not shown.

View File

@ -1,11 +1,7 @@
/*
TODO this case has many many problems as it currently is. The following
should be addressed before it is printed again:
- not enough space for I/O connectors (the plastic handles have
to go though the IO holes right now and they usually don't fit)
- risers are made of plastic and really easily break
- side perforations for ventilation do not print nicely (probably a printer issue)
- not enough space for sd card
- no locking lid for case
*/
@ -18,14 +14,14 @@ pcbThickness = 1.42;
// [+x, -x, +y, -y]
pcbCaseSpace = [5, 2, 2, 2];
pcbCaseSpace = [5, 2, 5, 2];
pcbRise = 3;
caseWallThickness = 2;
caseBottomThickness = 2;
mountPointDiameter = 2.69;
mountPointDiameter = 5;
mountPoints = [[3.65,23.30,0], [3.65,pcbDimensions[1]-3.65,0], [pcbDimensions[0]-3.65,23.30,0], [pcbDimensions[0]-3.65,pcbDimensions[1]-3.65,0]];
module pcb() {
@ -52,8 +48,11 @@ module pcbCaseBottom_() {
module pcbCaseWithRisers_() {
union() {
translate(v=[0,0,-pcbRise]){
mountPoints_N(pcbRise, mountPointDiameter, mountPointDiameter, 32, false);
mountPoints_N(pcbRise+2, mountPointDiameter/2.5, mountPointDiameter/2.5, 32, false);
difference () {
mountPoints_N(pcbRise, mountPointDiameter/1.5, mountPointDiameter/2, 32, false);
mountPoints_N(pcbRise + 2, 1.95/2 - 0.05, 1.95/2 - 0.05, 32, false);
}
}
pcbCaseBottom_();
}
@ -73,15 +72,12 @@ module cutoutProfileAirflow_N() {
}
}
// back cutouts
for (i=[0:4]) {
translate(v=[i*10 + 7,pcbDimensions[1],4])
// back cutout
translate(v=[5,pcbDimensions[1]+5,-1])
minkowski() {
cube(size=[3,100,10], center=false);
rotate(a=[90,0,0])
cube(size=[50,90,15], center=false);
rotate(a=[90,0,0])
cylinder(h=1,r=2);
}
}
// front cutout
@ -94,13 +90,16 @@ difference() {
union() {
pcbCaseWithRisers_();
// lugs
translate(v=[pcbDimensions[0]+caseWallThickness+pcbCaseSpace[0],-caseWallThickness-pcbCaseSpace[3],-pcbRise-caseBottomThickness])
cube(size=[2,5,5]);
// lugs
// -4
translate(v=[pcbDimensions[0]+caseWallThickness+pcbCaseSpace[0],-caseWallThickness-pcbCaseSpace[3],-pcbRise-caseBottomThickness])
cube(size=[2,5,5]);
translate(v=[pcbDimensions[0]+caseWallThickness+pcbCaseSpace[0],pcbDimensions[1]+pcbCaseSpace[2]-5+caseWallThickness,-pcbRise-caseBottomThickness])
cube(size=[2,5,5]);
// 87.1
translate(v=[pcbDimensions[0]+caseWallThickness+pcbCaseSpace[0],pcbDimensions[1]+pcbCaseSpace[2]-5+caseWallThickness,-pcbRise-caseBottomThickness])
cube(size=[2,5,5]);
// -> 87.1 + 4 = 91.1
}
union() {
@ -128,24 +127,22 @@ module mountPoints_N(cylHeight, cylRad1, cylRad2, cylFn, center) {
}
}
// fucked up
module cutoutProfile_N() {
color([1,0,1])
union() {
// front I/O
mirror(v=[0,1,0])
translate(v=[2, -eps*100, pcbThickness])
cube(size=[52.0 + 0.1, inf50, 16.0 + 0.1]);
translate(v=[1, -eps*100, pcbThickness-4])
cube(size=[58.0 + 0.1, inf50, 18.0 + 0.1]);
// side I/O
translate(v=[-48, (pcbDimensions[1]-54)-5, pcbThickness])
cube(size=[inf50, 54, 8]);
translate(v=[-48-3, (pcbDimensions[1]-54)-10, pcbThickness-4])
cube(size=[inf50, 64, 18]);
}
}
//cutoutProfile_N();
*cutoutProfile_N();
//pcb();

Binary file not shown.

View File

@ -2,17 +2,17 @@
difference() {
union() {
cube(size=[67,93,1]);
translate(v=[2, 2,1])
cube(size=[63,88.8,2]);
cube(size=[67,95.7,1]);
translate(v=[2,2,1])
cube(size=[63,91.7,3]);
}
union() {
translate(v=[3.5, 3.5,1])
cube(size=[60,85,3]);
translate(v=[3.5, 3.8,1])
cube(size=[60,88,3]);
for(i=[0:7]) {
translate(v=[33.5,i*10 + 10,0])
translate(v=[33.5,i*10 + 12,0])
minkowski() {
cylinder(h=1,r=1);
cube(size=[50,5,10], center=true);

Binary file not shown.