include <../config/vesa.scad> include <../config/wall.scad> include <../config/hook.scad> function vesa_hinge_full_height() = vesa_hinge_height + vesa_hinge_thickness * 2; module vesa_hinge_object() { module bottom_base_object() { move_x = vesa_hinge_width / 2; move_y = vesa_hinge_full_height() / 2; linear_extrude(height = vesa_hinge_thickness) { square([move_x * 2, move_y * 2], center = true); } } module hanging_object() { rotate([90, 0, 0]) { linear_extrude(height = vesa_hinge_thickness, center = true) { radius = vesa_hinge_depth / 2; difference() { hull() { translate([0, radius]) { circle(r = radius); } translate([0, radius / 2]) { square([radius * 2, radius], center = true); } } translate([0, radius]) { circle(r = vesa_hinge_screw / 2); } } } } } move_y = vesa_hinge_height / 2 + vesa_hinge_thickness / 2; move_z = vesa_hinge_thickness; translate([0, move_y, move_z]) { hanging_object(); } translate([0, -move_y, move_z]) { hanging_object(); } bottom_base_object(); } module vesa_thread(rotated = true) { module base_object() { cylinder(r = vesa_thread_radius / 2, h = vesa_thread_height); cylinder(r = vesa_thread_top_radius / 2, h = vesa_thread_top_height); } if (rotated) { rotate([0, 180, 0]) { base_object(); } } else { base_object(); } } module vesa_connector_object(center = false) { module base_shape() { hull() { move_x = vesa_connector_length / 2 - vesa_hinge_depth / 2; translate([move_x, 0]) { circle(r = vesa_hinge_depth / 2); } translate([-move_x, 0]) { circle(r = vesa_hinge_depth / 2); } } } module mounting_screws() { radius = vesa_hinge_screw / 2; move_x = vesa_connector_length / 2 - vesa_hinge_depth / 2 + radius; translate([move_x, 0]) { circle(r = radius); } translate([-move_x, 0]) { circle(r = radius); } } module base_object() { height = vesa_hinge_height - vesa_connector_margin; linear_extrude(height = height, center = center) { difference() { base_shape(); mounting_screws(); } } } module threads() { translate([0, 0, vesa_hinge_height - vesa_connector_margin]) { vesa_thread(); } translate([0, 0, 0]) { vesa_thread(false); } } render() { difference() { radius = vesa_hinge_screw / 2; move_x = vesa_connector_length / 2 - vesa_hinge_depth / 2 + radius; correct = vesa_hinge_height - vesa_connector_margin; center_correct = center ? -correct / 2 : 0; base_object(); translate([move_x, 0, center_correct]) { threads(); } translate([-move_x, 0, center_correct]) { threads(); } first_cable_x = move_x - vesa_cable_hole / 1.5 - vesa_thread_top_radius; cable_z = vesa_cable_hole / 1.5; translate([first_cable_x , 0, cable_z]) { rotate([90, 0, 0]) { cylinder( r = vesa_cable_hole / 2, h = vesa_hinge_height, center = true ); } } translate([0 , 0, cable_z]) { rotate([90, 0, 0]) { cylinder( r = vesa_cable_hole / 2, h = vesa_hinge_height, center = true ); } } translate([-first_cable_x , 0, cable_z]) { rotate([90, 0, 0]) { cylinder( r = vesa_cable_hole / 2, h = vesa_hinge_height, center = true ); } } } } } module vesa_wall_hinge_object() { module wall_base_shape() { move_x = vesa_wall_width / 2 - vesa_rounding; move_y = vesa_wall_height / 2 - vesa_rounding; rounding = vesa_rounding; hull() { translate([move_x, move_y]) { circle(r = rounding); } translate([-move_x, move_y]) { circle(r = rounding); } translate([move_x, -move_y]) { circle(r = rounding); } translate([-move_x, -move_y]) { circle(r = rounding); } } } module wall_holes() { move_x = ( vesa_wall_width - (vesa_wall_width % wall_holes_space) ) / 2; move_y = ( vesa_wall_height - (vesa_wall_height % wall_holes_space) ) / 2; for (count_x = [-move_x : wall_holes_space : move_x]) { for (count_y = [-move_y : wall_holes_space : move_y]) { translate([count_x, count_y]) { circle(r = hook_mounting_hole / 2); } } } } module wall_shape() { difference() { wall_base_shape(); wall_holes(); } } module wall_object() { linear_extrude(height = vesa_hinge_thickness) { wall_shape(); } } union() { vesa_hinge_object(); wall_object(); } } module vesa_corner_base_object(move = false) { radius = vesa_hinge_full_height() / 2; move_x = vesa_hinge_height / 3; rotate([90, 0, 90]) { linear_extrude(height = vesa_corner_thickness, center = true) { difference() { hull() { translate([0, radius / 2]) { square([radius * 2, radius], center = true); } circle(r = radius); } circle(r = vesa_hinge_screw / 2); if (move) { difference() { size = radius - vesa_hinge_screw; move = (size + vesa_hinge_screw) * 2; circle(r = size + vesa_hinge_screw / 2); circle(r = size - vesa_hinge_screw / 2); translate([0, move / 4]) { square([move, move / 2], center = true); } } } else { translate([0, radius - vesa_hinge_screw]) { circle(r = vesa_hinge_screw / 2); } } } } } } module vesa_corner_hinge_object() { radius = vesa_hinge_full_height() / 2; move_x = vesa_hinge_width / 3; module corner_object() { vesa_corner_base_object(); } union() { vesa_hinge_object(); translate([move_x, 0, -radius]) { corner_object(); } translate([-move_x, 0, -radius]) { corner_object(); } } } module vesa_plate_corner_object() { module vesa_plate_base_shape() { move_x = vesa_width / 2 - vesa_rounding + vesa_margin; move_y = vesa_height / 2 - vesa_rounding + vesa_margin; rounding = vesa_rounding; hull() { translate([move_x, move_y]) { circle(r = rounding); } translate([move_x, -move_y]) { circle(r = rounding); } translate([-move_x, move_y]) { circle(r = rounding); } translate([-move_x, -move_y]) { circle(r = rounding); } } } module vesa_plate_shape() { radius = vesa_screw / 2; move_x = vesa_width / 2; move_y = vesa_height / 2; difference() { vesa_plate_base_shape(); translate([move_x, move_y]) { circle(r = radius); } translate([-move_x, move_y]) { circle(r = radius); } translate([move_x, -move_y]) { circle(r = radius); } translate([-move_x, -move_y]) { circle(r = radius); } } } module vesa_plate_object() { height = max(vesa_hinge_thickness, vesa_plate_thickness); correct = vesa_hinge_thickness - height; translate([0, 0, correct - height]) { linear_extrude(height = height) { vesa_plate_shape(); } } } union() { vesa_plate_object(); translate([0, 0, vesa_hinge_full_height() / 2]) { rotate([180, 0, 0]) { vesa_corner_base_object(true); } } } }