solid_from_board: PCB to solid CAD part (inverse of board_from_solid)#425
Merged
Conversation
The inverse of board_from_solid. A finished board can now appear in a mechanical assembly (enclosure fit, motor stacks, clash/clearance checks, mass properties) as real geometry instead of a dumb extruded disc: - Substrate: the board outline extruded to its thickness through the hole-aware sketch path (#396), so bore/cutout polygons survive as real holes in one multi-loop solid — no boolean pass. - Components: optional simplified keep-out volumes, one child part per placed footprint — kernel 3D body extents where available, else courtyard/pad bbox x a per-package-class default height, on the correct side of the board. - Mass: FR4 volume + per-layer copper coverage (zones minus voids, traces, arcs, pads, via annular rings) x stackup copper thickness, attached as a homogenized density on the substrate material so inspect_cad and physics read the real FR4+copper mass off the solid. Output injects into an existing CAD session (document_id_target) — with explicit hydrate/persist handling since the central plumbing keys off the read-only PCB source id — or mints a fresh session and echoes the IR for open_document elsewhere. Round-trip test: a 58mm rotor board (center bore + 4 hub holes, 2oz pours both sides) extrudes to within 2% of area x thickness with cutouts intact, mass lands within 5% of hand-computed FR4+Cu, and the injected solid coexists with an enclosure in a check_enclosure_fit session. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GepcQepAbbTJLcEzsK1f8X
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
What shippedYou can now convert a PCB design directly into a solid 3D part, completing the round-trip between circuit board and mechanical CAD. The board outline — including any cutouts like mounting holes or bore openings — is extruded to the correct thickness, and each placed component can be represented as a simplified keep-out volume. The resulting part carries accurate mass properties based on the actual FR4 substrate and copper content, so weight estimates and physics simulations reflect the real board rather than bare fiberglass. Plain-English summary generated by Choji from this pull request. |
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
Adds
solid_from_board, the inverse operation ofboard_from_solid. This tool materializes a PCB session as a solid CAD part by extruding the board outline (with cutouts preserved as interior holes) and optionally adding simplified component keep-out volumes. The substrate is assigned a homogenized FR4+copper density so thatinspect_cadand physics simulations see the real board mass rather than bare FR4.Key Changes
New tool
solid_from_board(packages/mcp/src/tools/ecad.ts):document_id_target) or mints fresh sessionHelper functions:
loopArea()— shoelace area of closed polygonloopToSegments()— convert polygon to Sketch2D line segmentspadAreaMm2()— copper area per pad shapecopperAreaByLayer()— per-layer copper coverage (zones, traces, vias, pads)estimateBoardMass()— FR4 + copper mass from outline area and stackupcomponentKeepouts()— generate keep-out boxes from 3D meshes or courtyard fallbackpackageHeightMm()— default body height by package class (0402, SOIC, DIP, etc.)Comprehensive test suite (
packages/mcp/src/__tests__/solid-from-board.test.ts):check_enclosure_fitcompatibilityServer integration (
packages/mcp/src/server.ts):document_id, writes CAD todocument_id_target(or mints new)Next-action hints (
packages/mcp/src/tools/next-actions.ts):render_viewto visually cross-check the solidinspect_cadto measure volume, bbox, and homogenized massNotable Implementation Details
inspect_cadand physics engines read the correct mass off the material property.https://claude.ai/code/session_01GepcQepAbbTJLcEzsK1f8X