steve/inch-hex-head-screw
Hex head screw, inch: ASME B18.2.1 hex cap screws 1/4 to 1/2 in, B18.6.3 hex machine screws #2 to #10, any length.
| 1 | """ISO 4017 (DIN 933) hex head screw, fully threaded. Envelope: hex head and plain shank. |
| 2 | The head's bearing face is on the XY plane at the origin; the shank points down -Z.""" |
| 3 | from steve import Model |
| 4 | |
| 5 | size = "M6" # Thread size |
| 6 | length = 20 # mm Length under the head |
| 7 | |
| 8 | # size: (across flats s, head height k) |
| 9 | HEADS = { |
| 10 | 'M3': (5.5, 2.0), |
| 11 | 'M4': (7.0, 2.8), |
| 12 | 'M5': (8.0, 3.5), |
| 13 | 'M6': (10.0, 4.0), |
| 14 | 'M8': (13.0, 5.3), |
| 15 | 'M10': (16.0, 6.4), |
| 16 | 'M12': (18.0, 7.5), |
| 17 | } |
| 18 | NOMINAL = { |
| 19 | 'M3': 3.0, |
| 20 | 'M4': 4.0, |
| 21 | 'M5': 5.0, |
| 22 | 'M6': 6.0, |
| 23 | 'M8': 8.0, |
| 24 | 'M10': 10.0, |
| 25 | 'M12': 12.0, |
| 26 | } |
| 27 | s, k = HEADS[size] |
| 28 | d = NOMINAL[size] |
| 29 | |
| 30 | model = Model() |
| 31 | with model.sketch("head_sketch", on="XY", name="Head") as sk: |
| 32 | sk.polygon("hex", (0, 0), s / 2, 6, inscribed=False) |
| 33 | model.extrude("head", "head_sketch", distance=k) |
| 34 | with model.sketch("shank_sketch", on="XY", name="Shank") as sk: |
| 35 | sk.circle("shank", (0, 0), d / 2) |
| 36 | model.extrude("shank", "shank_sketch", distance=-length) |
| 37 | result = model.result() |
| 38 |
| 1 | name = "steve/hex-head-screw" |
| 2 | version = "1.0.0" |
| 3 | runtime = "steve" |
| 4 | license = "MIT" |
| 5 | summary = "Hex head screw, ISO 4017 / DIN 933, M3 to M12, any length." |
| 6 | description = "ISO 4017 (DIN 933) hex head screw, fully threaded. Envelope: hex head and plain shank.\nThe head's bearing face is on the XY plane at the origin; the shank points down -Z.\n\nDimensions from STEVE's standard-part tables (nominal values of the standard). Envelope geometry: no modelled thread." |
| 7 | tags = ["fastener", "screw", "bolt", "iso-4017", "din-933", "metric"] |
| 8 | |
| 9 | [parameters.size] |
| 10 | type = "choice" |
| 11 | default = "M6" |
| 12 | choices = ["M3", "M4", "M5", "M6", "M8", "M10", "M12"] |
| 13 | label = "Thread size" |
| 14 | |
| 15 | [parameters.length] |
| 16 | type = "number" |
| 17 | default = 20 |
| 18 | min = 3 |
| 19 | max = 120 |
| 20 | step = 1 |
| 21 | unit = "mm" |
| 22 | label = "Length" |
| 23 |
ISO 4017 (DIN 933) hex head screw, fully threaded. Envelope: hex head and plain shank. The head's bearing face is on the XY plane at the origin; the shank points down -Z. Dimensions from STEVE's standard-part tables (nominal values of the standard). Envelope geometry: no modelled thread.
Materials and finishes: each part is made of its standard's engineering material, with its usual finish.
Hex head screw, inch: ASME B18.2.1 hex cap screws 1/4 to 1/2 in, B18.6.3 hex machine screws #2 to #10, any length.
Hexagon socket button head screw, ISO 7380-1, M3 to M16, any length, with catalogue sizes as presets.
Hexagon socket countersunk head screw, ISO 10642 / DIN 7991, M3 to M12, any length, with catalogue sizes as presets.
Pan head screw with cross recess, ISO 7045, M2 to M8, any length.