| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374 |
- 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);
- }
- }
- }
- }
|