mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-29 02:00:12 +02:00
Cable clips can now handle up to 9 wires, have the nut and bolt flipped or use an insert.
cable_radius() now handles cables with up to 20 wires. cable_bundle() and cable_bundle_positions() now handle bundles up to 9 wires. Added cable_merge().
This commit is contained in:
@@ -25,20 +25,20 @@ use <../vitamins/wire.scad>
|
||||
sheet_thickness = 3;
|
||||
|
||||
cables = [
|
||||
for(i = [1 : 6]) [i, 1.4], [1, 6], 0, [10, inch(0.05), true], 0
|
||||
[10, inch(0.05), true], 0, for(i = [1 : 9]) [i, 1.4], 0, [1, 6], 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];
|
||||
|
||||
for(i = [0 : ceil(len(cables) / 2) - 1]) {
|
||||
cable1 = cables[2 * i];
|
||||
cable2 = cables[2 * i + 1];
|
||||
translate([i * 21 + (!cable2 ? cable_clip_offset(screw, cable1) / 2 : 0), 0]) {
|
||||
insert = in([0, 3], i);
|
||||
if($preview) {
|
||||
cable_clip_assembly(screw, sheet_thickness, cable1, cable2);
|
||||
cable_clip_assembly(screw, sheet_thickness, cable1, cable2, insert = insert, flip = i == 1);
|
||||
|
||||
for(j = [0 : 1])
|
||||
let(cable = cables[2 * i + j])
|
||||
@@ -46,14 +46,15 @@ module cable_clips() {
|
||||
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])
|
||||
translate([p.x + [-1, 1][j] * cable_clip_offset(screw, cable, insert = insert), 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_clip(screw, cable1, cable2, insert = insert);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cable_clips();
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 131 KiB |
Reference in New Issue
Block a user