Skip to content

refactor(visualization): honor the G92 reference frame in the plotter (S4) - #287

Merged
CameronBrooks11 merged 1 commit into
mainfrom
refactor/motion-ir-plotter-g92
Jun 28, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
refactor/motion-ir-plotter-g92

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

S4 of #136 — closes #286.

_collect_segments now applies SET_POSITION (G92) by resetting tracked position to the move targets — identical to nominal_metrics, so every IR consumer interprets G92 the same way. Previously the plotter ignored G92 and drew a ~96,865° backward sweep at x=0 at each zero_axes boundary (mandrel A is absolute/cumulative, reaching ~97,225°), shredded into a vertical bar of spurious bands.

Pattern preserved, artifact removed (proven by multiset diff)

For simple_cylinder: the first 1147 segments are byte-identical; the 144 removed segments all start at x=0 (the artifact), and the 2 added (also x=0) are the real return rotation. segments_rendered 1291→1149 (1973→1803, 36935→36368, 76486→76165 for the others).

Reviewable delta — plot half of sim_plot_snapshot.json regenerated

Only digest + segments_rendered change; the sim half is untouched (S3 owns it), as are mandrel_length_mm/tow_width_mm. The two pinned plotter assertions (SIMPLE_CYLINDER_SIGNATURE_DIGEST, segments_rendered) are updated deliberately.

Other

Example G-code byte-equal · plot route returns a PNG (no OpenAPI drift) · 153 passed · ruff/format/mypy clean.

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

`_collect_segments` now applies `SET_POSITION` (G92) by resetting the tracked
position to the move's targets — exactly as `nominal_metrics` does — so every IR
consumer interprets G92 identically. Previously the plotter ignored G92, so at each
`zero_axes` boundary it drew a ~96,865° backward sweep at x=0 (mandrel A values are
absolute/cumulative, reaching ~97,225°), which `_split_segment` shredded into a
vertical bar of spurious bands.

The change preserves 100% of the winding pattern: for simple_cylinder the first
1147 segments are byte-identical; the 144 removed segments all start at x=0 (the
artifact), and the 2 added (also x=0) are the real return rotation. segments_rendered
drops 1291->1149 (and similarly for the other goldens).

Regenerates the plot half of `sim_plot_snapshot.json` (digest + segments_rendered);
the sim half is untouched. Updates the two pinned plotter assertions. Example G-code
stays byte-equal; plot route returns a PNG (no OpenAPI drift).

Closes #286. Part of #136.
@CameronBrooks11
CameronBrooks11 merged commit 97b3679 into main Jun 28, 2026
21 checks passed
@CameronBrooks11
CameronBrooks11 deleted the refactor/motion-ir-plotter-g92 branch June 28, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant