Prechádzať zdrojové kódy

Start work on cable holder.

cixo 1 rok pred
rodič
commit
306f1c3e50

+ 86 - 0
assets/cable_holder.scad

@@ -0,0 +1,86 @@
+include <../config/cable_holder.scad>
+include <../config/thread.scad>
+include <../config/wall.scad>
+include <thread.scad>
+
+module cable_holder_shape() {
+    module base_shape() {
+        rounding = cable_holder_height / 2;
+        move_x = cable_holder_width / 2 - rounding;
+
+        hull() {
+            translate([-move_x, 0]) {
+                circle(r = rounding);
+            }
+
+            translate([move_x, 0]) {
+                circle(r = rounding);
+            }
+        }
+
+        translate([0, rounding / 2]) {
+            square([cable_holder_width, rounding], center = true);
+        }
+    }
+
+    module cable_holes() {
+        space = (cable_holder_height - cable_holder_holes_diameter) / 2;
+        spacing = cable_holder_holes_diameter + space;
+        base_width = cable_holder_width - space;
+        width = base_width - base_width % spacing;
+        count_of = round(width / spacing);
+
+        for (count = [0 : 1 : count_of - 1]) {
+            move_x = count * spacing - width / 2 + spacing / 2;
+            translate([move_x, 0]) {
+                circle(r = cable_holder_holes_diameter / 2);
+            }
+        }
+    }
+    
+    difference() {
+        base_shape();
+        cable_holes();
+    }
+}
+
+module cable_holder_object() {
+    module base_object() {
+        render() { 
+            linear_extrude(height = cable_holder_thickness, center = true) {
+                cable_holder_shape();
+            }   
+        }
+    }
+
+    module thread(move_x) {
+        move_y = cable_holder_height / 2 - thread_height / 2;
+
+        translate([move_x, move_y, 0]) {
+            rotate([90, 0, 0]) {
+                thread_object();
+            }
+        }   
+    }
+
+    module threads() {
+        base_width = cable_holder_width 
+        - cable_holder_width 
+        % wall_holes_space;
+
+        move_x = base_width / 2;
+
+        for (count = [-move_x : wall_holes_space : move_x]) {
+            thread(count);
+        }
+    }
+
+    color("#F56E36") {
+        render() {
+            difference() {
+                base_object();
+                threads();
+            }
+        }
+    }
+}

+ 4 - 0
config/cable_holder.scad

@@ -0,0 +1,4 @@
+cable_holder_thickness = 10;
+cable_holder_height = 20;
+cable_holder_width = 52.5;
+cable_holder_holes_diameter = 10;

+ 5 - 0
renders/cable_holder.scad

@@ -0,0 +1,5 @@
+include <../assets/cable_holder.scad>
+
+$fn = 100;
+
+cable_holder_object();