/* --- title: VESA frame summary: Square frame of rails or planks with VESA 75 or 100 mounting holes. tags: [vesa, frame, mount] hardware: [M4 screws (VESA), M3 screws, M3 nuts] --- Mounts GridUnit builds on a monitor arm or stand (or a VESA device on a GridUnit build). The frame size and side width are set in 15 mm units; the VESA holes are centred. */ use ; use ; use ; use ; /* [Frame] */ // Build the frame from rails (4 mm) or planks (15 mm) part = "plank"; // [rail, plank] // VESA hole distance in mm size = 100; // [75, 100] // Frame size in 15 mm units (0 = automatic: 8 for VESA 100, 6 for VESA 75) plateUnits = 0; // [0:1:20] // Width of the frame sides in 15 mm units railUnits = 1; // [1:1:5] // Flip rail sides to have inserts on the outside (rails only) flip = false; // Screw holes on the grid holes = true; // Keep the screw holes in the corner units (rails only; default: corners are filled) cornerHoles = false; /* [Cable cutouts] */ // Width of top cable cutout in mm. Set to zero to disable. topCableCutout = 4; // Width of bottom cable cutout in mm. Set to zero to disable. bottomCableCutout = 4; /* Customizer Preview */ vesaFrame(part=part, size=size, holes=holes, plateUnits=plateUnits, railUnits=railUnits, flip=flip, cornerHoles=cornerHoles); /* Module */ module vesaFrame(part = "rail", size = 100, holes=true, plateUnits = 0, railUnits = 1, flip = false, cornerHoles = false) { // Basic variables $fn = 32; e = 0.01; ru = 4; gu = 15; cr = 1; vesaDistance = size; vesaScrewDiameter = 4.5; vesaScrewHeight = 8; vesaScrewHeadDiameter = 8; vesaRingDiameter = 13; plateLength = plateUnits > 0 ? plateUnits : size == 100 ? 8 : 6; railWidth = railUnits; difference() { union() { plate(); // translate([(plateLength * gu - vesaDistance) / 2, (plateLength * gu - vesaDistance) / 2, 0]) vesaHoles() { // translate([-vesaRingDiameter/2,-vesaRingDiameter/2,0])cube([vesaRingDiameter,vesaRingDiameter,part == "plank" ? gu : ru]); // // cylinder(d=vesaRingDiameter, h=(part == "plank" ? gu : ru)); // } } translate([(plateLength * gu - vesaDistance) / 2, (plateLength * gu - vesaDistance) / 2, -e]) vesaHoles() { cylinder(d=vesaScrewDiameter, h=gu + 2 * e); translate([0, 0, vesaScrewHeight]) cylinder(d=vesaScrewHeadDiameter, h=gu + 2 * e); } } module plate() { trLeft = [0, 0, 0]; xyLeft = [railWidth * gu, plateLength * gu]; trRight = [(plateLength - railWidth) * gu, 0, 0]; xyRight = xyLeft; trFront = [0, 0, 0]; xyFront = [plateLength * gu, railWidth * gu]; trRear = [0, (plateLength - railWidth) * gu, 0]; xyRear = xyFront; if(part == "rail") { translate(trLeft) rail(xyLeft.x, xyLeft.y, holes=holes, flip=flip); translate(trRight) rail(xyRight.x, xyRight.y, holes=holes, flip=flip); translate(trFront) rail(xyFront.x, xyFront.y, holes=holes, flip=flip); translate(trRear) rail(xyRear.x, xyRear.y, holes=holes, flip=flip); } if(part == "plank") { translate(trLeft) plank(xyLeft.y, orientation="y", left=false, right=false, rotate=false, holesH=holes, holesV=holes); translate(trRight) plank(xyRight.y, orientation="y", left=false, right=false, rotate=false, holesH=holes, holesV=holes); translate(trFront) plank(xyFront.x, left=false, right=false, holesH=holes, holesV=holes); translate(trRear) plank(xyRear.x, left=false, right=false, holesH=holes, holesV=holes); } if (!(cornerHoles && part == "rail")) { translate(trLeft + [cr, cr, 0]) cube([gu - 2 * cr, gu - 2 * cr, part == "plank" ? gu : ru]); translate(trRight + [cr, cr, 0]) cube([gu - 2 * cr, gu - 2 * cr, part == "plank" ? gu : ru]); translate(trRear + [cr, cr, 0]) cube([gu - 2 * cr, gu - 2 * cr, part == "plank" ? gu : ru]); translate(trRear + trRight + [cr, cr, 0]) cube([gu - 2 * cr, gu - 2 * cr, part == "plank" ? gu : ru]); } } module vesaHoles() { translate([0, 0, 0]) children(); translate([vesaDistance, 0, 0]) children(); translate([0, vesaDistance, 0]) children(); translate([vesaDistance, vesaDistance, 0]) children(); } }