Skip to content

S4 — plotter honors the G92 reference frame (remove the boundary artifact) #286

Closed

Description

@CameronBrooks11

Slice S4 of #136 — make the plotter honor the G92 reference frame, mirroring the simulator (S3) and nominal_metrics.

Problem (proven in the goldens)

The plotter's _collect_segments still ignores SET_POSITION (an output-preserving carryover from S-bnd). Mandrel A values in the G-code are absolute/cumulative (they reach ~97,225° — ~270 turns — in a hoop layer); zero_axes folds them with G92 X0 A<angle%360> / G0 A360 / G92 A0. Ignoring the G92 makes the plotter draw a ~96,865° backward sweep at x=0 at every zero_axes boundary, which _split_segment shreds into a vertical bar of spurious bands.

Evidence

Reconstructing the current code path reproduces the committed segments_rendered==1291 (simple_cylinder) exactly. A G92-aware variant yields 1149. The multiset diff:

  • first 1147 segments byte-identical (the entire main winding pattern is untouched),
  • 144 removed segments all start at x=0.0 (the backward-sweep artifact),
  • 2 new segments (also x=0.0): the real 334° return rotation the machine performs at the parked end.

Approach

Add the SET_POSITION branch to _collect_segments (reset tracked x,y to the move targets — identical to nominal_metrics). G92 is then honored coherently across every IR consumer.

Acceptance

  • _collect_segments resets position on SET_POSITION; the artifact bar is gone.
  • Regenerate the plot half of tests/sim_plot_snapshot.json (the sim half is untouched — S3 owns it).
  • Update the two pinned plotter assertions in tests/visualization/test_plotter.py: segments_rendered 1291→1149 and SIMPLE_CYLINDER_SIGNATURE_DIGEST (deliberate, reviewed).
  • test_example_goldens byte-equal (untouched) · ruff + mypy clean · no OpenAPI drift (plot route returns a PNG; shape unchanged).

Part of #136. Follows S3 (#284); precedes S5 (delete dead scaffolding incl. unused dump_header + CI guard against duplicate motion-math).

Activity

  1. added
    python
    on Jun 28, 2026
  2. added a commit that references this issue on Jun 28, 2026
    97b3679
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

    python

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions