"""Slit shaft coupling, long clamping type: one aluminium body with slits between two clamping hubs. Axis along Z, an end face on the XY plane, bore d1 in the lower half of the length, bore d2 in the upper. Fit dimensions from MISUMI's table; see the README.""" import cadquery as cq from steve import Model size = 20 # mm Outside diameter D d1 = 5 # mm Bore 1 (d1 <= d2) d2 = 8 # mm Bore 2 detail = "full" # full: slits, clamp slits and screw holes; simple: a plain cylinder with the bores # D: (L, hub length l, clamp screw M, screw offset A, screw from the end F). # MISUMI Couplings catalogue, Slit Couplings, Clamping, Short/Long, CPLCN columns, https://de.misumi-ec.com/files/images/products/docs/flexibleshaftcouplings.pdf, PDF p. 8. SIZES = {12: (18.5, 5, 2, 4, 2.5), 16: (23, 6.5, 2.5, 5, 3.25), 20: (26, 7.5, 2.5, 6.5, 3.75), 25: (31, 8.5, 3, 9, 4.25), 32: (41, 12, 4, 11, 6)} # D: the (d1, d2) pairs the table offers. PAIRS = { 12: ((4, 4), (4, 5), (5, 5)), 16: ((5, 5), (5, 6), (6, 6)), 20: ((5, 6), (5, 6.35), (5, 8), (6, 6), (6, 6.35), (6, 7), (6, 8), (6.35, 8), (8, 8)), 25: ((5, 6), (6, 6), (6, 6.35), (6, 8), (6, 10), (6.35, 8), (6.35, 10), (8, 8), (8, 9.525), (8, 10), (9.525, 10), (10, 10)), 32: ((8, 8), (8, 9.525), (8, 10), (8, 12), (9.525, 10), (9.525, 12), (10, 10), (10, 11), (10, 12), (10, 14), (12, 12), (12, 14)), } L, hub, screw, A, F = SIZES[size] if (d1, d2) not in PAIRS[size]: raise ValueError(f"The {size} mm slit coupling offers bores {PAIRS[size]}.") R = size / 2 SLITS = 4 # the number of slits, their width and depth and the clamp slit's width are proportions, for looks WIDTH = 0.05 * size WEB = 0.3 * R body = cq.Workplane("XY").circle(R).extrude(L) body = body.cut(cq.Workplane("XY").workplane(offset=-1).circle(d1 / 2).extrude(L / 2 + 1)) body = body.cut(cq.Workplane("XY").workplane(offset=L / 2).circle(d2 / 2).extrude(L / 2 + 1)) if detail == "full": step = (L - 2 * hub) / (SLITS + 1) for k in range(SLITS): z = hub + (k + 1) * step - WIDTH / 2 for sign in (-1, 1): # two cuts from opposite sides leave a thin web, turned a quarter turn at each slit offset = sign * (R + WEB) box = cq.Workplane("XY").workplane(offset=z).center(offset, 0).rect(2 * R, 2 * R + 2).extrude(WIDTH) if k % 2: box = box.rotate((0, 0, 0), (0, 0, 1), 90) body = body.cut(box) for z0, height in ((-1, hub + 1), (L - hub, hub + 1)): body = body.cut(cq.Workplane("XY").workplane(offset=z0).center(R / 2 + 0.5, 0).rect(R + 1, WIDTH).extrude(height)) for z in (F, L - F): body = body.cut(cq.Workplane("YZ").center(A, z).circle(screw / 2).extrude(R + 1, both=True)) model = Model() model.add("body", body, name="Slit coupling") model.material("aluminum-generic", color="#c9ccd1") result = model.result()