mechanism_kinematics
Computes closed-form planar mechanism kinematics for four-bar, slider-crank, and Gruebler linkages, validating link closure and reachable positions before simulation.
Instructions
Closed-form planar mechanism kinematics — exact, NO external solver (the static
pre-check / gate for mechanism_simulate_submit). Pick mechanism:
'fourbar': link lengths crank/coupler/rocker/ground -> {mobility_dof (=1), grashof: {condition, type, input_crank_fully_rotates, shortest}, reachable, n_reached, coupler_path [[x,y]...], reachable_bbox_mm}.
config'open'|'crossed'.'slider_crank': crank_mm/conrod_mm (+ wrist_offset_mm) -> {stroke_mm (exactly 2·R in-line, independent of conrod), x_tdc_mm, x_bdc_mm, inline_stroke_exact}.
'gruebler': n_links (incl. ground) + joints ([{type}...]) -> {mobility_dof}.
Returns the per-mechanism dict above. Raises on an unknown mechanism or a link set that cannot close.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| crank | No | ||
| config | No | open | |
| ground | No | ||
| joints | No | ||
| planar | No | ||
| rocker | No | ||
| coupler | No | ||
| n_links | No | ||
| n_steps | No | ||
| crank_mm | No | ||
| conrod_mm | No | ||
| mechanism | No | fourbar | |
| wrist_offset_mm | No |