step.motion.path.passes ======================= .. py:module:: step.motion.path.passes .. autoapi-nested-parse:: Compiler passes for the motion path pipeline. Each pass is a callable transform from one IR node list to another. The default pipeline runs lowering → merge → corner-cut, with spline as an opt-in terminal transform. Public API: LoweringPass, MergePass, CornerCutPass, SplineConversionPass — pass classes optimize_nodes(nodes, *, merge, corner_cut_m) — legacy helper Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/step/motion/path/passes/absolute_heading/index /autoapi/step/motion/path/passes/contract/index /autoapi/step/motion/path/passes/corner_cut/index /autoapi/step/motion/path/passes/decompose/index /autoapi/step/motion/path/passes/known_distance/index /autoapi/step/motion/path/passes/lowering/index /autoapi/step/motion/path/passes/merge/index /autoapi/step/motion/path/passes/resolve_heading/index /autoapi/step/motion/path/passes/spline/index /autoapi/step/motion/path/passes/to_absolute/index /autoapi/step/motion/path/passes/velocity_profile/index Functions --------- .. autoapisummary:: step.motion.path.passes.optimize_nodes Package Contents ---------------- .. py:function:: optimize_nodes(nodes: list[step.motion.path.ir.PathNode | None], *, merge: bool, corner_cut_m: float) -> list[step.motion.path.ir.PathNode | None] Apply optimization passes to a flattened path node list. ``SideAction`` and ``None`` (deferred) barriers are preserved and never optimized across — they pin the execution point of side effects and runtime-resolved steps. Passes (applied in order when enabled): 1. **Merge** (``merge=True``): collapse adjacent same-type segments that have no conditions and known endpoints. Same-axis/same-direction linears sum their distances; consecutive turns sum their angles. 2. **Corner cut** (``corner_cut_m > 0``): replace ``linear + turn + linear`` triples with ``linear + arc + linear``. The arc radius is derived from the cut distance via ``R = cut_m / tan(|θ| / 2)``.