609 lines
16 KiB
OpenSCAD
609 lines
16 KiB
OpenSCAD
// Enable/Disable parts of the composite model
|
|
showBoundBox = false;
|
|
showBluRay = false;
|
|
showBluRayLid = false;
|
|
showHddDrawer = false;
|
|
showCubby = false;
|
|
showRightDrawer = true;
|
|
showLetterShelf = false;
|
|
showShell1 = false;
|
|
showShell2Top = false;
|
|
showShell2Bot = false;
|
|
|
|
epsilon = 0.01;
|
|
|
|
maxAvailWidth = 303.43; // width will be on X
|
|
maxAvailDepth = 225.63; // depth will be on Y
|
|
maxAvailHeigth = 104; // height will be on Z
|
|
wall = 2;
|
|
outerWall = 3;
|
|
slideGap = 1;
|
|
lapDepth = 20;
|
|
|
|
fullWidth = 300;
|
|
fullDepth = 225;
|
|
fullHeight = 96;
|
|
|
|
// full-size base and walls
|
|
if (showBoundBox) {
|
|
translate([0, 0, -(wall + outerWall)])
|
|
color("DimGray")
|
|
cube([fullWidth, fullDepth, outerWall]);
|
|
|
|
translate([0, fullDepth + (wall + outerWall), 0])
|
|
color("DimGray")
|
|
cube([fullWidth, outerWall, fullHeight]);
|
|
|
|
translate([-(wall + outerWall), 0, 0])
|
|
color("DimGray")
|
|
cube([outerWall, fullDepth, fullHeight]);
|
|
}
|
|
|
|
// ===========================================================================
|
|
// Blu-Ray Drive holder
|
|
// ===========================================================================
|
|
bluRayWidth = 140;
|
|
bluRayDepth = 151;
|
|
bluRayHeight = 20;
|
|
bluRaySidedoor = 5;
|
|
bluRayBackWindow = bluRayWidth - 100;
|
|
|
|
// test fit pieces
|
|
/*
|
|
|
|
// Lap joint
|
|
translate([0, 30, 0])
|
|
difference() {
|
|
color("SeaGreen") union() {
|
|
cube([20, 20, wall]);
|
|
cube([wall, 20, 20]);
|
|
}
|
|
|
|
translate([wall-epsilon, -epsilon, -epsilon])
|
|
cube([20 + 2*epsilon - wall, lapDepth/2 + 2*epsilon, wall/2 + 2*epsilon]);
|
|
|
|
translate([wall/2 + epsilon, -epsilon, -epsilon])
|
|
cube([wall/2 + 2*epsilon, lapDepth/2 + 2*epsilon, 20 + 2*epsilon]);
|
|
}
|
|
|
|
difference() {
|
|
color("SandyBrown") union() {
|
|
cube([20, 20, wall]);
|
|
cube([wall, 20, 20]);
|
|
}
|
|
|
|
translate([0, 10, 0]) union() {
|
|
translate([-epsilon, -epsilon, wall/2])
|
|
cube([20 + 2*epsilon, lapDepth/2 + 2*epsilon, wall/2 + 2*epsilon]);
|
|
|
|
translate([-epsilon, -epsilon, -epsilon])
|
|
cube([wall/2 + 2*epsilon, lapDepth/2 + 2*epsilon, 20 + 2*epsilon]);
|
|
}
|
|
}
|
|
|
|
// Bluray width
|
|
color("Pink") union() {
|
|
cube([ bluRayWidth + 2*wall, 4*wall, wall]);
|
|
cube([wall, 4*wall, 4*wall]);
|
|
translate([bluRayWidth + wall, 0, 0, ]) cube([wall, 4*wall, 4*wall]);
|
|
}
|
|
|
|
// Bluray depth
|
|
color("Salmon") translate([0, 5*wall, 0]) union() {
|
|
cube([ bluRayDepth + 2*wall, 4*wall, wall]);
|
|
cube([wall, 4*wall, 4*wall]);
|
|
translate([bluRayDepth + wall, 0, 0, ]) cube([wall, 4*wall, 4*wall]);
|
|
}
|
|
|
|
// Bluray height
|
|
color("MistyRose") translate([0, 10*wall, 0]) union() {
|
|
cube([ bluRayHeight + 2*wall, 4*wall, wall]);
|
|
cube([wall, 4*wall, 4*wall]);
|
|
translate([bluRayHeight + wall, 0, 0, ]) cube([wall, 4*wall, 4*wall]);
|
|
}
|
|
*/
|
|
|
|
translate([fullWidth - (outerWall + 4*wall + bluRayWidth + slideGap), wall, 0])
|
|
union() {
|
|
// Blu-Ray box
|
|
if (showBluRay) {
|
|
color("DodgerBlue")
|
|
difference() {
|
|
union() {
|
|
cube([ // floor
|
|
bluRayWidth + 2*wall,
|
|
bluRayDepth + 2*wall,
|
|
outerWall]);
|
|
|
|
translate([0, bluRayDepth + wall, 0])
|
|
cube([ // +y wall
|
|
bluRayWidth + 2*wall,
|
|
wall,
|
|
bluRayHeight + outerWall]);
|
|
|
|
cube([ // -x wall
|
|
wall,
|
|
bluRayDepth + 2*wall,
|
|
bluRayHeight + outerWall]);
|
|
|
|
translate([bluRayWidth + wall, 0, 0])
|
|
cube([ // +x wall
|
|
wall,
|
|
bluRayDepth + 2*wall,
|
|
bluRayHeight + outerWall]);
|
|
|
|
cube([ // -y front sidedoor 1
|
|
bluRaySidedoor + wall,
|
|
wall,
|
|
bluRayHeight + outerWall]);
|
|
|
|
translate([bluRayWidth + wall - bluRaySidedoor, 0, 0])
|
|
cube([ // -y sidedoor 2
|
|
bluRaySidedoor + wall,
|
|
wall,
|
|
bluRayHeight + outerWall]);
|
|
|
|
translate([bluRayWidth - 3, wall - 0.5, 0])
|
|
rotate([0, 0, -15])
|
|
cube([0.4, 20, bluRayHeight + outerWall]);
|
|
|
|
translate([6.6, wall - 0.5, 0])
|
|
rotate([0, 0, 15])
|
|
cube([0.4, 20, bluRayHeight + outerWall]);
|
|
}
|
|
|
|
translate([80, bluRayDepth + wall - epsilon, outerWall])
|
|
cube([ // +y window cutout
|
|
bluRayBackWindow,
|
|
wall + 2*epsilon,
|
|
bluRayHeight + epsilon]);
|
|
}
|
|
}
|
|
|
|
// Blu-Ray lid
|
|
if (showBluRayLid) {
|
|
color("CornflowerBlue")
|
|
translate([-wall, -wall, bluRayHeight + outerWall])
|
|
// translate([0, -20, 0]) // for printing
|
|
// rotate([180, 0, 0])
|
|
union() {
|
|
cube([ // ceiling
|
|
bluRayWidth + 4*wall,
|
|
bluRayDepth + 4*wall,
|
|
wall]);
|
|
|
|
translate([0, 0, -wall])
|
|
cube([ // -x lip
|
|
wall - 0.2,
|
|
bluRayDepth + 4*wall,
|
|
2*wall]);
|
|
|
|
translate([bluRayWidth + 3*wall + 0.2, 0, -wall])
|
|
cube([ // +x lip
|
|
wall - 0.2,
|
|
bluRayDepth + 4*wall,
|
|
2*wall]);
|
|
|
|
translate([0, 0, -wall])
|
|
cube([ // -y lip
|
|
bluRayWidth + 4*wall,
|
|
wall - 0.2,
|
|
2*wall]);
|
|
|
|
translate([0, bluRayDepth + 3*wall + 0.2, -wall])
|
|
cube([ // +y lip
|
|
bluRayWidth + 4*wall,
|
|
wall - 0.2,
|
|
2*wall]);
|
|
}
|
|
}
|
|
}
|
|
|
|
// ===========================================================================
|
|
// HDD Drawer + Cubby
|
|
// ===========================================================================
|
|
hddMinDepth = 110;
|
|
hddMinHeight = 80;
|
|
hddDepth = 134;
|
|
hddHeight = 84;
|
|
hddLargeWidth = 22;
|
|
hddSmallWidth = 12;
|
|
|
|
ccDepth = 88;
|
|
ccWidth = 56;
|
|
fingerWidth = 24;
|
|
|
|
module hddSlot(width) {
|
|
cube([ // floor
|
|
width + 2*wall,
|
|
hddDepth + wall,
|
|
wall]);
|
|
|
|
translate([width + wall, hddDepth*0.25, 0])
|
|
cube([ // +x wall
|
|
wall,
|
|
hddDepth*0.75 + wall,
|
|
hddHeight/2 + wall]);
|
|
|
|
translate([0, hddDepth*0.25, 0])
|
|
cube([ // -x wall
|
|
wall,
|
|
hddDepth*0.75 + wall,
|
|
hddHeight/2 + wall]);
|
|
|
|
translate([0, hddDepth, 0])
|
|
cube([ // +y wall
|
|
width + 2*wall,
|
|
wall,
|
|
hddHeight/2 + wall]);
|
|
}
|
|
|
|
cubbyFullWidth = 2*(hddLargeWidth + wall) + 6*(hddSmallWidth + wall) + wall;
|
|
translate([outerWall + slideGap, 0, outerWall + slideGap])
|
|
union() {
|
|
|
|
// HDD Slots
|
|
if (showHddDrawer) {
|
|
translate([0, fullDepth - (hddDepth + wall + outerWall + slideGap),0])
|
|
difference() {
|
|
color("IndianRed")
|
|
union() {
|
|
for (i = [0:5]) {
|
|
translate([(hddSmallWidth + wall)*i, 0, 0])
|
|
hddSlot(hddSmallWidth);
|
|
}
|
|
|
|
for (i = [0:1]) {
|
|
translate([(hddLargeWidth + wall)*i + 6*(hddSmallWidth + wall), 0, 0])
|
|
hddSlot(hddLargeWidth);
|
|
}
|
|
|
|
// +y wall
|
|
translate([0, hddDepth, 0])
|
|
cube([cubbyFullWidth, wall, hddHeight]);
|
|
|
|
// -x wall
|
|
cube([wall, hddDepth, hddHeight]);
|
|
|
|
// +x wall
|
|
translate([cubbyFullWidth - wall, 0, ])
|
|
cube([wall, hddDepth, hddHeight]);
|
|
|
|
// floor toungue for assembly
|
|
translate([0, (wall-lapDepth)/2, 0])
|
|
cube([ cubbyFullWidth, lapDepth, wall/2 ]);
|
|
|
|
// -x wall toungue
|
|
translate([wall/2, -lapDepth/2 + wall/2, 0])
|
|
cube([wall/2, lapDepth, hddHeight]);
|
|
|
|
// +x wall toungue
|
|
translate([cubbyFullWidth - wall, -lapDepth/2 + wall/2, 0])
|
|
cube([wall/2, lapDepth, hddHeight]);
|
|
}
|
|
|
|
// floor toungue cut-out
|
|
translate([-epsilon, (wall-lapDepth)/2 - epsilon, wall/2 - epsilon])
|
|
cube([cubbyFullWidth + 2*epsilon, lapDepth + 2*epsilon, wall/2 + 2*epsilon]);
|
|
|
|
// -x wall toungue cutout
|
|
translate([-epsilon, -lapDepth/2 - epsilon + wall/2, -epsilon])
|
|
cube([wall/2 + 2*epsilon, lapDepth + 2*epsilon, hddHeight + 2*epsilon]);
|
|
|
|
// +x wall toungue cutout
|
|
translate([cubbyFullWidth - (wall/2 + epsilon), -lapDepth/2 - epsilon + wall/2, -epsilon])
|
|
cube([wall/2 + 2*epsilon, lapDepth + 2*epsilon, hddHeight + 2*epsilon]);
|
|
}
|
|
|
|
}
|
|
|
|
// Cubby drawer
|
|
if (showCubby) {
|
|
color("FireBrick")
|
|
difference() {
|
|
union() {
|
|
cube([ // base
|
|
cubbyFullWidth,
|
|
fullDepth - (hddDepth + outerWall + wall + slideGap),
|
|
wall]);
|
|
|
|
cube([ // -x wall
|
|
wall,
|
|
fullDepth - (hddDepth + outerWall + wall + slideGap),
|
|
hddHeight]);
|
|
|
|
translate([cubbyFullWidth - wall, 0, 0])
|
|
cube([ // +x wall
|
|
wall,
|
|
fullDepth - (hddDepth + outerWall + wall + slideGap),
|
|
hddHeight]);
|
|
|
|
cube([ // -y wall
|
|
cubbyFullWidth,
|
|
wall,
|
|
hddHeight]);
|
|
|
|
translate([
|
|
(cubbyFullWidth - ccDepth - 2*wall)/2,
|
|
(fullDepth - (hddDepth + outerWall + 3*wall + slideGap + ccWidth)),
|
|
0])
|
|
difference() {
|
|
// cc well walls
|
|
union() {
|
|
cube([ // -y wall
|
|
ccDepth + 2*wall,
|
|
wall,
|
|
hddHeight/2]);
|
|
|
|
translate([0, ccWidth + wall, 0])
|
|
cube([ // +y wall
|
|
ccDepth + 2*wall,
|
|
wall,
|
|
hddHeight/2]);
|
|
|
|
cube([ // -x wall
|
|
wall,
|
|
ccWidth + 2*wall,
|
|
hddHeight/2]);
|
|
|
|
translate([ccDepth + wall, 0, 0])
|
|
cube([ // +x wall
|
|
wall,
|
|
ccWidth + 2*wall,
|
|
hddHeight/2]);
|
|
}
|
|
|
|
// finger cut-out for picking up credit cards
|
|
union() {
|
|
translate([ccDepth/2 + wall, ccWidth + 2*wall + epsilon, fingerWidth/2 + wall])
|
|
rotate([90, 0, 0])
|
|
cylinder(h=ccWidth + 2*wall + 2*epsilon, r=fingerWidth/2);
|
|
|
|
translate([ccDepth/2 - fingerWidth/2 + wall, -epsilon, fingerWidth/2 + epsilon])
|
|
cube([
|
|
fingerWidth,
|
|
ccWidth + 2*wall + 2*epsilon,
|
|
hddHeight/2 - fingerWidth/2]);
|
|
}
|
|
}
|
|
|
|
// floor toungue for assembly
|
|
translate([0, fullDepth - (hddDepth + outerWall + wall + lapDepth/2), wall/2])
|
|
cube([cubbyFullWidth, lapDepth, wall/2 ]);
|
|
|
|
// -w wall toungue
|
|
translate([0, fullDepth - (hddDepth + outerWall + wall + lapDepth/2), 0])
|
|
cube([wall/2, lapDepth, hddHeight]);
|
|
|
|
// +w wall toungue
|
|
translate([cubbyFullWidth - wall/2, fullDepth - (hddDepth + outerWall + wall + lapDepth/2), 0])
|
|
cube([wall/2, lapDepth, hddHeight]);
|
|
}
|
|
|
|
// floor toungue cutaway for assembly
|
|
translate([wall-epsilon, fullDepth - (hddDepth + outerWall + wall + lapDepth/2 - epsilon), -epsilon])
|
|
cube([cubbyFullWidth + 2*epsilon - 2*wall, lapDepth + 2*epsilon, wall/2 + 2*epsilon ]);
|
|
|
|
translate([wall/2 - epsilon, fullDepth - (hddDepth + outerWall + wall + lapDepth/2), -epsilon])
|
|
cube([wall/2 + 2*epsilon, lapDepth + 2*epsilon, hddHeight + 2*epsilon]);
|
|
|
|
translate([cubbyFullWidth - wall - epsilon, fullDepth - (hddDepth + outerWall + wall + lapDepth/2), -epsilon])
|
|
cube([wall/2 + 2*epsilon, lapDepth + 2*epsilon, hddHeight + 2*epsilon]);
|
|
}
|
|
}
|
|
}
|
|
|
|
// ===========================================================================
|
|
// Right Drawer
|
|
// ===========================================================================
|
|
rightDrawerHeight = 35;
|
|
rightDrawerDepth = fullDepth - outerWall - slideGap;
|
|
rightDrawerWidth = fullWidth - cubbyFullWidth - 3*outerWall - 4*slideGap;
|
|
if (showRightDrawer) {
|
|
color("MediumSeaGreen")
|
|
translate([cubbyFullWidth + 2*outerWall + 3*slideGap, 0, bluRayHeight + 2*outerWall])
|
|
union() {
|
|
cube([ // floor
|
|
rightDrawerWidth,
|
|
rightDrawerDepth,
|
|
wall]);
|
|
|
|
cube([ // -x wall
|
|
wall,
|
|
rightDrawerDepth,
|
|
rightDrawerHeight]);
|
|
|
|
translate([rightDrawerWidth - wall, 0, 0])
|
|
cube([ // +x wall
|
|
wall,
|
|
rightDrawerDepth,
|
|
rightDrawerHeight]);
|
|
|
|
cube([ // -y wall
|
|
rightDrawerWidth,
|
|
wall,
|
|
rightDrawerHeight]);
|
|
|
|
translate([0, rightDrawerDepth - wall, 0])
|
|
cube([ // -y wall
|
|
rightDrawerWidth,
|
|
wall,
|
|
rightDrawerHeight]);
|
|
}
|
|
}
|
|
|
|
// ===========================================================================
|
|
// Letter Shelf
|
|
// ===========================================================================
|
|
letterBoxDepth = 20;
|
|
letterBoxRecline = 2;
|
|
if (showLetterShelf) {
|
|
color("PeachPuff")
|
|
translate([cubbyFullWidth + outerWall + 2*slideGap, 0, fullHeight - letterBoxDepth])
|
|
rotate([-letterBoxRecline, 0, 0])
|
|
union() {
|
|
cube([
|
|
fullWidth - cubbyFullWidth - outerWall - 2*slideGap,
|
|
fullDepth,
|
|
wall ]);
|
|
}
|
|
}
|
|
|
|
|
|
// ===========================================================================
|
|
// Outer Shell
|
|
// ===========================================================================
|
|
shell1Width = cubbyFullWidth + outerWall + 2*slideGap;
|
|
if (showShell1) {
|
|
color("MidnightBlue")
|
|
difference() {
|
|
union() {
|
|
cube([ // floor
|
|
shell1Width,
|
|
fullDepth,
|
|
outerWall]);
|
|
|
|
cube([ // -x wall
|
|
outerWall,
|
|
fullDepth,
|
|
fullHeight/3]);
|
|
|
|
translate([0, fullDepth - outerWall, 0])
|
|
cube([ // +y wall (short)
|
|
shell1Width,
|
|
outerWall,
|
|
fullHeight/3]);
|
|
|
|
translate([shell1Width/2, 0, -20])
|
|
cube([ // printing support
|
|
wall,
|
|
fullDepth,
|
|
20 + epsilon]);
|
|
}
|
|
|
|
union() {
|
|
translate([shell1Width - lapDepth, fullDepth - outerWall/2 + epsilon, -epsilon])
|
|
cube([ // +y wall lip cutout
|
|
lapDepth + epsilon,
|
|
outerWall/2 + epsilon,
|
|
fullHeight/3 + 2*epsilon]);
|
|
|
|
translate([shell1Width - lapDepth, -epsilon, outerWall/2 + epsilon])
|
|
cube([ // floor lip cutout
|
|
lapDepth + 2*epsilon,
|
|
fullDepth + 2*epsilon,
|
|
outerWall/2 + epsilon]);
|
|
}
|
|
}
|
|
}
|
|
|
|
shell2Width = fullWidth - cubbyFullWidth - outerWall - 2*slideGap;
|
|
if (showShell2Top) {
|
|
color("SlateBlue")
|
|
translate([cubbyFullWidth + outerWall + 2*slideGap, 0, fullHeight/2])
|
|
difference() {
|
|
union() {
|
|
cube([ // middle x wall
|
|
outerWall,
|
|
fullDepth,
|
|
fullHeight/2]);
|
|
|
|
translate([shell2Width - outerWall, 0, 0])
|
|
cube([ // +x wall
|
|
outerWall,
|
|
fullDepth,
|
|
fullHeight/2]);
|
|
|
|
translate([0, fullDepth - outerWall, 0])
|
|
cube([ // +y wall (tall)
|
|
shell2Width,
|
|
outerWall,
|
|
fullHeight/2]);
|
|
|
|
translate([0, 0, fullHeight/2 - outerWall])
|
|
cube([ // ceiling
|
|
shell2Width,
|
|
fullDepth,
|
|
outerWall ]);
|
|
}
|
|
|
|
union() {
|
|
translate([-epsilon, fullDepth - outerWall/2 + epsilon, -epsilon])
|
|
cube([ // +y wall lip cutout
|
|
shell2Width + 2*epsilon,
|
|
outerWall/2 + epsilon,
|
|
lapDepth + 2*epsilon]);
|
|
|
|
translate([outerWall/2, -epsilon, -epsilon])
|
|
cube([ // -x wall lip cutout
|
|
outerWall/2 + 2*epsilon,
|
|
fullDepth,
|
|
lapDepth + 2*epsilon ]);
|
|
|
|
translate([shell2Width - outerWall -epsilon, -epsilon, -epsilon])
|
|
cube([ // +x wall lip cutout
|
|
outerWall/2 + 2*epsilon,
|
|
fullDepth,
|
|
lapDepth + 2*epsilon ]);
|
|
}
|
|
}
|
|
}
|
|
|
|
if (showShell2Bot) {
|
|
color("DarkSlateBlue")
|
|
translate([cubbyFullWidth + outerWall + 2*slideGap, 0, 0])
|
|
union() {
|
|
cube([ // floor
|
|
shell2Width,
|
|
fullDepth,
|
|
outerWall]);
|
|
|
|
cube([ // middle x wall
|
|
outerWall,
|
|
fullDepth,
|
|
fullHeight/2]);
|
|
|
|
translate([shell2Width - outerWall, 0, 0])
|
|
cube([ // +x wall
|
|
outerWall,
|
|
fullDepth,
|
|
fullHeight/2]);
|
|
|
|
translate([0, fullDepth - outerWall, 0])
|
|
cube([ // +y wall (tall)
|
|
shell2Width,
|
|
outerWall,
|
|
fullHeight/2]);
|
|
|
|
translate([-lapDepth, fullDepth - outerWall/2, 0])
|
|
cube([ // +y wall lip 1 (to shell 1)
|
|
lapDepth + epsilon,
|
|
outerWall/2,
|
|
fullHeight/3]);
|
|
|
|
translate([0, fullDepth - outerWall/2, fullHeight/2 - epsilon])
|
|
cube([ // +y wall lip 2 (to shell 2 top)
|
|
shell2Width,
|
|
outerWall/2,
|
|
lapDepth + epsilon]);
|
|
|
|
translate([outerWall/2, 0, fullHeight/2 - epsilon])
|
|
cube([ // -x wall lip
|
|
outerWall/2,
|
|
fullDepth,
|
|
lapDepth + epsilon ]);
|
|
|
|
translate([shell2Width - outerWall, 0, fullHeight/2 - epsilon])
|
|
cube([ // +x wall lip
|
|
outerWall/2,
|
|
fullDepth,
|
|
lapDepth + epsilon ]);
|
|
|
|
translate([-lapDepth, 0, outerWall/2])
|
|
cube([ // floor lip
|
|
lapDepth + epsilon,
|
|
fullDepth,
|
|
outerWall/2 ]);
|
|
}
|
|
}
|