Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Remixing the original instructable with butt-joints
- // https://www.instructables.com/Make-a-Portable-Workstation/
- margin = 1;
- wood_thickness = 9;
- // groove = 3;
- main_ws_closed = false;
- side_ws_closed = true;
- doors_closed = true;
- // Width × Depth × Thickness
- // We'll build around such mat, which seems a typical size.
- // LOL, I've tried to made a miniature version x)
- // mat = [300, 220, 3];
- // Thsis size fits quite well the original workspace size.
- // A3
- mat = [450, 300, 3];
- // gabaryt (pol) - overall dimensions of the whole item
- gabaryt = [550, 215, 400];
- // Main Body
- bottom = [gabaryt.x, gabaryt.y, wood_thickness];
- top = [gabaryt.x, gabaryt.y, wood_thickness];
- sideL = [140, gabaryt.z - 2* wood_thickness, wood_thickness];
- sideR = [140, gabaryt.z - 2* wood_thickness, wood_thickness];
- divider = [sideL.x - wood_thickness, sideL.y, wood_thickness];
- back = [gabaryt.x - 2* wood_thickness, gabaryt.z - 2* wood_thickness, wood_thickness];
- // Doors
- door_width = gabaryt.x/2 - 2*margin;
- door_depth = bottom.y - sideL.x - 2* wood_thickness - mat.z - 2*margin;
- door_height = gabaryt.z - 2* wood_thickness - 2*margin;
- door_bottom_L = [door_width, door_depth, wood_thickness];
- door_bottom_R = [door_width, door_depth, wood_thickness];
- door_top_L = [door_width, door_depth, wood_thickness];
- door_top_R = [door_width, door_depth, wood_thickness];
- door_L_side_L = [door_height - 2*wood_thickness, door_depth, wood_thickness];
- door_L_side_R = [door_height - 2*wood_thickness, door_depth, wood_thickness];
- door_R_side_L = [door_height - 2*wood_thickness, door_depth, wood_thickness];
- door_R_side_R = [door_height - 2*wood_thickness, door_depth, wood_thickness];
- door_back_L = [door_width - 2* wood_thickness, door_height - 2* wood_thickness, wood_thickness];
- door_back_R = [door_width - 2* wood_thickness, door_height - 2* wood_thickness, wood_thickness];
- // Worksurface
- middle_ws = [gabaryt.x, gabaryt.z - wood_thickness, wood_thickness];
- side_ws_L = [middle_ws.x/2-1, middle_ws.y - wood_thickness - 2* margin, wood_thickness];
- side_ws_R = [middle_ws.x/2-1, middle_ws.y - wood_thickness - 2* margin, wood_thickness];
- // If we're building around the mat, then we need to start with the main
- // work surface, which will in turn decide the dimensions of the base workspace
- // and overall station size.
- include <module_rotate_about_pt.scad>;
- module workspaces () {
- mat_center_x = (middle_ws.x - mat.x)/2;
- translate ( [mat_center_x, mat_center_x/2, wood_thickness + margin] ) {
- color ( "#007d67" )
- cube ( mat );
- translate ( [margin, margin, mat.z] )
- color ( "black" )
- text ( "A3 mat" );
- }
- cube ( middle_ws );
- translate ( [margin, margin, wood_thickness] )
- color ( "black" )
- text ( "main workspace" );
- // Twice the margin for the hinges (at least).
- rotate_about_pt ([0, (side_ws_closed ? 180 : 0), 0],
- [-margin, 0, wood_thickness + mat.z + margin]) {
- translate ( [- side_ws_L.x - 2*margin, wood_thickness + margin ,0] ) {
- cube ( side_ws_L );
- translate ( [margin, margin, wood_thickness] )
- color ( "black" )
- text ( "workspace left" );
- }
- }
- translate ( [middle_ws.x + 2*margin, wood_thickness + margin ,0] ) {
- rotate_about_pt ([0, (side_ws_closed ? -180 : 0), 0],
- [-margin, 0, wood_thickness + mat.z + margin]) {
- cube ( side_ws_R );
- translate ( [margin, margin, wood_thickness] )
- color ( "black" )
- text ( "workspace right" );}
- }
- }
- module main_box () {
- // Bottom
- translate( [0, middle_ws.y + margin, 0] ) {
- cube ( bottom );
- translate ( [margin, margin, wood_thickness] )
- color ( "black" )
- text ( "bottom" );
- // Divider
- translate ( [bottom.x/2 - wood_thickness/2, bottom.y - divider.x - wood_thickness, wood_thickness] )
- rotate ( [90, 0, 90] )
- cube ( divider );
- // Top
- translate ( [0, 0, gabaryt.z - wood_thickness] ) {
- cube ( top );
- translate ( [margin, margin, wood_thickness] )
- color ( "black" )
- text ( "top" );
- }
- // Back
- translate ( [wood_thickness, bottom.y , wood_thickness] )
- rotate ( [90, 0, 0] ) {
- cube ( back );
- translate ( [margin, margin, wood_thickness] )
- color ( "black" )
- text ( "back" );
- }
- // Sides
- translate ( [0, bottom.y - sideL.x, wood_thickness] ) {
- rotate( [90, 0, 90] ){
- cube (sideL);
- // Lost this label…
- translate ( [margin, margin, mat.z+1] )
- color ( "black" )
- # text ( "side left" );
- translate ( [0, 0, bottom.x - wood_thickness] ){
- cube ( sideR );
- translate ( [margin, margin, mat.z+1] )
- color ( "black" )
- # text ( "side right" );
- }
- }
- }
- // Drawers
- translate ( [- door_bottom_L.x - 2*margin,
- bottom.y - sideL.x,
- wood_thickness + margin] )
- {
- // Drawer L
- rotate_about_pt ([0,0,(doors_closed ? -180 : 0)], [door_width + margin,0,0]) {
- cube ( door_bottom_L );
- translate ( [0, 0, door_L_side_L.x + wood_thickness] )
- cube ( door_top_L );
- translate ( [wood_thickness , door_bottom_L.y, wood_thickness] )
- rotate( [90, 0, 0] )
- cube ( door_back_L );
- translate ( [wood_thickness , 0, wood_thickness] )
- rotate ( [0, -90, 0] ){
- cube ( door_L_side_L );
- translate ( [0, 0, - door_width + wood_thickness] )
- cube ( door_L_side_R );
- }
- }
- // Drawer R
- // rotate_about_pt ([,,], [,,])
- translate ( [door_width + bottom.x + 4* margin, 0, 0] )
- rotate_about_pt ([0,0,(doors_closed ? -180 : 0)], [- margin,0,0]) {
- cube ( door_bottom_R );
- translate ( [0, 0, door_R_side_L.x + wood_thickness] )
- cube ( door_top_L );
- translate ( [wood_thickness , door_bottom_R.y, wood_thickness] )
- rotate( [90, 0, 0] )
- cube ( door_back_R );
- translate ( [wood_thickness , 0, wood_thickness] )
- rotate ( [0, -90, 0] ){
- cube ( door_R_side_L );
- translate ( [0, 0, - door_width + wood_thickness] )
- cube ( door_R_side_R );
- }
- }
- }
- }
- }
- // simulate closing the main workspace
- rotate_about_pt ( [( main_ws_closed ? -90 : 0), 0, 0], [0, middle_ws.y, middle_ws.z] )
- workspaces ();
- main_box ();
- // Main box
- // {
- // translate ( [0, 0, 0] ) {
- // cube ( bottom );
- // translate ( [0, 0, sideA.y + wood_thickness] )
- // cube ( top );
- // }
- // translate ( [0, wood_thickness, wood_thickness] )
- // rotate ( [90, 0, 0] ) {
- // cube ( sideA );
- // translate ( [0, 0, -bottom.y + wood_thickness] )
- // cube ( sideB );
- // }
- // % translate ( [0, wood_thickness, wood_thickness] )
- // rotate ( [90, 0, 90] )
- // cube ( back );
- // }
- echo ( "bottom: ", bottom );
- echo ( "top: ", top );
- echo ( "sideL: ", sideL );
- echo ( "sideR: ", sideR );
- echo ( "divider: ", divider );
- echo ( "back: ", back );
- echo ( "door_bottom_L: ", door_bottom_L );
- echo ( "door_bottom_R: ", door_bottom_R );
- echo ( "door_top_L: ", door_top_L );
- echo ( "door_top_R: ", door_top_R );
- echo ( "door_L_side_L: ", door_L_side_L );
- echo ( "door_L_side_R: ", door_L_side_R );
- echo ( "door_R_side_L: ", door_R_side_L );
- echo ( "door_R_side_R: ", door_R_side_R );
- echo ( "door_back_L: ", door_back_L );
- echo ( "door_back_R: ", door_back_R );
- echo ( "middle_ws: ", middle_ws );
- echo ( "side_ws_L: ", side_ws_L );
- echo ( "side_ws_R: ", side_ws_R );
Advertisement
Add Comment
Please, Sign In to add comment