"""Shaft collar: DIN 705 form A set collar with its radial set-screw hole, or a one-piece clamp collar's envelope. Axis along Z, centred on the origin; the set-screw hole runs along +X from the bore to the outside, drawn at the thread's nominal diameter. A clamp collar's slit and screw have no published dimensions here and aren't modelled.""" from steve import Model style = "set-screw" # Style bore = 8 # mm Bore # bore: (outside diameter D, width b, thread M, set screw length). DIN 705 form A, as tabulated by Maedler (light-duty # series, set screw DIN EN ISO 4027), item pages 623003006 ... 623020006 via https://eshop.ameco.cz/products/en/3/1625/g1574/ SET_SCREW = { 3: (7, 5, 2, 3), 4: (8, 5, 2.5, 3), 5: (10, 6, 3, 4), 6: (12, 8, 4, 5), 8: (16, 8, 4, 6), 10: (20, 10, 5, 8), 12: (22, 12, 6, 8), 16: (28, 12, 6, 8), 20: (32, 14, 6, 8), } # bore: (outside diameter, width). Ruland one-piece clamp collars: MCL-6-F, MCL-8-F (MCL-8-F product sheet, # https://docs.rs-online.com/09ba/0900766b816574f5.pdf; MCL-6-F from Zoro's listing) and MCL-20-AN (40 x 15). CLAMP = {6: (16, 9), 8: (18, 9), 20: (40, 15)} if style == "set-screw": if bore not in SET_SCREW: raise ValueError(f"DIN 705 bores in the source: {', '.join(str(b) for b in SET_SCREW)} mm.") D, b, M, screw = SET_SCREW[bore] else: if bore not in CLAMP: raise ValueError(f"Clamp collar bores in the source: {', '.join(str(b) for b in CLAMP)} mm.") D, b = CLAMP[bore] model = Model() with model.sketch("ring_sketch", on="XY", name="Ring") as sk: sk.circle("outside", (0, 0), D / 2) sk.circle("bore_d", (0, 0), bore / 2) model.extrude("collar", "ring_sketch", distance=b, both=True, name="Collar") if style == "set-screw": with model.sketch("screw_sketch", on="YZ", name="Set-screw hole") as sk: sk.circle("screw_hole", (0, 0), M / 2) model.extrude("screw_cut", "screw_sketch", distance=D / 2, op="cut", name="Set-screw hole") model.material("steel-generic", color="#a9adb2") result = model.result()