"""Cast-iron pillow block unit, NTN UCP2 series. Base on the XY plane, length along X; the shaft axis along Y at height H. Sourced and making the fit: bore d, shaft height H, length L, slots J and N x N1, base width A and thickness H1, overall height H2, housing width L1, and the inner ring's width B. detail = "full" shows the unit: a casting that narrows from the feet to a round housing of diameter 2 (H2 - H), and the bearing insert in it as its own solids, an outer ring and an inner ring standing out wider. The casting's taper and the rings' diameters are proportions for looks, not for design. detail = "simple" is one solid casting with the bore. The set screws and the grease nipple are not modelled.""" from steve import Model designation = "UCP204" # Unit number detail = "full" # full: casting and bearing insert; simple: one solid # number: (d, H, L, J, A, N, N1, H1, H2, L1, B, S). NTN Ball and Roller Bearings CAT. No. 2203-3/E (2024), Bearing Units, Cast iron pillow blocks UCP type, # PDF pages 336 and 337, https://www.ntnglobal.com/en/products/catalog/pdf/2203E.pdf UNITS = {"UCP201": (12, 30.2, 127.0, 95.0, 38.0, 13.0, 16.0, 14.0, 62.0, 42.0, 31.0, 12.7), "UCP202": (15, 30.2, 127.0, 95.0, 38.0, 13.0, 16.0, 14.0, 62.0, 42.0, 31.0, 12.7), "UCP203": (17, 30.2, 127.0, 95.0, 38.0, 13.0, 16.0, 14.0, 62.0, 42.0, 31.0, 12.7), "UCP204": (20, 33.3, 127.0, 95.0, 38.0, 13.0, 16.0, 14.0, 65.0, 42.0, 31.0, 12.7), "UCP205": (25, 36.5, 140.0, 105.0, 38.0, 13.0, 16.0, 15.0, 71.0, 42.0, 34.1, 14.3), "UCP206": (30, 42.9, 165.0, 121.0, 48.0, 17.0, 20.0, 17.0, 83.0, 54.0, 38.1, 15.9), "UCP207": (35, 47.6, 167.0, 127.0, 48.0, 17.0, 20.0, 18.0, 93.0, 54.0, 42.9, 17.5), "UCP208": (40, 49.2, 184.0, 137.0, 54.0, 17.0, 20.0, 18.0, 98.0, 52.0, 49.2, 19.0), "UCP209": (45, 54.0, 190.0, 146.0, 54.0, 17.0, 20.0, 20.0, 106.0, 60.0, 49.2, 19.0), "UCP210": (50, 57.2, 206.0, 159.0, 60.0, 20.0, 23.0, 21.0, 114.0, 65.0, 51.6, 19.0)} d, H, L, J, A, N, N1, H1, H2, L1, B, S = UNITS[designation] R = H2 - H slot = (N1 - N) / 2 seat = 0.74 * R if detail == "full" else d / 2 # the housing's bore: the insert's outer ring sits in it foot = J / 2 - N1 / 2 - 0.15 * (J / 2) foot = max(foot, 0.62 * R) model = Model() with model.sketch("casting_sketch", on="XZ", name="Casting") as sk: sk.polyline("casting", [(-L / 2, 0), (L / 2, 0), (L / 2, H1), (foot, H1), (R, H), (R, H + 0.01), (-R, H + 0.01), (-R, H), (-foot, H1), (-L / 2, H1)], closed=True) model.extrude("casting", "casting_sketch", distance=A, both=True, name="Casting") with model.sketch("housing_sketch", on="XZ", name="Housing") as sk: sk.circle("housing_od", (0, H), R) model.extrude("housing", "housing_sketch", distance=L1, both=True, name="Housing") with model.sketch("trim_sketch", on="XY", name="Below the base") as sk: # the housing circle can reach past the base's underside sk.rect("trim", (-L, -L1), (L, L1)) model.extrude("trim", "trim_sketch", distance=-R, op="cut", name="Below the base") with model.sketch("bore_sketch", on="XZ", name="Seat") as sk: sk.circle("seat_d", (0, H), seat) model.extrude("seat_cut", "bore_sketch", distance=max(L1, A) + 1, both=True, op="cut", name="Seat") with model.sketch("slots_sketch", on="XY", name="Mounting slots") as sk: sk.slot("slot_left", (-J / 2 - slot, 0), (-J / 2 + slot, 0), N / 2) sk.slot("slot_right", (J / 2 - slot, 0), (J / 2 + slot, 0), N / 2) model.extrude("slots", "slots_sketch", distance=H1, op="cut", name="Mounting slots") if detail == "full": gap = 0.03 * R ring_in = (d / 2 + seat) / 2 + 0.03 * R ring_width = 0.8 * L1 with model.sketch("outer_sketch", on="XZ", name="Insert outer ring") as sk: sk.circle("outer_od", (0, H), seat) sk.circle("outer_id", (0, H), ring_in + gap) model.extrude("insert_outer", "outer_sketch", distance=ring_width, both=True, op="new", body="insert_outer_body", name="Insert outer ring") with model.sketch("inner_sketch", on="XZ", name="Insert inner ring") as sk: sk.circle("inner_od", (0, H), ring_in) sk.circle("inner_id", (0, H), d / 2) model.extrude("insert_inner", "inner_sketch", distance=B, both=True, op="new", body="insert_inner_body", name="Insert inner ring") model.material("steel-generic", color="#6d7075") result = model.result()