Skip to content

feat(planning): define the typed Motion IR (Move/MoveKind/Program/ProgramMeta) #273

Closed

Description

@CameronBrooks11

Stage 1 Motion IR — slice S1. Part of #136. Pure addition, no behavior change.

Introduce the typed, machine-agnostic toolpath vocabulary that the rest of the epic (and Stage 2 #137 / Stage 3a #138) lowers to.

Scope

  • New module fiberpath/planning/ir.py:
    • MoveKind enum: RAPID (→ G0 X.. A.. B.., also the all-zero init move) · SET_FEED (→ G0 F<rate>, a feed-rate state op) · SET_POSITION (→ G92 <subset>) · COMMENT (→ ; text).
    • Move (frozen): kind, targets: dict[Axis,float] (absolute, ordered), feed: float|None, text: str|None.
    • ProgramMeta: mandrel_diameter, wind_length, tow_width, tow_thickness.
    • Program: meta, moves: list[Move].
  • Reuse helpers.Axis — no X/A/B letters in the IR.
  • Unit tests: field defaults, targets insertion-order preservation, construction of each kind.

Deviations from the original #136 proposal (all to preserve byte-equality; verified against an 818k-line opcode histogram — only G0/G92/comments are ever emitted)

  • Drop lay — not emitted today; contributes nothing to G-code/time/tow and would change the plot signature. Defer to Stage 2 (skip-as-primitive).
  • Add the Program/ProgramMeta wrapper — the ; Parameters {json} header data must travel structurally so consumers stop re-parsing it; a bare list[Move] can't satisfy that.
  • SET_FEED emits G0 F…, not a G1 cutting move — there is no rapid-vs-feed distinction and no G1 today.
  • G92, not M92 for set-position.
  • Never emit the dead G21/G94 prologue.

Acceptance

  • Module imports cleanly; unit tests pass.
  • No change to any emitted G-code / simulator / plotter output; existing suite + the P1 golden test stay green.
  • grep confirms no other module imports the IR yet (pure addition).

Activity

  1. added
    enhancement
    python
    on Jun 28, 2026
  2. added a commit that references this issue on Jun 28, 2026
    9e87c4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpython

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions