Sign in with STEVE

steve/metric-nut

Metric nuts: hex ISO 4032, thin ISO 4035, nylon-insert DIN 985, all-metal DIN 980, flange DIN 6923, cap DIN 1587, square DIN 557.

v1.0.0 Latest STEVE MIT 0
Isometric
part.py 134 lines · Python · STEVE runtime · checked
Download
1"""Metric nut: hexagon (ISO 4032), thin (ISO 4035), nylon-insert lock (DIN 985), all-metal lock (DIN 980), flange
2(DIN 6923), domed cap (DIN 1587) or square (DIN 557).
3
4Envelope model for assemblies: the wrenching shape at its nominal (maximum) width across flats s, the height of the
5standard, and a plain bore at the nominal thread diameter d (the thread is not modelled). Lock nuts are the hexagon
6over their full height h (the insert or clamping part is not modelled separately); the flange nut has its flange
7diameter dc and thickness c; the cap nut a hemispherical dome of diameter dk and a blind bore as deep as its thread.
8The bearing face is on the XY plane at the origin, the nut along +Z; hexagon corners lie on the X axis.
9"""
10from steve import Model
11
12style = "hex" # Nut style
13size = "M3" # Thread size
14material = "steel" # Material
15
16NOMINAL = {
17 "M1.6": 1.6, "M2": 2.0, "M2.5": 2.5, "M3": 3.0, "M3.5": 3.5, "M4": 4.0, "M5": 5.0, "M6": 6.0, "M7": 7.0,
18 "M8": 8.0, "M10": 10.0, "M12": 12.0, "M14": 14.0, "M16": 16.0, "M18": 18.0, "M20": 20.0, "M22": 22.0,
19 "M24": 24.0, "M27": 27.0, "M30": 30.0, "M33": 33.0, "M36": 36.0, "M39": 39.0, "M42": 42.0, "M45": 45.0,
20 "M48": 48.0, "M52": 52.0, "M56": 56.0, "M60": 60.0, "M64": 64.0,
21}
22# ISO 4032 Tables 1 and 2 (ISO 4032:1999 as BS EN ISO 4032:2001,
23# https://www.engineersedge.com/hardware/bs_en_iso_4032_hexagon_nuts__14571.htm; https://www.fasteners.eu/standards/ISO/4032/). size: (s max, m max)
24HEX = {
25 "M1.6": (3.2, 1.3), "M2": (4.0, 1.6), "M2.5": (5.0, 2.0), "M3": (5.5, 2.4), "M3.5": (6.0, 2.8),
26 "M4": (7.0, 3.2), "M5": (8.0, 4.7), "M6": (10.0, 5.2), "M8": (13.0, 6.8), "M10": (16.0, 8.4),
27 "M12": (18.0, 10.8), "M14": (21.0, 12.8), "M16": (24.0, 14.8), "M18": (27.0, 15.8), "M20": (30.0, 18.0),
28 "M22": (34.0, 19.4), "M24": (36.0, 21.5), "M27": (41.0, 23.8), "M30": (46.0, 25.6), "M33": (50.0, 28.7),
29 "M36": (55.0, 31.0), "M39": (60.0, 33.4), "M42": (65.0, 34.0), "M45": (70.0, 36.0), "M48": (75.0, 38.0),
30 "M52": (80.0, 42.0), "M56": (85.0, 45.0), "M60": (90.0, 48.0), "M64": (95.0, 51.0),
31}
32# ISO 4035 Tables 1 and 2 (DIN EN ISO 4035:2001-03 = ISO 4035:1999, https://fasten.it/norms/norm/din_en_iso_4035;
33# https://www.engineersedge.com/hardware/bs_en_iso_4035_14574.htm). size: (s max, m max)
34THIN = {
35 "M1.6": (3.2, 1.0), "M2": (4.0, 1.2), "M2.5": (5.0, 1.6), "M3": (5.5, 1.8), "M3.5": (6.0, 2.0),
36 "M4": (7.0, 2.2), "M5": (8.0, 2.7), "M6": (10.0, 3.2), "M8": (13.0, 4.0), "M10": (16.0, 5.0),
37 "M12": (18.0, 6.0), "M14": (21.0, 7.0), "M16": (24.0, 8.0), "M18": (27.0, 9.0), "M20": (30.0, 10.0),
38 "M22": (34.0, 11.0), "M24": (36.0, 12.0), "M27": (41.0, 13.5), "M30": (46.0, 15.0), "M33": (50.0, 16.5),
39 "M36": (55.0, 18.0), "M39": (60.0, 19.5), "M42": (65.0, 21.0), "M45": (70.0, 22.5), "M48": (75.0, 24.0),
40 "M52": (80.0, 26.0), "M56": (85.0, 28.0), "M60": (90.0, 30.0), "M64": (95.0, 32.0),
41}
42# DIN 985:1987-05 table (https://fasten.it/norms/norm/din_985; https://www.fasteners.eu/standards/DIN/985/). size: (s max, h max)
43NYLON = {
44 "M3": (5.5, 4.0), "M4": (7.0, 5.0), "M5": (8.0, 5.0), "M6": (10.0, 6.0), "M7": (11.0, 7.5), "M8": (13.0, 8.0),
45 "M10": (17.0, 10.0), "M12": (19.0, 12.0), "M14": (22.0, 14.0), "M16": (24.0, 16.0), "M18": (27.0, 18.5),
46 "M20": (30.0, 20.0), "M22": (32.0, 22.0), "M24": (36.0, 24.0), "M27": (41.0, 27.0), "M30": (46.0, 30.0),
47 "M33": (50.0, 33.0), "M36": (55.0, 36.0), "M39": (60.0, 39.0), "M42": (65.0, 42.0), "M45": (70.0, 45.0),
48 "M48": (75.0, 48.0),
49}
50# DIN 980:1987-05 table, all-metal prevailing torque nut (https://fasten.it/norms/norm/din_980; https://www.fasteners.eu/standards/DIN/980/). size: (s max, h max)
51ALL_METAL = {
52 "M3": (5.5, 3.7), "M4": (7.0, 4.2), "M5": (8.0, 5.1), "M6": (10.0, 6.0), "M7": (11.0, 7.0), "M8": (13.0, 8.0),
53 "M10": (17.0, 10.0), "M12": (19.0, 12.0), "M14": (22.0, 14.0), "M16": (24.0, 16.0), "M18": (27.0, 18.0),
54 "M20": (30.0, 20.0), "M22": (32.0, 22.0), "M24": (36.0, 24.0), "M27": (41.0, 27.0), "M30": (46.0, 30.0),
55 "M33": (50.0, 33.0), "M36": (55.0, 36.0), "M39": (60.0, 39.0),
56}
57# DIN 6923:1983-06 table (s, m, dc: https://fasten.it/norms/norm/din_6923; c min: https://www.fasteners.eu/standards/DIN/6923/). size: (s max, m max, flange diameter dc max, flange thickness c min)
58FLANGE = {
59 "M5": (8.0, 5.0, 11.8, 1.0), "M6": (10.0, 6.0, 14.2, 1.1), "M8": (13.0, 8.0, 17.9, 1.2),
60 "M10": (15.0, 10.0, 21.8, 1.5), "M12": (18.0, 12.0, 26.0, 1.8), "M14": (21.0, 14.0, 29.9, 2.1),
61 "M16": (24.0, 16.0, 34.5, 2.4), "M20": (30.0, 20.0, 42.8, 3.0),
62}
63# DIN 1587:2000-10 table (https://www.fasteners.eu/standards/DIN/1587/; M10 m 8 as in fasten.it's fine-thread table and
64# https://www.fabory.com/en-GB/p/47340100001, fasteners.eu's 8,8 contradicts its own m min 7,64). size: (s max, hexagon height m max, overall height h max, dome diameter dk max, thread depth t max)
65CAP = {
66 "M4": (7.0, 3.2, 8.0, 6.5, 5.74), "M5": (8.0, 4.0, 10.0, 7.5, 7.79), "M6": (10.0, 5.0, 12.0, 9.5, 8.29),
67 "M8": (13.0, 6.5, 15.0, 12.5, 11.35), "M10": (16.0, 8.0, 18.0, 15.0, 13.35), "M12": (18.0, 10.0, 22.0, 17.0, 16.35),
68 "M14": (21.0, 11.0, 25.0, 20.0, 18.35), "M16": (24.0, 13.0, 28.0, 23.0, 21.42), "M18": (27.0, 15.0, 32.0, 26.0, 25.42),
69 "M20": (30.0, 16.0, 34.0, 28.0, 26.42), "M22": (34.0, 18.0, 39.0, 33.0, 29.42), "M24": (36.0, 19.0, 42.0, 34.0, 31.5),
70}
71# DIN 557:1994-01 table, product grade C (https://fasten.it/norms/norm/din_557; https://www.fasteners.eu/standards/DIN/557/). size: (s max, m max)
72SQUARE = {
73 "M5": (8.0, 4.0), "M6": (10.0, 5.0), "M8": (13.0, 6.5), "M10": (17.0, 8.0), "M12": (19.0, 10.0), "M16": (24.0, 13.0),
74}
75STYLES = {"hex": HEX, "thin": THIN, "nylon-insert": NYLON, "all-metal": ALL_METAL, "flange": FLANGE, "cap": CAP,
76 "square": SQUARE}
77STANDARDS = {"hex": "ISO 4032", "thin": "ISO 4035", "nylon-insert": "DIN 985", "all-metal": "DIN 980",
78 "flange": "DIN 6923", "cap": "DIN 1587", "square": "DIN 557"}
79# material choice: (STEVE material library id, appearance colour)
80MATERIALS = {
81 "steel": ("steel-generic", "#b9bdc2"), # property class 8 / 10, zinc plated
82 "stainless-a2": ("stainless-304", "#c9ccd0"), # ISO 3506-2 A2
83 "stainless-a4": ("stainless-316", "#c9ccd0"), # ISO 3506-2 A4
84}
85
86table = STYLES[style]
87if size not in table:
88 raise ValueError(f"{STANDARDS[style]} has no size {size}; sizes: {', '.join(table)}")
89row = table[size]
90s = row[0]
91d = NOMINAL[size]
92material_id, colour = MATERIALS[material]
93
94model = Model()
95if style == "square":
96 height = row[1]
97 with model.sketch("body_sketch", on="XY", name="Square") as sk:
98 sk.center_rect("square", (0, 0), s, s)
99 sk.circle("bore", (0, 0), d / 2)
100 model.extrude("body", "body_sketch", distance=height, name="Nut")
101elif style == "flange":
102 height, dc, c = row[1], row[2], row[3]
103 with model.sketch("flange_sketch", on="XY", name="Flange") as sk:
104 sk.circle("flange_circle", (0, 0), dc / 2)
105 model.extrude("flange", "flange_sketch", distance=c, name="Flange")
106 with model.sketch("hex_sketch", on="XY", name="Hexagon") as sk:
107 sk.polygon("hex", (0, 0), s / 2, 6, inscribed=False)
108 model.extrude("body", "hex_sketch", distance=height, name="Hexagon")
109 with model.sketch("bore_sketch", on="XY", name="Bore") as sk:
110 sk.circle("bore", (0, 0), d / 2)
111 model.extrude("bore", "bore_sketch", distance=height, op="cut", name="Bore")
112elif style == "cap":
113 m, height, dk, t = row[1], row[2], row[3], row[4]
114 r = dk / 2
115 with model.sketch("hex_sketch", on="XY", name="Hexagon") as sk:
116 sk.polygon("hex", (0, 0), s / 2, 6, inscribed=False)
117 model.extrude("body", "hex_sketch", distance=m, name="Hexagon")
118 with model.sketch("dome_profile", on="XZ", name="Dome profile") as sk:
119 sk.polyline("dome_side", [(0, m), (r, m), (r, height - r)], closed=False)
120 sk.arc("dome_arc", (0, height - r), r, 0, 90)
121 sk.line("dome_axis", (0, height), (0, m))
122 model.revolve("dome", "dome_profile", axis="Z", name="Dome")
123 with model.sketch("bore_sketch", on="XY", name="Bore") as sk:
124 sk.circle("bore", (0, 0), d / 2)
125 model.extrude("bore", "bore_sketch", distance=t, op="cut", name="Thread bore")
126else:
127 height = row[1]
128 with model.sketch("body_sketch", on="XY", name="Hexagon") as sk:
129 sk.polygon("hex", (0, 0), s / 2, 6, inscribed=False)
130 sk.circle("bore", (0, 0), d / 2)
131 model.extrude("body", "body_sketch", distance=height, name="Nut")
132model.material(material_id, color=colour)
133result = model.result()
134

Metric coarse-thread nuts in seven styles, with catalogue sizes as presets. Envelope geometry for assemblies: the wrenching shape at its nominal width across flats, the standard's height and a plain bore at the nominal thread diameter; the thread is not modelled. Lock nuts are shown as the hexagon over their full height. The bearing face is on the XY plane at the origin and the nut extends along +Z. Each style has the sizes of its standard (see the README for the tables and their sources).

Metric nut (ISO 4032, ISO 4035, DIN 985, DIN 980, DIN 6923, DIN 1587, DIN 557)

Metric coarse-thread nuts in seven styles, with catalogue sizes as presets (hex nut M3, nylon-insert lock nut M8, ...).

Geometry

Envelope for assemblies and clearance checks; the thread is not modelled (plain bore at the nominal diameter d).

  • hex, thin, all-metal, nylon-insert: hexagon prism, width across flats s (nominal = max), height m (hex, thin) or the full nut height h (lock nuts: the clamping part or nylon insert is inside that envelope and not modelled separately);
  • flange: hexagon (s, m) on a flange disc of diameter dc max and thickness c min (the flange's conical top is not modelled);
  • cap: hexagon (s, m max) with a cylinder and hemispherical dome of diameter dk up to the overall height h, and a blind bore as deep as the thread length t max;
  • square: square prism s × s, height m.

The bearing face is on the XY plane at the origin and the nut extends along +Z; hexagon corners lie on the X axis.

Parameters

Parameter Meaning
style hex, thin, nylon-insert, all-metal, flange, cap, square
size Thread size; each style has the sizes of its standard (tables below)
material steel (zinc plated), stainless-a2, stainless-a4 (ISO 3506-2)

Sources

Dimensions are the standards' tables (mm), read from the reproductions on fasten.it ("reproduced by permission of DIN"), fasteners.eu and EngineersEdge; each table below names its sources.

hex: ISO 4032, Table 1 and Table 2 (non-preferred sizes)

ISO 4032:1999 as BS EN ISO 4032:2001 (https://www.engineersedge.com/hardware/bs_en_iso_4032_hexagon_nuts__14571.htm), checked against https://www.fasteners.eu/standards/ISO/4032/ and fasten.it's DIN EN ISO 4032 2001-03 / 2013-04 tables (https://fasten.it/norms/norm/din_en_iso_4032). fasten.it gives m 5 for M6 and 19 for M24 (DIN 934 heights); the values below (5.2, 21.5) are those of the other sources and of Fabory's ISO 4032 product pages (https://www.fabory.com/en-GB/p/01104060001, https://www.fabory.com/en-GB/p/01104240001). ISO 4032 has since been revised (2012, 2023); no reproduction of those tables was found, so the edition matched is ISO 4032:1999.

Size s max m max
M1.6 3.2 1.3
M2 4 1.6
M2.5 5 2
M3 5.5 2.4
M3.5 6 2.8
M4 7 3.2
M5 8 4.7
M6 10 5.2
M8 13 6.8
M10 16 8.4
M12 18 10.8
M14 21 12.8
M16 24 14.8
M18 27 15.8
M20 30 18
M22 34 19.4
M24 36 21.5
M27 41 23.8
M30 46 25.6
M33 50 28.7
M36 55 31
M39 60 33.4
M42 65 34
M45 70 36
M48 75 38
M52 80 42
M56 85 45
M60 90 48
M64 95 51
thin: ISO 4035, Tables 1 and 2

DIN EN ISO 4035:2001-03 (= ISO 4035:1999), https://fasten.it/norms/norm/din_en_iso_4035; also BS EN ISO 4035 (https://www.engineersedge.com/hardware/bs_en_iso_4035_14574.htm, M1.6 to M60). No reproduction of the 2012 or 2023 editions was found, so the edition matched is ISO 4035:1999.

Size s max m max
M1.6 3.2 1
M2 4 1.2
M2.5 5 1.6
M3 5.5 1.8
M3.5 6 2
M4 7 2.2
M5 8 2.7
M6 10 3.2
M8 13 4
M10 16 5
M12 18 6
M14 21 7
M16 24 8
M18 27 9
M20 30 10
M22 34 11
M24 36 12
M27 41 13.5
M30 46 15
M33 50 16.5
M36 55 18
M39 60 19.5
M42 65 21
M45 70 22.5
M48 75 24
M52 80 26
M56 85 28
M60 90 30
M64 95 32
nylon-insert: DIN 985:1987-05 (prevailing torque type hexagon thin nuts with non-metallic insert)

https://fasten.it/norms/norm/din_985; M3 to M18 also https://www.fasteners.eu/standards/DIN/985/.

Size s max h max
M3 5.5 4
M4 7 5
M5 8 5
M6 10 6
M7 11 7.5
M8 13 8
M10 17 10
M12 19 12
M14 22 14
M16 24 16
M18 27 18.5
M20 30 20
M22 32 22
M24 36 24
M27 41 27
M30 46 30
M33 50 33
M36 55 36
M39 60 39
M42 65 42
M45 70 45
M48 75 48
all-metal: DIN 980:1987-05 (prevailing torque type hexagon nuts, all-metal)

https://fasten.it/norms/norm/din_980, https://www.fasteners.eu/standards/DIN/980/.

Size s max h max
M3 5.5 3.7
M4 7 4.2
M5 8 5.1
M6 10 6
M7 11 7
M8 13 8
M10 17 10
M12 19 12
M14 22 14
M16 24 16
M18 27 18
M20 30 20
M22 32 22
M24 36 24
M27 41 27
M30 46 30
M33 50 33
M36 55 36
M39 60 39
flange: DIN 6923:1983-06 (hexagon nuts with flange)

s, m, dc: https://fasten.it/norms/norm/din_6923; c min: https://www.fasteners.eu/standards/DIN/6923/ (the only source found for c).

Size s max m max dc max c min
M5 8 5 11.8 1
M6 10 6 14.2 1.1
M8 13 8 17.9 1.2
M10 15 10 21.8 1.5
M12 18 12 26 1.8
M14 21 14 29.9 2.1
M16 24 16 34.5 2.4
M20 30 20 42.8 3
cap: DIN 1587:2000-10 (hexagon domed cap nuts)

https://www.fasteners.eu/standards/DIN/1587/, checked against https://fasten.it/norms/norm/din_1587 and Dresselhaus (https://eshop.dresselhaus.de/en/Standardisation-overview/DIN-1587.html). M10 m is 8: fasteners.eu prints 8,8 but its own m min (7,64) fits 8, and fasten.it's fine-thread table (M10 × 1.25: 8.00) and Fabory (https://www.fabory.com/en-GB/p/47340100001) give 8.

Size s max m max h max dk max t max
M4 7 3.2 8 6.5 5.74
M5 8 4 10 7.5 7.79
M6 10 5 12 9.5 8.29
M8 13 6.5 15 12.5 11.35
M10 16 8 18 15 13.35
M12 18 10 22 17 16.35
M14 21 11 25 20 18.35
M16 24 13 28 23 21.42
M18 27 15 32 26 25.42
M20 30 16 34 28 26.42
M22 34 18 39 33 29.42
M24 36 19 42 34 31.5
square: DIN 557:1994-01 (square nuts, product grade C)

https://fasten.it/norms/norm/din_557, https://www.fasteners.eu/standards/DIN/557/.

DIN 557 lists M10 and M12 with two widths across flats (16 / 17 and 18 / 19 mm), both in both sources, neither marked preferred; this recipe uses 17 and 19 mm.

Size s max m max
M5 8 4
M6 10 5
M8 13 6.5
M10 17 8
M12 19 10
M16 24 13

Corrected in this audit: DIN 1587 M10 m 8.8 -> 8.

Preset list: sizes of the step.parts catalogue (MIT), see library/NOTICE.md. The catalogue's nylon-insert, all-metal and flange nuts name no standard; their presets use DIN 985, DIN 980 and DIN 6923, the standards for those nut types, and sizes outside those standards (M2 to M4 flange nuts, M2 and M2.5 lock nuts) have no preset.

  1. 1.0.0 Latest
More #fastener
STEVEMIT

steve/hex-nut

Hex nut, ISO 4032, M2 to M12.

7 9 variants 0 2 days ago v1.1.0
STEVEMIT

steve/inch-nut

Hex, jam and square nuts, inch, ASME B18.2.2: machine screw nuts #0 to #10, hex, jam and square nuts 1/4 to 1/2 in.

0 38 sizes 0 1 day ago v1.0.0
STEVEMIT

steve/inch-specialty-nut

Inch lock, flange and acorn nuts: nylon-insert and all-metal (ASME B18.16.6), hex flange (ASME B18.2.2), acorn (SAE J483).

0 51 sizes 0 1 day ago v1.0.0
STEVEMIT

steve/hex-head-screw

Hexagon head screw, fully threaded, ISO 4017 / DIN 933, M1.6 to M36, any length, with catalogue sizes as presets.

18 85 sizes 0 1 day ago v2.0.0