feat(3d): add PcbBoxViewer with PCB texture on box#886
Open
sucloudflare wants to merge 1 commit into
Open
Conversation
Uses circuit-to-svg to render the board layout as SVG, rasterizes it with @resvg/resvg-wasm to produce a PNG, then applies it as a Three.js texture on the top face of a BoxGeometry. - New: src/components/PcbBoxViewer.tsx - New: src/examples/2026/pcb-box-viewer.fixture.tsx - Export added to src/index.tsx - Deps: three, @types/three, @resvg/resvg-wasm Closes #419
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Closes #419
Adds a
PcbBoxViewerReact component that renders the PCB as a textured 3D box using Three.js.How it works
convertCircuitJsonToPcbSvg()fromcircuit-to-svgto render the board layout as SVG@resvg/resvg-wasm(with SVG data URL fallback if wasm fails)BoxGeometryin Three.jspcb_boardelement (width/height/thickness)New files
src/components/PcbBoxViewer.tsx— the componentsrc/examples/2026/pcb-box-viewer.fixture.tsx— demo fixtureNew deps
three+@types/three— 3D rendering@resvg/resvg-wasm— SVG → PNG rasterization in the browser