11use < roundedsquare.scad> ;
22use < tubemesh.scad> ;
3+ use < certamenbutton.scad> ;
34
4- includeBoards = true ;
5+ // TODO:
6+ // speaker rails
7+ // cut up
8+ // screw wells for screen
9+ // screw wells for joining halves
10+
11+ includeBoards = false ;
512megaWidth = 53.34 ;
613megaLength = 101.6 ;
714megaPCBThickness = 1.66 ;
@@ -30,20 +37,48 @@ topSlideWidth = 1.75;
3037
3138sideWallThickness = 1.25 ;
3239bottomThickness = 1.5 ;
33- topThickness = 1.5 ;
34-
35- boxHeight = 40 ; // TODO
40+ topThickness = 3.2 ; // match Certamen button
41+
42+ screenScrewHorizontalSpacing = 74.8 ;
43+ screenScrewVerticalSpacing = 31.2 ;
44+ screenWidth = 71.21 ;
45+ screenHeight = 24.04 ;
46+ // make sure screendepth fits well
47+
48+ screenScrewWellDepth = 7.97 ;
49+ speakerDiameter = 39.2 ;
50+ speakerMountYStickout = 1.86 ;
51+ speakerMountXStickout = 5 ;
52+ speakerMountThickness = 1.5 ;
53+ grilleSolidWidth = 2 ;
54+ grilleHoleWidth = 2.5 ;
3655
3756corner = 9 ;
3857
39- module dummy() {}
58+ boxHeight = speakerDiameter + underPCBs + 2 + maxPCBThickness + topThickness + bottomThickness;
4059
4160nudge = 0.001 ;
4261insideWidth = boardDivider+ 4 * fitTolerance+ megaWidth+ cbWidth;
4362insideLength = max (megaLength,cbLength) + 2 * fitTolerance;
63+ boxWidth = insideWidth+ 2 * corner+ 2 * sideWallThickness;
64+ boxLength = insideLength+ 2 * sideWallThickness;
65+
66+ screenX = insideWidth/4 ;
67+ screenY = insideLength/2 ;
68+ clearX = 0.75 * insideWidth;
69+ clearY = insideLength/4 ;
70+ modeDiameter = 5.8 ;
71+ modeX = 0.75 * insideWidth;
72+ modeY = 0.75 * insideLength;
4473
4574cbX = fitTolerance;
4675megaX = 3 * fitTolerance+ cbWidth+ boardDivider;
76+ topZ = boxHeight- topThickness- bottomThickness;
77+ speakerDiameter1 = speakerDiameter + 2 * fitTolerance;
78+
79+ speakerY = 0.5 * insideLength;
80+ speakerX = boxWidth- corner- 2 * sideWallThickness;
81+ speakerZ = (topZ + maxPCBThickness+ underPCBs)/2 ;
4782
4883module cutouts(cutouts, length, extra) {
4984 for (c= cutouts) {
@@ -55,7 +90,17 @@ module cutouts(cutouts, length, extra) {
5590 }
5691}
5792
58- module boards(visualize=true) {
93+ module speakerGrille() {
94+ r = speakerDiameter/2 - speakerMountYStickout;
95+ for (y= [- r:grilleSolidWidth+ grilleHoleWidth:r]) {
96+ y1 = y+ grilleHoleWidth/2 ;
97+ h = sqrt (r* r- y1* y1);
98+ translate ([0 , y, - h])
99+ cube ([sideWallThickness+ 2 * nudge, grilleHoleWidth, 2 * h]);
100+ }
101+ }
102+
103+ module contents(visualize=true) {
59104 cutoutLength = visualize?10 :100 ;
60105 extraCutout = visualize?0 :cutoutTolerance;
61106 color ("blue" ) {
@@ -68,6 +113,16 @@ module boards(visualize=true) {
68113 translate ([cbX,fitTolerance+ nudge- cutoutLength,underPCBs- nudge]) cutouts(cbFrontCutouts, cutoutLength,extraCutout);
69114 translate ([cbX,fitTolerance+ cbLength- nudge,underPCBs- nudge]) cutouts(cbBackCutouts, cutoutLength,extraCutout);
70115 }
116+ color ([0 ,.4 ,0 ]) {
117+ translate ([screenX- screenHeight/2 - extraCutout,screenY- screenWidth/2 - extraCutout,topZ- 1 ]) cube ([screenHeight+ 2 * extraCutout,screenWidth+ 2 * extraCutout,cutoutLength]);
118+ }
119+ color ([0 ,.8 ,0 ])
120+ translate ([clearX,clearY,topZ- nudge]) arcadeButtonCylinder();
121+ color ([0 ,0 ,0.5 ])
122+ translate ([modeX,modeY,topZ- nudge]) cylinder (d= modeDiameter+ 2 * extraCutout,h= topThickness+ 1 );
123+ if (! visualize) {
124+ translate ([speakerX,speakerY- nudge,speakerZ]) speakerGrille();
125+ }
71126}
72127
73128mountHeight = underPCBs+ maxPCBThickness+ topSlideWidth+ mountExtra;
@@ -112,21 +167,25 @@ module boardMounts() {
112167}
113168
114169module box(height=boxHeight,inset=0) {
115- linear_extrude(height= height) translate ([- corner- sideWallThickness+ inset,- sideWallThickness+ inset]) roundedSquare([insideWidth + 2 * corner + 2 * sideWallThickness - 2 * inset, insideLength + 2 * sideWallThickness - 2 * inset], radius= corner- inset);
170+ linear_extrude(height= height) translate ([- corner- sideWallThickness+ inset,- sideWallThickness+ inset]) roundedSquare([boxWidth - 2 * inset, boxLength - 2 * inset], radius= corner- inset);
116171}
117172
118- module bottomWall() {
119- translate ([0 ,0 ,- bottomThickness]) box(height= bottomThickness+ nudge,inset= 0 );
173+ module shell() {
174+ render (convexity= 6 )
175+ difference () {
176+ translate ([0 ,0 ,- bottomThickness]) box();
177+ box(height= boxHeight- bottomThickness- topThickness,inset= sideWallThickness);
178+ contents(visualize= false );
179+ }
120180}
121181
122182module bottom() {
123- translate ([0 ,0 ,bottomThickness]) {
124- boardMounts();
125- bottomWall();
126- if (includeBoards) boards(visualize= true );
127- }
183+ boardMounts();
184+ % shell();
185+ if (includeBoards) contents(visualize= true );
128186}
129187
188+ % shell();
130189bottom();
131190
132191// todo: screws; front empty, back full
0 commit comments