TOPdesk/fiddling.scad

220 lines
7.1 KiB
OpenSCAD

$vpf = 65;
// all measurements in mm
LAYER_SPACE = 0; // space between sandwich layers in rendering
LAYER_COUNT = 4; // used for misc calculations, updated by hands if you add/remove layers from the sandwich
GRID_SIZE = 50;
RACKUNIT = 45;
BOARD_THICKNESS = 16;
SANDWICH_HEIGHT = LAYER_COUNT * BOARD_THICKNESS;
DESK_WIDTH = 1400;
DESK_DEPTH = 800;
DESK_TOP_OFFSET = 10; // offset between top desk plate and stand, so cables can be fit under fully mounted STAND_TOP_RACKUNITS
FRAME = 80;
STRUT_DEPTH = 40;
STRUT_INTERVAL = 100; // must be multiple of 50 (i.e. grid size) to align with grid
STRUT_OFFSET = 50 + (STRUT_DEPTH / 2);
MAIN_SUPPORT_DEPTH = 600;
STAND_DEPTH_INNER = 200;
STAND_DEPTH_OUTER = STAND_DEPTH_INNER + BOARD_THICKNESS;
STAND_WIDTH = DESK_WIDTH + ( 2 * BOARD_THICKNESS );
STAND_TOP_RACKUNITS = 2;
STAND_BOTTOM_RACKUNITS = 4;
STAND_BELOW_SANDWICH = 550; // measurements 61.5-62cm leg-to-bottom-pipe, 7cm foot-to-bottom-pipe
STAND_ABOVE_SANDWICH = RACKUNIT * STAND_TOP_RACKUNITS; // INNER height above the sandwich, i.e. how big a thing you can screw into the opening
STAND_HEIGHT_INNER = STAND_BELOW_SANDWICH - BOARD_THICKNESS + SANDWICH_HEIGHT + STAND_ABOVE_SANDWICH;
// ↑ bottom board, important to fit STAND_BELOW_SANDWICH *with* the bottom board
STAND_HEIGHT_OUTER = STAND_HEIGHT_INNER + ( 2 * BOARD_THICKNESS );
function layer_y ( layer ) = layer * (BOARD_THICKNESS + LAYER_SPACE);
module board(width, length) {
/*echo("----------------------------------------");
echo("Board:");
echo(width=width, length=length);
echo("----------------------------------------");*/
echo(width, " x ", length);
cube([width, length, BOARD_THICKNESS]);
}
module board_side(depth, height) {
/*echo("----------------------------------------");
echo("Board (side):");
echo(depth=depth, height=height);
echo("----------------------------------------");*/
echo(depth, " x ", height);
cube([BOARD_THICKNESS, depth, height]);
}
module board_back(width, height) {
/*echo("----------------------------------------");
echo("Board (back):");
echo(width=width, height=height);
echo("----------------------------------------");*/
echo(width, " x ", height);
cube([width, BOARD_THICKNESS, height]);
}
// layer 0
board(FRAME, DESK_DEPTH);
translate([DESK_WIDTH - FRAME, 0, 0]){
board(FRAME, DESK_DEPTH);
}
// layer 1
translate([0, 0, layer_y(1)]){
// bottom board with grid
board(DESK_WIDTH, DESK_DEPTH - STAND_DEPTH_INNER);
// small left/right frame pieces to make sandwhich sides seamless (i.e. no holes in vertical space)
translate([0, DESK_DEPTH - STAND_DEPTH_INNER]){
color("orange"){
board(FRAME, STAND_DEPTH_INNER);
translate([DESK_WIDTH - FRAME, 0, 0]){
board(FRAME, STAND_DEPTH_INNER);
}
}
}
}
// layer 2
translate([0, 0, layer_y(2)]){
// main left/right frame pieces
board(FRAME, DESK_DEPTH);
translate([DESK_WIDTH - FRAME, 0, 0]){
board(FRAME, DESK_DEPTH);
}
// struts
translate([FRAME / 2, STRUT_OFFSET]) {
color("orange"){
for (offset=[0:STRUT_INTERVAL:DESK_DEPTH - STAND_DEPTH_INNER - STRUT_OFFSET - STRUT_DEPTH]) {
translate([0, offset]){
board(DESK_WIDTH - FRAME, STRUT_DEPTH);
}
}
}
}
}
// layer 3
translate([0, 0, layer_y(3)]){
// the actually usable deskTOP
board(DESK_WIDTH, DESK_DEPTH - STAND_DEPTH_INNER - DESK_TOP_OFFSET);
// small left/right frame pieces to make sandwhich sides seamless (i.e. no holes in vertical space)
translate([0, DESK_DEPTH - STAND_DEPTH_INNER - DESK_TOP_OFFSET]){
color("orange"){
board(FRAME, STAND_DEPTH_INNER + DESK_TOP_OFFSET);
translate([DESK_WIDTH - FRAME, 0]){
board(FRAME, STAND_DEPTH_INNER + DESK_TOP_OFFSET);
}
}
}
}
// stand, only if LAYER_SPACE is 0
if (LAYER_SPACE == 0) {
translate([0, DESK_DEPTH - STAND_DEPTH_INNER]){
// stand top piece
translate([-BOARD_THICKNESS, 0, SANDWICH_HEIGHT + STAND_ABOVE_SANDWICH]){
board(STAND_WIDTH, STAND_DEPTH_OUTER);
}
// tray top supports
translate([0, 0, SANDWICH_HEIGHT]){
color("orange"){
translate([FRAME - BOARD_THICKNESS, 0]){
board_side(STAND_DEPTH_INNER, STAND_ABOVE_SANDWICH);
}
translate([DESK_WIDTH - FRAME, 0]){
board_side(STAND_DEPTH_INNER, STAND_ABOVE_SANDWICH);
}
}
}
// stand backplate
translate([-BOARD_THICKNESS, STAND_DEPTH_INNER, -STAND_BELOW_SANDWICH + BOARD_THICKNESS]){
board_back(STAND_WIDTH, STAND_HEIGHT_INNER);
}
// alignment for bottom of stand
translate([0, 0, -STAND_BELOW_SANDWICH]){
// stand bottom piece
translate([-BOARD_THICKNESS, 0]){
board(STAND_WIDTH, STAND_DEPTH_OUTER);
}
translate([0, 0, BOARD_THICKNESS]){
// stand sidepieces
translate([-BOARD_THICKNESS, 0]){
board_side(STAND_DEPTH_INNER, STAND_HEIGHT_INNER);
}
translate([DESK_WIDTH, 0]){
board_side(STAND_DEPTH_INNER, STAND_HEIGHT_INNER);
}
// main support, triangular
color("red"){
translate([DESK_WIDTH / 2, STAND_DEPTH_INNER - MAIN_SUPPORT_DEPTH]){
// left
translate([-BOARD_THICKNESS, 0]){
board_side(MAIN_SUPPORT_DEPTH, STAND_BELOW_SANDWICH);
}
board_side(MAIN_SUPPORT_DEPTH, STAND_BELOW_SANDWICH);
}
}
}
}
// aligned to surface of tray
translate([0, 0, - ( STAND_BOTTOM_RACKUNITS * RACKUNIT )]){
// tray bottom
translate([0, 0, -BOARD_THICKNESS]){
board(DESK_WIDTH, STAND_DEPTH_INNER);
}
// tray bottom supports (vertical stress transfer for backside of frame
color("orange"){
translate([FRAME - BOARD_THICKNESS, 0]){
board_side(STAND_DEPTH_INNER, (STAND_BOTTOM_RACKUNITS * RACKUNIT));
}
translate([DESK_WIDTH - FRAME, 0]){
board_side(STAND_DEPTH_INNER, (STAND_BOTTOM_RACKUNITS * RACKUNIT));
}
}
// tray 10" montage piece left
translate([FRAME + 254, 0]){
board_side(STAND_DEPTH_INNER, (STAND_TOP_RACKUNITS * RACKUNIT) + SANDWICH_HEIGHT + (STAND_BOTTOM_RACKUNITS * RACKUNIT));
}
// tray 10" montage piece right
translate([DESK_WIDTH - BOARD_THICKNESS - FRAME - 254, 0]){
board_side(STAND_DEPTH_INNER, (STAND_TOP_RACKUNITS * RACKUNIT) + SANDWICH_HEIGHT + (STAND_BOTTOM_RACKUNITS * RACKUNIT));
}
}
}
}