feat(renderer): opt-in retraction/deretraction markers (E9 phase 1, #148) - #168
Merged
Merged
Conversation
) DD-009 D1 (amended at implementation — see the DD). The premise that the IR already positioned retractions was wrong: E-only retraction moves emit no segment, so retractions existed only as stats counts. Corrected with a small additive IR change. - toolpath-core: new sparse `retractions` events channel on ToolpathIR ({x,y,z,kind,srcByte,segIndex}, origin-relative), kept OUT of the main segment stream so segment indices/scrub/layer ranges are untouched; builder.addRetraction(); capability `retractions`. - gcode-parser: records retract (E<0) / unretract (E>0) events with position + segIndex; capability known when present, else unavailable. Partial-preview slices carry none (markers resolve on the final IR). - gcode-renderer-three: opt-in always-on-top Points marker layer (setShowRetractions; warm=retract, cool=unretract), clipped to the current layer/scrub window; hasRetractions getter; raw printer coords (root rotation handles Z-up→Y-up, cf. updateMarker); excluded from clearToolpathGeometry (owns its lifecycle). - controller + Vue/React/Svelte adapters: showRetractions option/prop (default off). Demo: a Show-retractions toggle, enabled only when the IR carries events. Tests: parser event recording (position/kind/segIndex/origin-relative, no extra segments); renderer markers (off by default, capability-gated, scrub-clipped). Native goldens regenerated (additive retractions capability only; geometry unchanged). Verified LIVE in-browser: calicat markers land on object boundaries/seams (warm/cool), toggle drives 0→thousands of marker pixels. Refs #148, #162, DD-009 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First E9 implementation phase (DD-009 D1).
Flagged deviation, maintainer-approved: D1's premise — that the IR already records Retract/Unretract kinds — was wrong. E-only retractions emit no segment; they existed only as stats counts. I verified this and, per your approval, added a small additive IR change: a sparse
retractionsevents channel ({x,y,z,kind,srcByte,segIndex}, origin-relative) kept out of the main segment stream, so segment indices, scrub, and layer ranges are untouched. Recorded as a D1 amendment in the DD.retractions: known|unavailable.setShowRetractions, warm=retract / cool=unretract), clipped by the layer/scrub window; capability-honest.showRetractionsprop (default off). Demo gains a toggle, enabled only when the IR has events.Verified live in-browser (calicat): markers land exactly on object boundaries/seams; the toggle drives 0 → thousands of marker pixels. Focused parser + renderer tests added. Native goldens regenerated — additive
retractionscapability only, geometry unchanged (5 FDM prints now reportknown, CNC/edgeunavailable).Refs #148 · #162 · DD-009
🤖 Generated with Claude Code