"""Metric plain (flat) washer: normal series ISO 7089 (DIN 125-A), product grade C ISO 7091 (DIN 126), small series ISO 7092 (DIN 433; M1 to M1.4 from DIN 433), large series ISO 7093-1 and DIN 9021, square-hole DIN 440 form V, heavy DIN 7349. A flat ring: hole d1 (min, nominal), outside diameter d2 (max, nominal) and thickness h (nominal). DIN 440 form V has a square hole of side a. The washer lies on the XY plane at the origin, its thickness along +Z. """ from steve import Model standard = "ISO 7089" # Standard size = "M3" # Thread size material = "steel" # Material # size: (d1, d2, h) in mm; d1 = hole (min = nominal), d2 = outside diameter (max = nominal), h = nominal thickness # ISO 7089:2000 Table 1 (and non-preferred sizes); DIN 125-1 form A has the same dimensions. # DIN EN ISO 7089:2000-11, https://fasten.it/norms/norm/din_en_iso_7089; https://www.fasteners.eu/standards/ISO/7089/ ISO_7089 = { "M1.6": (1.7, 4.0, 0.3), "M2": (2.2, 5.0, 0.3), "M2.5": (2.7, 6.0, 0.5), "M3": (3.2, 7.0, 0.5), "M3.5": (3.7, 8.0, 0.5), "M4": (4.3, 9.0, 0.8), "M5": (5.3, 10.0, 1.0), "M6": (6.4, 12.0, 1.6), "M8": (8.4, 16.0, 1.6), "M10": (10.5, 20.0, 2.0), "M12": (13.0, 24.0, 2.5), "M14": (15.0, 28.0, 2.5), "M16": (17.0, 30.0, 3.0), "M18": (19.0, 34.0, 3.0), "M20": (21.0, 37.0, 3.0), "M22": (23.0, 39.0, 3.0), "M24": (25.0, 44.0, 4.0), "M27": (28.0, 50.0, 4.0), "M30": (31.0, 56.0, 4.0), "M33": (34.0, 60.0, 5.0), "M36": (37.0, 66.0, 5.0), } # ISO 7091:2000 Table 1 (product grade C); DIN 126 has the same dimensions. # DIN EN ISO 7091:2000-11, https://fasten.it/norms/norm/din_en_iso_7091; https://www.fasteners.eu/standards/ISO/7091/ ISO_7091 = { "M1.6": (1.8, 4.0, 0.3), "M2": (2.4, 5.0, 0.3), "M2.5": (2.9, 6.0, 0.5), "M3": (3.4, 7.0, 0.5), "M4": (4.5, 9.0, 0.8), "M5": (5.5, 10.0, 1.0), "M6": (6.6, 12.0, 1.6), "M8": (9.0, 16.0, 1.6), "M10": (11.0, 20.0, 2.0), "M12": (13.5, 24.0, 2.5), "M16": (17.5, 30.0, 3.0), "M20": (22.0, 37.0, 3.0), "M24": (26.0, 44.0, 4.0), "M30": (33.0, 56.0, 4.0), "M36": (39.0, 66.0, 5.0), "M42": (45.0, 78.0, 8.0), "M48": (52.0, 92.0, 8.0), "M56": (62.0, 105.0, 10.0), "M64": (70.0, 115.0, 10.0), } # ISO 7092:2000 Table 1 (small series, M1.6 to M36); DIN 433-1 has the same dimensions. # DIN EN ISO 7092:2000-11, https://fasten.it/norms/norm/din_en_iso_7092; M36 d2 60 also https://www.jcfasteners.com/wp-content/uploads/ISO-7092-Small-OD-Washer-B6iD10-SS316.pdf ISO_7092 = { "M1.6": (1.7, 3.5, 0.3), "M2": (2.2, 4.5, 0.3), "M2.5": (2.7, 5.0, 0.5), "M3": (3.2, 6.0, 0.5), "M3.5": (3.7, 7.0, 0.5), "M4": (4.3, 8.0, 0.5), "M5": (5.3, 9.0, 1.0), "M6": (6.4, 11.0, 1.6), "M8": (8.4, 15.0, 1.6), "M10": (10.5, 18.0, 1.6), "M12": (13.0, 20.0, 2.0), "M14": (15.0, 24.0, 2.5), "M16": (17.0, 28.0, 2.5), "M18": (19.0, 30.0, 2.5), "M20": (21.0, 34.0, 3.0), "M24": (25.0, 39.0, 4.0), "M30": (31.0, 50.0, 4.0), "M36": (37.0, 60.0, 5.0), } # ISO 7093-1:2000 Table 1 (large series, product grade A). DIN EN ISO 7093-1:2000-11, https://fasten.it/norms/norm/din_en_iso_7093-1 ISO_7093 = { "M3": (3.2, 9.0, 0.8), "M3.5": (3.7, 11.0, 0.8), "M4": (4.3, 12.0, 1.0), "M5": (5.3, 15.0, 1.0), "M6": (6.4, 18.0, 1.6), "M8": (8.4, 24.0, 2.0), "M10": (10.5, 30.0, 2.5), "M12": (13.0, 37.0, 3.0), "M14": (15.0, 44.0, 3.0), "M16": (17.0, 50.0, 3.0), "M18": (19.0, 56.0, 4.0), "M20": (21.0, 60.0, 4.0), "M22": (23.0, 66.0, 5.0), "M24": (25.0, 72.0, 5.0), "M27": (30.0, 85.0, 6.0), "M30": (33.0, 92.0, 6.0), "M33": (36.0, 105.0, 6.0), "M36": (39.0, 110.0, 8.0), } # DIN 9021:1990-03 table (https://fasten.it/norms/norm/din_9021; https://www.fasteners.eu/standards/DIN/9021/) (outside diameter about 3 d); only the sizes ISO 7093-1 doesn't have. DIN_9021 = { "M2.5": (2.7, 8.0, 0.8), "M7": (7.4, 22.0, 2.0), } # DIN 440:2001-03 form V (https://fasten.it/norms/norm/din_440, table 0) (square hole, for carriage bolts): (square hole a min, d2 max, nominal h = mid of h min / max) DIN_440_V = { "M5": (5.5, 18.0, 2.0), "M6": (6.6, 22.0, 2.0), "M8": (9.0, 28.0, 3.0), "M10": (11.0, 34.0, 3.0), "M12": (14.0, 44.0, 4.0), "M16": (18.0, 56.0, 5.0), "M20": (22.0, 72.0, 6.0), "M22": (24.0, 80.0, 6.0), } # DIN 433-1:1990-03 table: the sizes below M1.6 that ISO 7092 doesn't have (https://fasten.it/norms/norm/din_433). DIN_433 = { "M1": (1.1, 2.5, 0.3), "M1.2": (1.3, 3.0, 0.3), "M1.4": (1.5, 3.0, 0.3), } # DIN 7349:2009-08 table (washers for bolts with heavy clamping sleeves; https://fasten.it/norms/norm/din_7349, https://www.fasteners.eu/standards/DIN/7349/). DIN_7349 = { "M3": (3.2, 9.0, 1.0), "M4": (4.3, 12.0, 1.6), "M5": (5.3, 15.0, 2.0), "M6": (6.4, 17.0, 3.0), "M8": (8.4, 21.0, 4.0), "M10": (10.5, 25.0, 4.0), "M12": (13.0, 30.0, 6.0), "M14": (15.0, 36.0, 6.0), "M16": (17.0, 40.0, 6.0), "M18": (19.0, 44.0, 8.0), "M20": (21.0, 44.0, 8.0), "M22": (23.0, 50.0, 8.0), "M24": (25.0, 50.0, 10.0), "M27": (28.0, 60.0, 10.0), "M30": (31.0, 68.0, 10.0), } STANDARDS = {"ISO 7089": ISO_7089, "ISO 7091": ISO_7091, "ISO 7092": ISO_7092, "ISO 7093-1": ISO_7093, "DIN 9021": DIN_9021, "DIN 433": DIN_433, "DIN 440 V": DIN_440_V, "DIN 7349": DIN_7349} # material choice: (STEVE material library id, appearance colour) MATERIALS = { "steel": ("steel-generic", "#b9bdc2"), # 200 HV / 300 HV, zinc plated "stainless-a2": ("stainless-304", "#c9ccd0"), # A2 "stainless-a4": ("stainless-316", "#c9ccd0"), # A4 } table = STANDARDS[standard] if size not in table: raise ValueError(f"{standard} has no size {size}; sizes: {', '.join(table)}") d1, d2, h = table[size] material_id, colour = MATERIALS[material] model = Model() with model.sketch("washer_sketch", on="XY", name="Washer") as sk: sk.circle("outside", (0, 0), d2 / 2) if standard == "DIN 440 V": sk.center_rect("hole", (0, 0), d1, d1) else: sk.circle("hole", (0, 0), d1 / 2) model.extrude("washer", "washer_sketch", distance=h, name="Washer") model.material(material_id, color=colour) result = model.result()