"""Deep groove ball bearing, shielded (2Z), ISO 15 boundary dimensions. Envelope: inner and outer rings joined by recessed shields (one solid), centred on the origin with its axis along Z.""" from steve import Model designation = "608" # Bearing designation # designation: (bore d, outside diameter D, width B) BEARINGS = { '623': (3, 10, 4), '624': (4, 13, 5), '625': (5, 16, 5), '626': (6, 19, 6), '608': (8, 22, 7), '688': (8, 16, 5), '6000': (10, 26, 8), '6001': (12, 28, 8), '6002': (15, 32, 9), '6003': (17, 35, 10), '6004': (20, 42, 12), '6200': (10, 30, 9), '6201': (12, 32, 10), '6202': (15, 35, 11), '6203': (17, 40, 12), '6204': (20, 47, 14), } d, D, B = BEARINGS[designation] ring = (D - d) * 0.22 # radial thickness of each ring's face recess = min(0.4, B * 0.06) model = Model() with model.sketch("rings", on="XY", name="Rings") as sk: sk.circle("outer", (0, 0), D / 2) sk.circle("bore", (0, 0), d / 2) model.extrude("body", "rings", distance=B, both=True) # both: B in all, centred on XY model.plane("face_top", on="XY", offset=B / 2, name="Top face") with model.sketch("shield_top", on="face_top", name="Top shield") as sk: sk.circle("out", (0, 0), D / 2 - ring) sk.circle("inn", (0, 0), d / 2 + ring) model.extrude("recess_top", "shield_top", distance=-recess, op="cut") model.plane("face_bottom", on="XY", offset=-B / 2, name="Bottom face") with model.sketch("shield_bottom", on="face_bottom", name="Bottom shield") as sk: sk.circle("out", (0, 0), D / 2 - ring) sk.circle("inn", (0, 0), d / 2 + ring) model.extrude("recess_bottom", "shield_bottom", distance=recess, op="cut") result = model.result()