feat: add knockout rendering for silkscreen text#684
Open
buildingvibes wants to merge 1 commit intotscircuit:mainfrom
Open
feat: add knockout rendering for silkscreen text#684buildingvibes wants to merge 1 commit intotscircuit:mainfrom
buildingvibes wants to merge 1 commit intotscircuit:mainfrom
Conversation
Add support for is_knockout and knockout_padding on pcb_silkscreen_text elements in the 3D viewer. When is_knockout is true, a filled silkscreen rectangle is drawn with the text cut out using canvas destination-out compositing, matching the approach used for pcb_copper_text knockout. Includes a story demonstrating knockout text with default padding, custom padding, rotation, and bottom layer rendering.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Author
|
Hi! Following up - all CI checks pass (format, test, type-check, Vercel deploy). This adds knockout rendering for silkscreen text in the 3D viewer, matching the existing copper text knockout pattern. Happy to adjust anything! |
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.
Summary
pcb_silkscreen_textelements in the 3D vieweris_knockoutis true, draws a filled silkscreen rectangle with the text cut outknockout_paddingfor configurable padding around the textpcb_copper_textknockout (canvasdestination-outcompositing)This completes the 3d-viewer checklist item from tscircuit/tscircuit#770.
Changes
src/utils/silkscreen-texture.tsis_knockoutis set, computes padding (with sensible defaults based on font size), draws a filled rectangle at the anchor position, then cuts out the text usingglobalCompositeOperation = "destination-out"stories/SilkscreenText/SilkscreenTextKnockout.stories.tsxTest plan
bun run build)bun run format:check)