Spur gear
Component kindspur-gear(categorymech, DSL namespurGear, API v1)
Cylindrical gear with straight teeth. The canonical mechanical building block: mates with other spur gears of the same module via mech.mesh.
Parameters
- `module` — Tooth module (mm per tooth). Two meshing gears must share the same module.
- `teeth` — Tooth count. Must be ≥ 4. Pitch radius = module × teeth / 2.
- `width` — Face width along the spin axis (mm).
- `boreDiameter` — Central bore diameter (mm), for mounting on a shaft.
- `pressureAngle` — Tooth pressure angle (deg). Standard is 20°.
Parameters schema
| Parameter | Type | Default | Constraints |
|---|---|---|---|
module | Number | 2 | |
teeth | Number | 20 | min: 4 |
width | Number | 10 | |
boreDiameter | Number | 8 | |
pressureAngle | Number | 20 | |
color | String | — |
Ports
| Port | Type | Description |
|---|---|---|
axis | rotational | Spin axis (rotational). Receives ω from the coupling or mesh propagation. |
Kinematics
Mesh rule: ω_driven = -ω_driver · (teeth_driver / teeth_driven). Sign flips because meshed gears spin opposite ways.
Example
spurGear "G1" {
teeth: 20
module: 2
at: position(0, 0, 0)
}
engine apiVersion · 1
Want to see this component in 3D with live parameter controls?
Open the interactive preview.