Cable Chain
A drag chain that guides cables to a 3D printer's moving head or bed. Three links come off the bed already joined (print-in-place), with no assembly. Each link has female plates with holes at the rear and male plates with pins at the front; 0.4 mm clearance lets the joints swing freely. The cable channel is 15.2 x 10 mm inside, and the whole chain is 92 x 24 x 14 mm. Width, height, pitch, wall, clearance, pin radius and the number of links are parameters.
# Cable Chain (drag chain) - three linked segments, printed in place
# X = chain direction, Y = width, Z = height. Link i pivots at its rear end, x = i * pitch
@param 16..40 desc:"Outer width (mm)"
width = 24
@param 10..24 desc:"Outer height (mm)"
height = 14
@param 20..40 desc:"Pitch = link length (mm)"
pitch = 26
@param 1.6..3 step:0.1 desc:"Side plate thickness (mm)"
wall = 2.0
@param 0.2..0.6 step:0.05 desc:"Moving clearance (mm)"
clear = 0.4
@param 2..4 step:0.5 desc:"Pin radius (mm)"
pin_r = 3.0
@param 1..6 desc:"Number of links"
links = 3
# Y positions of the side plates (+Y side; the -Y side is mirrored)
yo_out = width / 2 # outer face of the outer (female) plate
yo_in = yo_out - wall # inner face of the outer plate
yi_out = yo_in - clear # outer face of the inner (male) plate
yi_in = yi_out - wall # inner face of the inner plate = cable channel wall
end_r = height / 2 # rounded ends = swing radius around the pivot
# A box from coordinate ranges / a cylinder along Y
def slab(x0, x1, y0, y1, z0, z1) = box (x1 - x0) (y1 - y0) (z1 - z0) | translate ((x0 + x1) / 2) ((y0 + y1) / 2) ((z0 + z1) / 2)
def ycyl(r, x, y0, y1) = cylinder r (y1 - y0) | rotate 90 0 0 | translate x ((y0 + y1) / 2) end_r
# One side plate (+Y): rear half outside (female, hole), front half inside (male, pin)
side = union [
slab(0, pitch / 2, yo_in, yo_out, 0, height), # female plate
ycyl(end_r, 0, yo_in, yo_out), # rounded rear end of the female plate
slab(pitch / 2 - wall, pitch, yi_in, yi_out, 0, height), # male plate
ycyl(end_r, pitch, yi_in, yi_out), # rounded front end of the male plate
slab(pitch / 2 - wall, pitch / 2, yi_in, yo_out, 0, height), # bridge joining the two plates
ycyl(pin_r, pitch, yi_out - 0.5, yo_out - 0.3) # pin into the next link
] | diff (ycyl(pin_r + clear, 0, yo_in - 1, yo_out + 1)) # hole for the previous link's pin
# Floor and top bars (only outside the pivot's swing circle end_r)
$floor = slab(end_r + 1, pitch - end_r - 1, -yi_out, yi_out, 0, wall)
$top = slab(pitch / 2 - wall, pitch / 2 + wall, -yi_out, yi_out, height - wall, height)
link = union [side | mirror "Y" keep:true, $floor, $top]
union [link | translate (i * pitch) 0 0 for i in range(links)]