|
|
@@ -0,0 +1,148 @@
|
|
|
+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();
|
|
|
+}
|