Skip to content

Commit 4052499

Browse files
committed
more
1 parent 775a051 commit 4052499

File tree

2 files changed

+89
-26
lines changed

2 files changed

+89
-26
lines changed

certamenbutton.scad

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// print at 0.20 mm layers, PLA, 25% infill
22
includeBase = 0; // [1:yes, 0:no]
3-
includeMain = 0; // [1:yes, 0:no]
4-
includeScrewTemplate = 1; // [1:yes, 0:no]
3+
includeMain = 1; // [1:yes, 0:no]
4+
includeScrewTemplate = 0; // [1:yes, 0:no]
55
height = 40;
66
innerDiameter = 59.65;
77
label = "C3";
@@ -94,6 +94,16 @@ module portCover() {
9494
polygon([[-cablePortThickness,0],[0,0],[0,-baseThicknessAdj-cableHoleDiameter+cableHoleBottomSquish-2*tolerance-cablePortThickness*2],[-cablePortThickness,-baseThicknessAdj-cableHoleDiameter-cablePortThickness+cableHoleBottomSquish-2*tolerance]]);
9595
}
9696

97+
module arcadeButtonCylinder() {
98+
rotate([0,0,90]) {
99+
translate([0,0,-nudge]) cylinder(h=topThickness+2*nudge+snapThickening, d=holeDiameterMain+2*tolerance);
100+
for (angle=[0:180:180])
101+
rotate([0,0,angle])
102+
translate([0,-snapWidth/2,-nudge])
103+
cube([holeDiameterMain/2+tolerance+snapThickness,snapWidth,2*nudge+topThickness+snapThickening]);
104+
for (angle=[45:90:360-45]) rotate([0,0,angle]) translate([holeDiameterMain/2+tolerance,0,-nudge]) cylinder(d=antiRotation+2*tolerance,h=topThickness+2*nudge,$fn=12);
105+
}
106+
}
97107

98108
module mainCylinder() {
99109
render(convexity=4)
@@ -116,14 +126,7 @@ cube([holeDiameterMain/2+tolerance+snapThickness+2,snapWidth,topThickness+snapTh
116126
for(angle=[0:180:cablePorts==1?0:180]) rotate([0,0,angle]) translate([-outerDiameter/2+wallThickness/2,0,0]) portCover();
117127
}
118128
cable(tolerance);
119-
rotate([0,0,90]) {
120-
translate([0,0,-nudge]) cylinder(h=height, d=holeDiameterMain+2*tolerance);
121-
for (angle=[0:180:180])
122-
rotate([0,0,angle])
123-
translate([0,-snapWidth/2,-nudge])
124-
cube([holeDiameterMain/2+tolerance+snapThickness,snapWidth,2*nudge+topThickness+snapThickening]);
125-
for (angle=[45:90:360-45]) rotate([0,0,angle]) translate([holeDiameterMain/2+tolerance,0,-nudge]) cylinder(d=antiRotation+2*tolerance,h=topThickness+2*nudge,$fn=12);
126-
}
129+
arcadeButtonCylinder();
127130
translate([0,holeDiameterMain/4+(outerDiameter/4-chamfer/2)-.08*labelSize+textPositionAdjustment,textDepth-nudge]) rotate([180,0,0]) linear_extrude(height=textDepth) text(label, font=font, size=labelSize, halign="center", valign="center");
128131
}
129132
}
@@ -151,8 +154,9 @@ module base(template=false) {
151154
}
152155

153156
$fn = 72;
154-
if (includeMain)
155-
mainCylinder();
157+
if (includeMain) {
158+
mainCylinder();
159+
}
156160

157161
if (includeBase)
158162
{

mainbox.scad

Lines changed: 73 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
use <roundedsquare.scad>;
22
use <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;
512
megaWidth = 53.34;
613
megaLength = 101.6;
714
megaPCBThickness = 1.66;
@@ -30,20 +37,48 @@ topSlideWidth = 1.75;
3037

3138
sideWallThickness = 1.25;
3239
bottomThickness = 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

3756
corner = 9;
3857

39-
module dummy() {}
58+
boxHeight = speakerDiameter+underPCBs+2+maxPCBThickness+topThickness+bottomThickness;
4059

4160
nudge = 0.001;
4261
insideWidth = boardDivider+4*fitTolerance+megaWidth+cbWidth;
4362
insideLength = 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

4574
cbX = fitTolerance;
4675
megaX = 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

4883
module 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

73128
mountHeight = underPCBs+maxPCBThickness+topSlideWidth+mountExtra;
@@ -112,21 +167,25 @@ module boardMounts() {
112167
}
113168

114169
module 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

122182
module 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();
130189
bottom();
131190

132191
// todo: screws; front empty, back full

0 commit comments

Comments
 (0)