TOPdesk/tops/side.scad

292 lines
7.9 KiB
OpenSCAD
Raw Permalink Normal View History

include <../config.scad>
include <../modules.scad>
module top_side() {
// sidetable top
translate([
0,
0,
MAIN_HEIGHT - TOP_THICKNESS
]){
difference(){
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_USABLE_SURFACE : COLOR_WOOD) {
cube([SIDETABLE_WIDTH, SIDETABLE_DEPTH, TOP_THICKNESS]);
}
// cut cable slots
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_CABLE_MANAGEMENT : COLOR_CUTOUT) {
for (i=[1:CABLE_SLOT_NUM_SIDETABLE]){
translate([
(i * ( SIDETABLE_WIDTH / (CABLE_SLOT_NUM_SIDETABLE + 1) )) - CABLE_SLOT_WIDTH / 2,
SIDETABLE_DEPTH - CABLE_SLOT_TOP_OFFSET - CABLE_SLOT_DEPTH,
-CUTOUT_OVERCOMMIT
]){
cube([
CABLE_SLOT_WIDTH,
CABLE_SLOT_DEPTH,
CUTOUT_OVERCOMMIT + TOP_THICKNESS + CUTOUT_OVERCOMMIT
]);
}
}
}
}
}
// sidetable backplate
translate([
0,
SIDETABLE_DEPTH,
MAIN_HEIGHT - TOP_THICKNESS - _BACKPLATE_HEIGHT
]){
rotate([90, 0, 0]){
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_LOAD_BEARING : COLOR_WOOD) {
cube([SIDETABLE_WIDTH, _BACKPLATE_HEIGHT, BACKPLATE_THICKNESS]);
}
}
}
// sidetable sideplate (touches main table backplate)
translate([
0,
0,
MAIN_HEIGHT - TOP_THICKNESS - _BACKPLATE_HEIGHT
]){
rotate([90, 0, 90]){
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_LOAD_BEARING : COLOR_WOOD) {
cube([SIDETABLE_DEPTH - BACKPLATE_THICKNESS, _BACKPLATE_HEIGHT, BACKPLATE_THICKNESS]);
}
}
}
// sidetable stand bottom, backside
translate([
0,
SIDETABLE_DEPTH - BACKPLATE_THICKNESS - STAND_DEPTH,
MAIN_HEIGHT - TOP_THICKNESS - STAND_HEIGHT
]){
difference() {
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_LOAD_BEARING : COLOR_WOOD) {
cube([
SIDETABLE_WIDTH,
STAND_DEPTH + BACKPLATE_THICKNESS,
STAND_THICKNESS
]);
}
// cutout in overlap so we can stack stand bottom planks (side and back) in the corner
color(COLOR_CUTOUT) {
cube([
STAND_DEPTH + BACKPLATE_THICKNESS,
STAND_DEPTH + BACKPLATE_THICKNESS,
STAND_THICKNESS / 2
]);
}
}
}
// sidetable stand bottom, connecting side
translate([
0,
0,
MAIN_HEIGHT - TOP_THICKNESS - STAND_HEIGHT
]){
difference() {
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_LOAD_BEARING : COLOR_WOOD) {
cube([
STAND_DEPTH + BACKPLATE_THICKNESS,
SIDETABLE_DEPTH,
STAND_THICKNESS
]);
}
// cutout in overlap so we can stack stand bottoms in the corner
color(COLOR_CUTOUT) {
translate([
0,
SIDETABLE_DEPTH - BACKPLATE_THICKNESS - STAND_DEPTH,
STAND_THICKNESS / 2
]){
cube([
STAND_DEPTH + BACKPLATE_THICKNESS,
STAND_DEPTH + BACKPLATE_THICKNESS,
STAND_THICKNESS / 2
]);
}
}
}
}
// sidetable stand left
translate([
BACKPLATE_THICKNESS,
STAND_THICKNESS,
MAIN_HEIGHT - TOP_THICKNESS - _BACKPLATE_HEIGHT
]){
rotate([90, 0, 0]){
stand_side();
}
}
// sidetable stand right
translate([
SIDETABLE_WIDTH - STAND_THICKNESS,
MAIN_DEPTH - STAND_DEPTH - BACKPLATE_THICKNESS,
MAIN_HEIGHT - TOP_THICKNESS - _BACKPLATE_HEIGHT
]){
rotate([90, 0, 90]){
stand_side();
}
}
// sidetable tray bottom
translate([
BACKPLATE_THICKNESS,
SIDETABLE_DEPTH - BACKPLATE_THICKNESS - STAND_DEPTH + CABLE_TRAY_THICKNESS,
_CABLE_TRAY_OFFSET_Y
]){
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_CABLE_MANAGEMENT : COLOR_WOOD) {
cube([
SIDETABLE_WIDTH - BACKPLATE_THICKNESS - STAND_THICKNESS,
_CABLE_TRAY_DEPTH,
CABLE_TRAY_THICKNESS
]);
}
}
//sidetable tray bottom, connecting side
// TODO: "wide" orientation + rotation
sidetable_tray_connecting_width = SIDETABLE_DEPTH - STAND_THICKNESS - _CABLE_TRAY_DEPTH - BACKPLATE_THICKNESS;
translate([
BACKPLATE_THICKNESS,
STAND_THICKNESS,
_CABLE_TRAY_OFFSET_Y
]){
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_CABLE_MANAGEMENT : COLOR_WOOD) {
cube([
_CABLE_TRAY_DEPTH,
sidetable_tray_connecting_width,
CABLE_TRAY_THICKNESS
]);
}
}
// sidetable tray lip
translate([
BACKPLATE_THICKNESS + _CABLE_TRAY_DEPTH + CABLE_TRAY_THICKNESS,
SIDETABLE_DEPTH - BACKPLATE_THICKNESS - _CABLE_TRAY_DEPTH,
_CABLE_TRAY_OFFSET_Y
]){
rotate([90, 0, 0]){
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_CABLE_MANAGEMENT : COLOR_WOOD) {
cube([
SIDETABLE_WIDTH - BACKPLATE_THICKNESS - _CABLE_TRAY_DEPTH - CABLE_TRAY_THICKNESS - STAND_THICKNESS,
CABLE_TRAY_LIP + CABLE_TRAY_THICKNESS,
CABLE_TRAY_THICKNESS
]);
}
}
}
// sidetable tray lip, connecting side
translate([
BACKPLATE_THICKNESS + _CABLE_TRAY_DEPTH,
STAND_THICKNESS,
_CABLE_TRAY_OFFSET_Y
]){
rotate([90, 0, 90]){
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_CABLE_MANAGEMENT : COLOR_WOOD) {
cube([
SIDETABLE_DEPTH - STAND_THICKNESS - _CABLE_TRAY_DEPTH - BACKPLATE_THICKNESS,
CABLE_TRAY_LIP + CABLE_TRAY_THICKNESS,
CABLE_TRAY_THICKNESS
]);
}
}
}
// feet
sidetable_foot_offset_x = (BACKPLATE_THICKNESS + _CABLE_TRAY_DEPTH) / 2;
// sidetable corner foot
translate([
sidetable_foot_offset_x,
_FOOT_OFFSET_Y,
0
]){
leg(_FOOT_HEIGHT);
}
// sidetable left foot
translate([
sidetable_foot_offset_x,
LEG_OFFSET_Y,
0
]){
leg(_FOOT_HEIGHT);
}
// sidetable center foot
translate([
MAIN_DEPTH - LEG_OFFSET_X,
_FOOT_OFFSET_Y,
0
]){
leg(_FOOT_HEIGHT);
}
// sidetable right foot
translate([
SIDETABLE_WIDTH - LEG_OFFSET_X,
_FOOT_OFFSET_Y,
0
]){
leg(_FOOT_HEIGHT);
}
// sidetable center leg
translate([
MAIN_DEPTH - LEG_OFFSET_X,
LEG_OFFSET_Y,
0
]){
leg(_LEG_HEIGHT);
}
// sidetable right leg
translate([
SIDETABLE_WIDTH - LEG_OFFSET_X,
LEG_OFFSET_Y,
0
]){
leg(_LEG_HEIGHT);
}
// spacers
// these distribute force from freestanding legs to the rest of the assembly
// center leg spacer
translate([
MAIN_DEPTH - LEG_OFFSET_X,
LEG_OFFSET_Y,
_FOOT_HEIGHT - LEG_BASE_THICKNESS - SPACER_CUFF_HEIGHT
]){
spacer(_LEG_TO_FOOT);
}
// right leg spacer
translate([
SIDETABLE_WIDTH - LEG_OFFSET_X,
LEG_OFFSET_Y,
_FOOT_HEIGHT - LEG_BASE_THICKNESS - SPACER_CUFF_HEIGHT
]){
spacer(_LEG_TO_FOOT);
}
}
top_side();