Motor
Component kindmotor(categorymech, DSL namemotor, API v1)
Rotational source. Produces a constant RPM on its axis port every tick; connecting a shaft or gear via mech.couple / mech.mesh drives the downstream chain.
Parameters
- `rpm` — Rotational speed at the axis port (RPM). Signed — negative spins the other way.
- `bodyLength` — Motor body length along Z (mm, visual only).
- `bodyDiameter` — Motor body diameter (mm, visual only).
- `shaftLength` — Output shaft length sticking out of the body (mm, visual only).
- `shaftDiameter` — Output shaft diameter (mm, visual only).
Parameters schema
| Parameter | Type | Default | Constraints |
|---|---|---|---|
rpm | Number | 30 | |
bodyLength | Number | 40 | |
bodyDiameter | Number | 30 | |
shaftLength | Number | 15 | |
shaftDiameter | Number | 8 | |
color | String | — |
Ports
| Port | Type | Description |
|---|---|---|
axis | rotational | Rotational output. The motor seeds this port every tick. |
Kinematics
Source. Auto-registers a driver with { rpm: params.rpm } on the axis port — no mech.drive(...) needed.
Example
motor "M1" {
rpm: 60
at: position(0, 0, -50)
}
engine apiVersion · 1
Want to see this component in 3D with live parameter controls?
Open the interactive preview.