diff --git a/libtest.png b/libtest.png index 36b1b4e..15d74f8 100644 Binary files a/libtest.png and b/libtest.png differ diff --git a/libtest.scad b/libtest.scad index 9a823be..2d2fffa 100644 --- a/libtest.scad +++ b/libtest.scad @@ -51,6 +51,7 @@ use use use use +use use use use @@ -154,19 +155,46 @@ translate([x5 + 50, cable_grommets_y]) translate([x5 + 95, cable_grommets_y]) press_fits(); -translate([x5, cable_grommets_y + 60]) +fixing_blocks_y = cable_grommets_y + 60; +translate([x5, fixing_blocks_y]) fixing_blocks(); -translate([x5, cable_grommets_y + 90]) +corner_blocks_y = fixing_blocks_y + 30; +translate([x5, corner_blocks_y]) corner_blocks(); -translate([x5, cable_grommets_y + 160]) +feet_y = corner_blocks_y + 70; +translate([x5, feet_y]) feet(); -translate([x5 + 70, cable_grommets_y + 160]) +translate([x5 + 70, feet_y]) screw_knobs(); -translate([x5, cable_grommets_y + 470]) { +knobs_y = feet_y + 40; +translate([640, knobs_y]) + printed_pulley_test(); + +translate([x5, knobs_y]) + knobs(); + +clips_y = knobs_y + 50; +translate([x5, clips_y]) + cable_clips(); + +strap_y = clips_y + 50; +translate([x5 + 60, strap_y]) + strap_handles(); + +handle_y = strap_y + 50; +translate([x5, handle_y]) + handle(); + +pocket_y = handle_y + 70; +translate([x5 + 65, pocket_y]) + pocket_handles(); + +hinge_y = pocket_y + 100; +translate([x5, hinge_y]) { door_hinges() door_latches(); @@ -174,29 +202,14 @@ translate([x5, cable_grommets_y + 470]) { flat_hinges(); } -translate([x5, cable_grommets_y + 380]) - no_explode() socket_boxes(); +pbox_y = hinge_y + 70; +translate([900, pbox_y]) + printed_boxes(); -translate([640, cable_grommets_y + 200]) - printed_pulley_test(); - -translate([x5, cable_grommets_y + 200]) - knobs(); - -translate([x5 + 60, cable_grommets_y + 250]) - strap_handles(); - -translate([x5, cable_grommets_y + 300]) - handle(); - -translate([950, 600]) +box_y = pbox_y + 150; +translate([950, box_y]) box_test(); -translate([900, 750]) - pocket_handles(); - -translate([900, 850]) - printed_boxes(); translate([950, 1400]) rotate(-90) @@ -427,6 +440,9 @@ translate([x2, extrusions_y]) translate([400, transformers_y]) transformers(); +translate([x4 + 50, transformers_y]) + no_explode() socket_boxes(); + belts_y = 0; rails_y = belts_y + 200; diff --git a/printed/cable_clip.scad b/printed/cable_clip.scad new file mode 100644 index 0000000..cdadf47 --- /dev/null +++ b/printed/cable_clip.scad @@ -0,0 +1,117 @@ +// +// NopSCADlib Copyright Chris Palmer 2022 +// nop.head@gmail.com +// hydraraptor.blogspot.com +// +// This file is part of NopSCADlib. +// +// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the +// GNU General Public License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with NopSCADlib. +// If not, see . +// + +// +//! Cable clips to order. Can be for one or two cables of different sizes. +// +include <../core.scad> +use <../vitamins/wire.scad> +use <../utils/fillet.scad> + +wall = 2; + +function cable_clip_width(screw) = max(wall + 2 * screw_clearance_radius(screw) + wall, washer_diameter(screw_washer(screw))); //! Width given the `screw`. +function cable_clip_height(cable) = cable_height(cable) + wall; //! Height given the `cable`. +function cable_clip_extent(screw, cable) = screw_clearance_radius(screw) + wall + cable_width(cable) + wall; //! How far it extends from the screw. +function cable_clip_offset(screw, cable) = screw_clearance_radius(screw) + wall + cable_width(cable) / 2; //! The offset of the cable from the screw + +module single_cable_clip(screw, cable, h = 0) { + screw_dia = 2 * screw_clearance_radius(screw); + height = cable_clip_width(screw); + depth = h ? h : cable_height(cable) + wall; + w = cable_width(cable); + width = wall + w + wall + screw_dia + wall; + hole_x = wall + w + wall + screw_dia / 2; + rad = min(wall + cable_wire_size(cable) / 2, depth / 2); + r = extrusion_width - eps; + translate([-hole_x, 0]) difference() { + linear_extrude(height) + difference() { + hull() { + rounded_square([width, 1], r, center = false); + + translate([width - 1, 0]) + rounded_square([1, depth], r, center = false); + + translate([rad, depth - rad]) + circle(r = rad); + } + + translate([wall + cable_width(cable) / 2, 0]) { + hull() { + for(p = cable_bundle_positions(cable)) + translate(p) + circle(d = cable_wire_size(cable)); + + square([w, eps], center = true); + } + for(side = [-1, 1]) + translate([side * w / 2, 0]) + hflip(side < 0) + fillet(r = r, h = 0); + } + } + + translate([hole_x, depth / 2, height / 2]) + rotate([90,0,0]) + teardrop_plus(h = depth + 1, r = screw_dia / 2, center = true); + } +} + + +module double_cable_clip(screw, cable1, cable2) { + h = max(cable_clip_height(cable1), cable_clip_height(cable2)); + union() { + single_cable_clip(screw, cable1, h); + + mirror([1,0,0]) single_cable_clip(screw, cable2, h); + } +} + +module cable_clip(screw, cable1, cable2 = 0) { //! Create the STL for a single cable or two cable clip + function clip_str(screw) = str("cable_clip_", screw_radius(screw) * 20); + function cable_str(cable) = str("_", cable_wires(cable), "_", round(cable_wire_size(cable) * 10)); + + if(cable2) { + stl(str(clip_str(screw), cable_str(cable1), cable_str(cable2))); + + double_cable_clip(screw, cable1, cable2); + } + else { + stl(str(clip_str(screw), cable_str(cable1))); + + single_cable_clip(screw, cable1); + } +} + + +module cable_clip_assembly(screw, thickness, cable1, cable2 = 0) { //! Cable clip with the fasteners + height = max(cable_clip_height(cable1), cable2 ? cable_clip_height(cable2) : 0); + + stl_colour(pp1_colour) render() + translate([0, cable_clip_width(screw) / 2]) rotate([90, 0, 0]) + cable_clip(screw, cable1, cable2); + + translate_z(height) + screw_and_washer(screw, screw_length(screw, height + thickness, 2, nyloc = true)); + + translate_z(-thickness) + vflip() + nut_and_washer(screw_nut(screw), true); +} diff --git a/readme.md b/readme.md index 29ff544..3005583 100644 --- a/readme.md +++ b/readme.md @@ -23,30 +23,31 @@ A list of changes classified as breaking, additions or fixes is maintained in [C Vitamins A-H Vitamins I-Q Vitamins R-Z Printed Utilities Core Utilities 7_segments IECs Rails Box Annotation BOM Axials Inserts Ring_terminals Butt_box Bezier Clip - BLDC_motors Jack Rockers Cable_grommets Catenary Global - Ball_bearings LDRs Rod Camera_housing Core_xy Polyholes - Batteries LED_meters SK_brackets Carriers Dogbones Rounded_rectangle - Bearing_blocks LEDs SMDs Corner_block Fillet Sphere - Belts Leadnuts SSRs Door_hinge Gears Teardrops - Blowers Light_strips Screws Door_latch Hanging_hole - Box_sections Linear_bearings Sealing_strip Drag_chain Horiholes - Bulldogs Magnets Servo_motors Fan_guard Layout - Buttons Mains_sockets Shaft_couplings Fixing_block Maths - Cable_strips Microswitches Sheets Flat_hinge Offset - Cameras Microview Spades Foot Quadrant - Circlips Modules Spools Handle Round - Components Nuts Springs Knob Rounded_cylinder - DIP O_ring Stepper_motors PCB_mount Rounded_polygon - D_connectors Opengrab Swiss_clips PSU_shroud Rounded_triangle - Displays PCB Terminals Pocket_handle Sector - Extrusion_brackets PCBs Toggles Press_fit Sweep - Extrusions PSUs Transformers Printed_box Thread - Fans Panel_meters Tubings Printed_pulleys Tube - Fuseholder Pillars Variacs Ribbon_clamp - Geared_steppers Pillow_blocks Veroboard SSR_shroud - Green_terminals Pin_headers Washers Screw_knob - Hot_ends Potentiometers Wire Socket_box - Hygrometer Pulleys Zipties Strap_handle + BLDC_motors Jack Rockers Cable_clip Catenary Global + Ball_bearings LDRs Rod Cable_grommets Core_xy Polyholes + Batteries LED_meters SK_brackets Camera_housing Dogbones Rounded_rectangle + Bearing_blocks LEDs SMDs Carriers Fillet Sphere + Belts Leadnuts SSRs Corner_block Gears Teardrops + Blowers Light_strips Screws Door_hinge Hanging_hole + Box_sections Linear_bearings Sealing_strip Door_latch Horiholes + Bulldogs Magnets Servo_motors Drag_chain Layout + Buttons Mains_sockets Shaft_couplings Fan_guard Maths + Cable_strips Microswitches Sheets Fixing_block Offset + Cameras Microview Spades Flat_hinge Quadrant + Circlips Modules Spools Foot Round + Components Nuts Springs Handle Rounded_cylinder + DIP O_ring Stepper_motors Knob Rounded_polygon + D_connectors Opengrab Swiss_clips PCB_mount Rounded_triangle + Displays PCB Terminals PSU_shroud Sector + Extrusion_brackets PCBs Toggles Pocket_handle Sweep + Extrusions PSUs Transformers Press_fit Thread + Fans Panel_meters Tubings Printed_box Tube + Fuseholder Pillars Variacs Printed_pulleys + Geared_steppers Pillow_blocks Veroboard Ribbon_clamp + Green_terminals Pin_headers Washers SSR_shroud + Hot_ends Potentiometers Wire Screw_knob + Hygrometer Pulleys Zipties Socket_box + Strap_handle --- @@ -4686,6 +4687,51 @@ fixing_blocks along the sides. | 12 | fixing_block_M30_assembly | +Top + +--- + +## Cable_clip +Cable clips to order. Can be for one or two cables of different sizes. + +[printed/cable_clip.scad](printed/cable_clip.scad) Implementation. + +[tests/cable_clip.scad](tests/cable_clip.scad) Code for this example. + +### Functions +| Function | Description | +|:--- |:--- | +| `cable_clip_extent(screw, cable)` | How far it extends from the screw. | +| `cable_clip_height(cable)` | Height given the `cable`. | +| `cable_clip_offset(screw, cable)` | The offset of the cable from the screw | +| `cable_clip_width(screw)` | Width given the `screw`. | + +### Modules +| Module | Description | +|:--- |:--- | +| `cable_clip(screw, cable1, cable2 = 0)` | Create the STL for a single cable or two cable clip | +| `cable_clip_assembly(screw, thickness, cable1, cable2 = 0)` | Cable clip with the fasteners | + +![cable_clip](tests/png/cable_clip.png) + +### Vitamins +| Qty | Module call | BOM entry | +| ---:|:--- |:---| +| 5 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc | +| 2 | `screw(M3_dome_screw, 12)` | Screw M3 dome x 12mm | +| 3 | `screw(M3_dome_screw, 16)` | Screw M3 dome x 16mm | +| 10 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm | + +### Printed +| Qty | Filename | +| ---:|:--- | +| 1 | cable_clip_30_10_13.stl | +| 1 | cable_clip_30_1_14_2_14.stl | +| 1 | cable_clip_30_1_60.stl | +| 1 | cable_clip_30_3_14_4_14.stl | +| 1 | cable_clip_30_5_14_6_14.stl | + + Top --- diff --git a/tests/cable_clip.scad b/tests/cable_clip.scad new file mode 100644 index 0000000..6b62bb4 --- /dev/null +++ b/tests/cable_clip.scad @@ -0,0 +1,59 @@ +// +// NopSCADlib Copyright Chris Palmer 2022 +// nop.head@gmail.com +// hydraraptor.blogspot.com +// +// This file is part of NopSCADlib. +// +// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the +// GNU General Public License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with NopSCADlib. +// If not, see . +// + +include <../core.scad> +use <../printed/cable_clip.scad> +use <../vitamins/wire.scad> + + +sheet_thickness = 3; + +cables = [ + for(i = [1 : 6]) [i, 1.4], [1, 6], 0, [10, inch(0.05), true], 0 +]; + +screw = M3_dome_screw; + + +module cable_clips() { + for(i = [0 : ceil(len(cables) / 2) - 1]) + translate([i * 25, 0]) { + cable1 = cables[2 * i]; + cable2 = cables[2 * i + 1]; + + if($preview) { + cable_clip_assembly(screw, sheet_thickness, cable1, cable2); + + for(j = [0 : 1]) + let(cable = cables[2 * i + j]) + if(cable) + let(positions = cable_bundle_positions(cable)) + for(i = [0 : len(positions) - 1]) + let(p = positions[i]) + translate([p.x + [-1, 1][j] * cable_clip_offset(screw, cable), 0, p.y]) + rotate([90, 0, 0]) + color([grey(20), "blue", "red", "orange", "yellow", "green", "brown", "purple", "grey", "white"][i]) + cylinder(d = cable_wire_size(cable), h = 30, center = true); + } + else + cable_clip(screw, cable1, cable2); + } +} + +cable_clips(); diff --git a/tests/png/cable_clip.png b/tests/png/cable_clip.png new file mode 100644 index 0000000..7d8d963 Binary files /dev/null and b/tests/png/cable_clip.png differ