Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
2dec9d849This file is pinned to the selected release. Download the original to open it in your design tool.
/* all measurements in millimeters */
BT = 19; /* board thickness */
BW1 = 144; /* board width 1 */
BW2 = 94; /* board width 2 */
W = 1950; /* overall width */
H = 300; /* overall height */
BWY = [BW1,BW2,BW2,BW2,BW2,BW2,BW1]; /* Y board widths */
BSY = 7; /* Y board spacing */
BWX = [BW2,BW1,BW1,BW2]; /* X board widths */
LT = 74; /* leg thickness */
/* TODO: How to fix hinges? */
function sumVec(vec, index=0, sum=0) =
index >= len(vec) ?
sum :
sumVec(vec, index+1, sum+vec[index]);
function sumVecUntil(vec, maxIndex, index=0, sum=0) =
index >= maxIndex ?
sum :
sumVecUntil(vec, maxIndex, index+1, sum+vec[index]);
D = sumVec(BWY) + (len(BWY) - 1) * BSY; /* overall depth */
BSX = (W-sumVec(BWX))/(len(BWX)+1); /* X board spacing */
echo("Overall depth", D);
echo("X board spacing", BSX);
module boardXflat(width, length) {
color("red")
cube([length,width,BT]);
echo("Board", width, length);
}
module boardYflat(width, length) {
color("yellow")
cube([width,length,BT]);
echo("Board", width, length);
}
module boardXupright(length) {
color("gray")
cube([length,BT,BW1]);
echo("Board", BW1, length);
}
module boardYupright(length) {
color("gray")
cube([BT,length,BW1]);
echo("Board", BW1, length);
}
module leg() {
color("blue")
cube([LT,LT,H-BT]);
echo("Leg", H-BT);
}
/* top boards along X axis: */
translate([0,0,H-BT]) for (i = [0:len(BWY)-1]) {
translate([0,i*BSY+sumVecUntil(BWY,i),0])
boardXflat(BWY[i], W);
}
/* top boards along Y axis: */
translate([0,BT,H-2*BT]) for (i = [0:len(BWX)-1]) {
translate([(i+1)*BSX+sumVecUntil(BWX,i),0,0])
boardYflat(BWX[i], D-2*BT);
}
/* side boards: */
SBZO = H-BT-BW1; /* side board Z offset */
translate([0,0,SBZO]) boardXupright(W);
translate([0,D-BT,SBZO]) boardXupright(W);
translate([0,BT,SBZO]) boardYupright(D-2*BT);
translate([W-BT,BT,SBZO]) boardYupright(D-2*BT);
/* legs: */
translate([BT,BT,0]) leg();
translate([(W-LT)/2,BT,0]) leg();
translate([W-BT-LT,BT,0]) leg();
translate([BT,D-BT-LT,0]) leg();
translate([(W-LT)/2,D-BT-LT,0]) leg();
translate([W-BT-LT,D-BT-LT,0]) leg();