| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 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();
- }
- }
- }
- }
|