steve/hex-head-screw
Hexagon head screw, fully threaded, ISO 4017 / DIN 933, M1.6 to M36, any length, with catalogue sizes as presets.
Pan head screw with cross recess, ISO 7045, M2 to M8, any length.
| 1 | """ISO 7045 pan head screw with cross recess. Envelope: head, a simplified cross recess, plain shank. |
| 2 | The head's bearing face is on the XY plane at the origin; the shank points down -Z. |
| 3 | |
| 4 | Material: stainless steel A2 (AISI 304, 1.4301).""" |
| 5 | from steve import Model |
| 6 | |
| 7 | size = "M3" # Thread size |
| 8 | length = 10 # mm Length under the head |
| 9 | |
| 10 | # size: (head diameter dk, head height k, cross recess number) |
| 11 | HEADS = { |
| 12 | 'M2': (4.0, 1.6, 1), |
| 13 | 'M2.5': (5.0, 2.0, 1), |
| 14 | 'M3': (5.6, 2.4, 1), |
| 15 | 'M4': (8.0, 3.1, 2), |
| 16 | 'M5': (9.5, 3.8, 2), |
| 17 | 'M6': (12.0, 4.6, 3), |
| 18 | 'M8': (16.0, 6.0, 4), |
| 19 | } |
| 20 | NOMINAL = { |
| 21 | 'M2': 2.0, |
| 22 | 'M2.5': 2.5, |
| 23 | 'M3': 3.0, |
| 24 | 'M4': 4.0, |
| 25 | 'M5': 5.0, |
| 26 | 'M6': 6.0, |
| 27 | 'M8': 8.0, |
| 28 | } |
| 29 | dk, k, recess = HEADS[size] |
| 30 | d = NOMINAL[size] |
| 31 | arm = 0.55 * dk |
| 32 | slot = 0.12 * dk |
| 33 | |
| 34 | model = Model() |
| 35 | with model.sketch("head_sketch", on="XY", name="Head") as sk: |
| 36 | sk.circle("head", (0, 0), dk / 2) |
| 37 | model.extrude("head", "head_sketch", distance=k) |
| 38 | with model.sketch("shank_sketch", on="XY", name="Shank") as sk: |
| 39 | sk.circle("shank", (0, 0), d / 2) |
| 40 | model.extrude("shank", "shank_sketch", distance=-length) |
| 41 | model.plane("head_top", on="XY", offset=k, name="Head top") |
| 42 | with model.sketch("cross_x", on="head_top", name="Recess X") as sk: |
| 43 | sk.center_rect("bar", (0, 0), arm, slot) |
| 44 | model.extrude("recess_x", "cross_x", distance=-0.5 * k, op="cut") |
| 45 | with model.sketch("cross_y", on="head_top", name="Recess Y") as sk: |
| 46 | sk.center_rect("bar", (0, 0), slot, arm) |
| 47 | model.extrude("recess_y", "cross_y", distance=-0.5 * k, op="cut") |
| 48 | model.material("stainless-304", finish="polished") # A2 stainless |
| 49 | result = model.result() |
| 50 |
| 1 | name = "steve/pan-head-screw" |
| 2 | version = "1.1.0" |
| 3 | runtime = "steve" |
| 4 | license = "MIT" |
| 5 | summary = "Pan head screw with cross recess, ISO 7045, M2 to M8, any length." |
| 6 | description = "ISO 7045 pan head screw with cross recess. Envelope: head, a simplified cross recess, plain shank.\nThe head's bearing face is on the XY plane at the origin; the shank points down -Z.\n\nMaterial: stainless steel A2 (AISI 304, 1.4301).\n\nDimensions from STEVE's standard-part tables (nominal values of the standard). Envelope geometry: no modelled thread." |
| 7 | tags = ["fastener", "screw", "iso-7045", "metric"] |
| 8 | changes = "Materials and finishes: each part is made of its standard's engineering material, with its usual finish." |
| 9 | |
| 10 | [parameters.size] |
| 11 | type = "choice" |
| 12 | default = "M3" |
| 13 | choices = ["M2", "M2.5", "M3", "M4", "M5", "M6", "M8"] |
| 14 | label = "Thread size" |
| 15 | |
| 16 | [parameters.length] |
| 17 | type = "number" |
| 18 | default = 10 |
| 19 | min = 3 |
| 20 | max = 120 |
| 21 | step = 1 |
| 22 | unit = "mm" |
| 23 | label = "Length" |
| 24 |
ISO 7045 pan head screw with cross recess. Envelope: head, a simplified cross recess, plain shank. The head's bearing face is on the XY plane at the origin; the shank points down -Z. Material: stainless steel A2 (AISI 304, 1.4301). 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.
Hexagon head screw, fully threaded, ISO 4017 / DIN 933, M1.6 to M36, any length, with catalogue sizes as presets.
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.
Captive panel screw envelope, M3 to M5, any length: shank and round knob (simplified).