| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 | 
							- include <../config/cable_hanger.scad>
 
- include <../config/thread.scad>
 
- include <../config/wall.scad>
 
- include <thread.scad>
 
- module cable_hanger_object() {
 
-     module base_shape() {
 
-         depth = thread_height 
 
-         + cable_hanger_base_thickness 
 
-         + cable_hanger_depth;
 
-         rounding = cable_hanger_rounding;
 
-         move_y = depth / 2 - rounding;
 
-         move_x = cable_hanger_width / 2 - rounding;
 
-         hull() {
 
-             translate([move_x, move_y]) {
 
-                 circle(r = rounding);
 
-             }
 
-             translate([-move_x, move_y]) {
 
-                 circle(r = rounding);
 
-             }
 
-             translate([move_x, -move_y]) {
 
-                 square(rounding * 2, center = true);
 
-             }
 
-             translate([-move_x, -move_y]) {
 
-                 square(rounding * 2, center = true);
 
-             }
 
-         }
 
-     }
 
-     module cable_hanger_shape() {
 
-         inside = cable_hanger_inside_hole;
 
-         outside = cable_hanger_outside_hole;
 
-         depth = cable_hanger_depth;
 
-         move_top = depth / 2;
 
-         move_bottom = inside / 2 - depth / 2;
 
-         render() {
 
-             difference() {
 
-                 hull() {
 
-                     translate([0, move_top]) {
 
-                         circle(r = outside / 2);
 
-                     }
 
-                     translate([0, move_bottom]) {
 
-                         circle(r = inside / 2);
 
-                     }
 
-                 }
 
-                 
 
-                 translate([0, move_top + outside / 2]) {
 
-                     square(outside, center = true);
 
-                 }
 
-             }
 
-         }
 
-     }
 
-    
 
-     module final_shape() {
 
-         module single_cable_shape(move_x) {
 
-             depth = cable_hanger_depth;
 
-             size = depth + cable_hanger_base_thickness + thread_height;
 
-             move_y = size / 2 - depth / 2;
 
-             translate([move_x, move_y]) {
 
-                 cable_hanger_shape();
 
-             }
 
-         }
 
-         module all_cables_shape() {
 
-             base_width = cable_hanger_width 
 
-             - cable_hanger_outside_hole
 
-             - cable_hanger_rounding * 2;
 
-             space = cable_hanger_space
 
-             + cable_hanger_outside_hole;
 
-             width = base_width 
 
-             - base_width % space;
 
-             move = width / 2;
 
-             for (count = [-move : space : move]) {
 
-                 single_cable_shape(count);
 
-             }
 
-         }
 
-         render() {
 
-             difference() {
 
-                 base_shape();
 
-                 all_cables_shape();
 
-             }
 
-         }
 
-     }
 
-     
 
-     module base_object() {
 
-         thickness = thread_top_diameter
 
-         + cable_hanger_base_thickness * 2;
 
-         linear_extrude(height = thickness, center = true) {
 
-             final_shape();
 
-         }
 
-     }
 
-     module final_object() {
 
-         module thread(move_x) {
 
-             move_y = thread_height / 2
 
-             - cable_hanger_depth / 2
 
-             - cable_hanger_base_thickness / 2
 
-             - thread_height / 2;
 
-             translate([move_x, move_y, 0]) {
 
-                 rotate([270, 0, 0]) {
 
-                     thread_object();
 
-                 }
 
-             }
 
-         }
 
-         module threads() {
 
-             base_width = cable_hanger_width 
 
-             - thread_top_diameter
 
-             - cable_hanger_base_thickness;
 
-             width = base_width
 
-             - base_width % wall_holes_space;
 
-             move = width / 2;
 
-             for (count = [-move : wall_holes_space : move]) {
 
-                 thread(count);
 
-             }
 
-         }
 
-         color("#3dea15") {
 
-             render() {
 
-                 difference() {
 
-                     base_object();
 
-                     threads();
 
-                 }
 
-             }
 
-         }
 
-     }   
 
-     final_object();
 
- }
 
 
  |