include <../config/vesa.scad> include <../config/wall.scad> include <../config/hook.scad> module vesa_rsquare(width, height) { move_x = width / 2 - vesa_rounding; move_y = height / 2 - vesa_rounding; hull() { translate([move_x, move_y]) { circle(r = vesa_rounding); } translate([-move_x, move_y]) { circle(r = vesa_rounding); } translate([move_x, -move_y]) { circle(r = vesa_rounding); } translate([-move_x, -move_y]) { circle(r = vesa_rounding); } } } module vesa_hinge(size, thickness, hole) { linear_extrude(height = thickness, center = true) { difference() { union() { circle(r = size / 2); translate([0, size / 4]) { square([size, size / 2], center = true); } } circle(r = hole / 2); } } } module vesa_monitor_hinge() { vesa_hinge(vesa_frame_thickness, vesa_thickness, vesa_base_screw); } module vesa_main_hinge() { vesa_hinge(vesa_frame_thickness * 2, vesa_thickness, vesa_base_screw); } module vesa_monitor() { outside_width = vesa_frame_thickness + vesa_width; outside_height = vesa_frame_thickness + vesa_height; inside_width = vesa_width - vesa_frame_thickness; inside_height = vesa_height - vesa_frame_thickness; module base_object() { linear_extrude(height = vesa_thickness) { difference() { vesa_rsquare(outside_width, outside_height); vesa_rsquare(inside_width, inside_height); translate([vesa_width / 2, vesa_height / 2]) { circle(r = vesa_hole / 2); } translate([-vesa_width / 2, vesa_height / 2]) { circle(r = vesa_hole / 2); } translate([vesa_width / 2, -vesa_height / 2]) { circle(r = vesa_hole / 2); } translate([-vesa_width / 2, -vesa_height / 2]) { circle(r = vesa_hole / 2); } } } } module hinge() { translate([0, vesa_height / 2, -vesa_frame_thickness / 2]){ rotate([90, 0, 90]) { vesa_monitor_hinge(); } } } module double_hinge() { translate([-vesa_thickness, 0, 0]) { hinge(); } translate([vesa_thickness, 0, 0]) { hinge(); } } translate([vesa_width / 3, 0, 0]) { double_hinge(); } translate([-vesa_width / 3, 0, 0]) { double_hinge(); } module corner_regulation() { move = [ 0, vesa_rounding * 2 - vesa_height / 3, vesa_thickness / 2 ]; translate(move) { rotate([0, 90, 0]) { cylinder( r = vesa_base_screw / 2, h = vesa_width + vesa_frame_thickness, center = true ); } } } render() { difference() { base_object(); corner_regulation(); } } } module vesa_thread() { radius = vesa_thread_diameter / 2; top_radius = vesa_thread_top_diameter / 2; cylinder(r = radius, h = vesa_thread_thickness); cylinder(r = top_radius, h = vesa_thread_top_thickness); } module vesa_factor() { module circle_corner(position = [0, 0]) { translate(position) { circle(r = vesa_rounding); } } module square_corner(position = [0, 0]) { translate(position) { square(vesa_rounding * 2, center = true); } } module difference_circle_corner(position = [0, 0], angle = 0) { translate(position) { rotate(angle * 90) { render() { difference() { square_corner(); circle_corner(); translate([0, -vesa_rounding]) { square([vesa_rounding, vesa_rounding]); } translate([-vesa_rounding, 0]) { square([vesa_rounding * 2, vesa_rounding]); } } } } } } top_x = vesa_width / 3 - vesa_thickness / 3; top_left = [top_x, vesa_height / 2 - vesa_frame_thickness]; top_right = [-top_left.x, top_left.y]; round_top_left = [top_left.x, top_left.y - vesa_frame_thickness]; round_top_right = [top_right.x, top_right.y - vesa_frame_thickness]; module top_shape() { hull() { square_corner(top_left); square_corner(top_right); circle_corner(round_top_left); circle_corner(round_top_right); } } top_center = [0, vesa_height / 2 - vesa_frame_thickness * 4]; bottom_center = [0, vesa_frame_thickness * 4 - vesa_height / 3]; module center_shape() { correct = vesa_frame_thickness * 2; bottom_left = [correct + vesa_rounding, vesa_rounding - correct]; bottom_right = [-bottom_left.x, bottom_left.y]; top_left = [bottom_left.x, correct - vesa_rounding * 2]; top_right = [-bottom_left.x, top_left.y]; height = top_left.y - bottom_left.y + vesa_rounding * 2 - bottom_center.y + top_center.y; move = top_left.y + bottom_left.y + top_center.y + bottom_center.y; width = top_left.x - top_right.x - vesa_rounding * 2; translate([0, move / 2]) { square([width, height], center = true); } translate(bottom_center) { difference_circle_corner(bottom_left, 0); difference_circle_corner(bottom_right, 1); } translate(top_center) { difference_circle_corner(top_left, 3); difference_circle_corner(top_right, 2); } } bottom_y = bottom_center.y - vesa_frame_thickness * 2 - vesa_rounding * 2; bottom_left = [vesa_width / 2, bottom_y]; bottom_right = [-bottom_left.x, bottom_left.y]; module bottom_shape() { hull() { circle_corner([bottom_left.x, bottom_left.y + vesa_rounding]); circle_corner([bottom_left.x, bottom_left.y - vesa_rounding]); circle_corner([bottom_right.x, bottom_right.y + vesa_rounding]); circle_corner([bottom_right.x, bottom_right.y - vesa_rounding]); } } module base_object() { linear_extrude(height = vesa_thickness) { top_shape(); center_shape(); bottom_shape(); } } module corner_regulation() { move = [ 0, vesa_rounding * 2 - vesa_height / 3, vesa_thickness / 2 ]; translate(move) { rotate([0, 90, 0]) { cylinder( r = vesa_base_screw / 2, h = vesa_width + vesa_frame_thickness, center = true ); } size = [ vesa_thickness, vesa_thickness * 1.5, vesa_thickness ]; position_x = vesa_width / 2 - vesa_frame_thickness + vesa_thickness / 2 / 1.5; translate([position_x, 0, 0]) { cube(size, center = true); } translate([-position_x, 0, 0]) { cube(size, center = true); } } } render() { difference() { base_object(); corner_regulation(); } } module monitor_hinge(x) { position_z = vesa_thickness - vesa_frame_thickness / 2; translate([x, top_left.y + vesa_frame_thickness, position_z]) { rotate([0, 90, 180]) { vesa_monitor_hinge(); translate([0, vesa_frame_thickness / 2, 0]) { linear_extrude(height = vesa_thickness, center = true) { difference() { circle(r = vesa_frame_thickness / 2); translate([0, -vesa_frame_thickness / 4]) { size = [ vesa_frame_thickness, vesa_frame_thickness / 2 ]; square(size, center = true); } } } } } } } module main_hinge(y) { translate([0, y, -vesa_frame_thickness]) { rotate([90, 0, 0]) { vesa_main_hinge(); } } } monitor_hinge(top_left.x + vesa_thickness / 3); monitor_hinge(top_right.x - vesa_thickness / 3); main_hinge(vesa_height / 4 + vesa_frame_thickness); main_hinge(-vesa_height / 4 + vesa_frame_thickness); if (vesa_width >= 100) { main_hinge(vesa_frame_thickness); } } module vesa_wall() { module base_shape() { difference() { vesa_rsquare(vesa_wall_width, vesa_wall_height); inside_width = vesa_wall_width - vesa_frame_thickness * 2; inside_height = vesa_wall_height - vesa_frame_thickness * (3 + 3); vesa_rsquare(inside_width, inside_height); } square([vesa_frame_thickness * 2, vesa_wall_height], center = true); } module shape() { difference() { base_shape(); width = vesa_wall_width - vesa_wall_width % wall_holes_space; height = vesa_wall_height - vesa_wall_height % wall_holes_space; for (count_y = [-height / 2 : wall_holes_space : height / 2]) { for (count_x = [-width / 2 : wall_holes_space : width / 2]) { translate([count_x, count_y]) { circle(r = hook_mounting_hole / 2); } } } } } module base_object() { linear_extrude(height = vesa_thickness) { shape(); } } module base_hinge(y) { translate([0, y, vesa_frame_thickness * 2 + vesa_thickness]) { rotate([270, 0, 0]) { vesa_main_hinge(); } add_size = [ vesa_frame_thickness * 2, vesa_thickness, vesa_frame_thickness ]; translate([0, 0, -vesa_frame_thickness * 1.5]) { cube(add_size, center = true); } } } module hinge(y) { base_hinge(y - vesa_thickness); base_hinge(y + vesa_thickness); } base_object(); if (vesa_height > 75) { hinge(0); } hinge(-vesa_height / 4); hinge(vesa_height / 4); } function vesa_corner_regulation_size() = [ vesa_corner_regulation_space * (vesa_corner_regulation_count - 1), vesa_thickness ]; module vesa_corner_regulation() { move_x = vesa_corner_regulation_size().x / 2; module base_shape() { hull() { translate([move_x, 0]) { circle(r = vesa_thickness / 2); } translate([-move_x, 0]) { circle(r = vesa_thickness / 2); } } } module shape() { difference() { base_shape(); for (count = [-move_x : vesa_corner_regulation_space : move_x]) { translate([count, 0]) { circle(r = vesa_base_screw / 2 + 0.5); } } } } linear_extrude(height = vesa_thickness, center = true) { shape(); } }