"""Shaft support, SK (upright, foot on the XY plane, shaft along Y) and SHF (flange on the XY plane, shaft along Z), with the shaft centred on the origin's axis. Fit dimensions come from the table in the README. The clamp's slit and clamp hole sizes are proportions, for looks. detail = "simple" leaves out the slit and clamp hole.""" import cadquery as cq from steve import Model designation = "SK8" # Shaft support detail = "full" # full: with the clamp's slit and hole; simple: bore and mounting holes only # type: (bore D, centre height h, half width E, width W, thickness L, height F, foot G, top width P, hole pitch B, hole S, clamp screw). # Motion-and-Drives, SK steel shaft supports technical specifications, revision 12.03.2021, # https://cdn.shopify.com/s/files/1/0509/9690/4105/files/SK_supports_technical_specification.pdf SK = { "SK8": (8, 20, 21, 42, 14, 32.8, 6, 18, 32, 5.5, 4), "SK10": (10, 20, 21, 42, 14, 32.8, 6, 18, 32, 5.5, 4), "SK12": (12, 23, 21, 42, 14, 37.5, 6, 20, 32, 5.5, 4), "SK16": (16, 27, 24, 48, 16, 44, 8, 25, 38, 5.5, 4), "SK20": (20, 31, 30, 60, 20, 51, 10, 30, 45, 6.6, 5), "SK25": (25, 35, 35, 70, 24, 60, 12, 38, 56, 6.6, 6), "SK30": (30, 42, 42, 84, 28, 70, 12, 44, 64, 9, 6), "SK35": (35, 50, 49, 98, 32, 82, 15, 50, 74, 11, 8), "SK40": (40, 60, 57, 114, 36, 96, 15, 60, 90, 11, 8), } # type: (bore D, width W, length L, flange T, height F, boss G, hole pitch B, hole S, clamp screw). # Motion-and-Drives, SHF steel shaft supports technical specifications, revision 12.03.2021, # https://cdn.shopify.com/s/files/1/0509/9690/4105/files/SHF_supports_technical_specification.pdf SHF = { "SHF10": (10, 43, 10, 5, 24, 20, 32, 5.5, 4), "SHF12": (12, 47, 13, 7, 28, 25, 36, 5.5, 4), "SHF16": (16, 50, 16, 8, 31, 28, 40, 5.5, 4), "SHF20": (20, 60, 20, 8, 37, 34, 48, 7, 5), "SHF25": (25, 70, 25, 10, 42, 40, 56, 7, 5), "SHF30": (30, 80, 30, 12, 50, 46, 64, 9, 6), "SHF35": (35, 92, 35, 14, 58, 50, 72, 12, 8), "SHF40": (40, 102, 40, 16, 67, 56, 80, 12, 10), } model = Model() if designation in SK: D, h, E, W, L, F, G, P, B, S, screw = SK[designation] root = 0.1 * P # a small sloped root under the column, for looks with model.sketch("body_sketch", on="XZ", name="Body") as sk: sk.polyline("body", [(-W / 2, 0), (W / 2, 0), (W / 2, G), (P / 2 + root, G), (P / 2, G + root), (P / 2, F), (-P / 2, F), (-P / 2, G + root), (-P / 2 - root, G), (-W / 2, G)], closed=True) model.extrude("body", "body_sketch", distance=L, both=True, name="Body") with model.sketch("bore_sketch", on="XZ", name="Bore") as sk: sk.circle("bore_circle", (0, h), D / 2) model.extrude("bore", "bore_sketch", distance=L + 1, both=True, op="cut", name="Bore") with model.sketch("holes_sketch", on="XY", name="Mounting holes") as sk: sk.circle("hole_left", (-B / 2, 0), S / 2) sk.circle("hole_right", (B / 2, 0), S / 2) model.extrude("holes", "holes_sketch", distance=G, op="cut", name="Mounting holes") if detail == "full": slit = 0.05 * P with model.sketch("slit_sketch", on="XZ", name="Clamp slit") as sk: sk.rect("slit_rect", (-slit / 2, h), (slit / 2, F + 1)) model.extrude("slit", "slit_sketch", distance=L + 1, both=True, op="cut", name="Clamp slit") clamp_z = (h + D / 2 + F) / 2 with model.sketch("clamp_sketch", on="YZ", name="Clamp hole") as sk: sk.circle("clamp_circle", (0, clamp_z), screw / 2) model.extrude("clamp_hole", "clamp_sketch", distance=P + 1, both=True, op="cut", name="Clamp hole") model.note("centre_height", f"Centre height h = {h} +/-0.02, half width E = {E} +/-0.05 (maker's table)") else: D, W, L, T, F, G, B, S, screw = SHF[designation] r = (W - B) / 2 R = G / 2 # the flange: the boss's circle and the two ears, joined by straight sides flange = (cq.Workplane("XY").moveTo(-B / 2, -r).lineTo(0, -R).lineTo(B / 2, -r).threePointArc((W / 2, 0), (B / 2, r)) .lineTo(0, R).lineTo(-B / 2, r).threePointArc((-W / 2, 0), (-B / 2, -r)).close().extrude(T)) body = flange.union(cq.Workplane("XY").circle(R).extrude(L), clean=False) top = F - R ear = 0.2 * G body = body.union(cq.Workplane("XY").workplane(offset=T).center(0, (R * 0.7 + top) / 2).rect(2 * ear, top - R * 0.7).extrude(L - T), clean=False) body = body.cut(cq.Workplane("XY").workplane(offset=-1).circle(D / 2).extrude(L + 2)) for x in (-B / 2, B / 2): body = body.cut(cq.Workplane("XY").workplane(offset=-1).center(x, 0).circle(S / 2).extrude(T + 2)) if detail == "full": slit = 0.05 * G body = body.cut(cq.Workplane("XY").workplane(offset=T).center(0, (D / 2 * 0.9 + top + 1) / 2).rect(slit, top + 1 - D / 2 * 0.9).extrude(L - T + 1)) body = body.cut(cq.Workplane("YZ").center((R + top) / 2, (T + L) / 2).circle(screw / 2).extrude(2 * ear + 1, both=True)) model.add("body", body, name="Body") model.material("steel-generic", color="#6d7075") result = model.result()