Repository navigation
feat(renderer): setFeatureRoleVisible — hide/show a feature role (hide brim/skirt) - #423
Merged
Merged
Conversation
Adds a per-feature-role visibility toggle (AnyBridge "hide adhesion" request). Unlike the whole-chunk move-kind toggle, feature roles live per-segment inside the extrusion geometry, so hidden segments are collapsed to NaN positions (the GPU discards them) and restored byte-for-byte when shown again. - gcode-renderer-three: ToolpathRenderer.setFeatureRoleVisible(role, visible) + getHiddenFeatureRoles(); applied at the three mesh-creation sites and on toggle, not in the per-frame draw-state loop (scrub stays cheap). Extrude-only; no base copy saved and geometry byte-identical when never used. - gcode-preview-core: optional setFeatureRoleVisible on PreviewRenderer (2D no-op) + GcodePreviewControls.setFeatureRoleVisible passthrough. - toolpath-core: export FeatureRoleValue. - demo: "Hide brim/skirt (declutter)" toggle, gated on featureRoles === 'known'. - Tests: hide→NaN / show→restore byte-for-byte / unused→byte-identical / travel-unaffected. Verified live in tubes (SwiftShader): hiding a present role collapsed 32,805 vertices and restored to 0. Lockstep minor. Gate the UI on capabilities.featureRoles === 'known'. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ble tsdoc FeatureRole (the value) isn't imported in scene.ts (only the FeatureRoleValue type), so the @link couldn't resolve and tripped the API-reference warning gate. Plain code span instead. API build back to 4/4 within budget. 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.
Owner-approved feature from the AnyBridge 0.18.0 collaboration: a per-feature-role visibility toggle so a consumer can offer "hide adhesion (brim/skirt)" alongside Travel/Wipe/Retractions.
API (lockstep, additive)
ToolpathRenderer.setFeatureRoleVisible(role: FeatureRoleValue, visible: boolean)+getHiddenFeatureRoles().GcodePreviewControls.setFeatureRoleVisible(role, visible)(passthrough; no-op on the 2D renderer — optional on the interface).FeatureRoleValuenow exported from@chestnutlabs/toolpath-core.capabilities.featureRoles === 'known'(same as feature colour mode).How
Feature roles are per-segment inside the extrusion geometry (unlike whole-chunk move kinds), so hidden segments are collapsed to NaN positions (GPU-discarded) and restored byte-for-byte from a lazily-saved base copy. Applied at the three mesh-creation sites and on toggle — not in the per-frame draw-state loop, so scrub/layer-clip stay cheap. Extrude-only; byte-identical when never used (no base copy saved). Composes with layer clip and scrub.
Verification
featureRoles: 'known'gated the toggle.Brim and skirt are already first-class
FeatureRoles classified by all six slicer adapters, so the immediate distinction is available via feature-colour mode today; this adds the visibility toggle AnyBridge asked for. cc: AnyBridge will consume it once this ships.🤖 Generated with Claude Code