feat(pcb): export pcb_copper_pour records as KiCad zones#299
Open
watcharaponthod-code wants to merge 5 commits intotscircuit:mainfrom
Open
feat(pcb): export pcb_copper_pour records as KiCad zones#299watcharaponthod-code wants to merge 5 commits intotscircuit:mainfrom
watcharaponthod-code wants to merge 5 commits intotscircuit:mainfrom
Conversation
… zones Fixes tscircuit#284 Converts pcb_copper_pour records (rect and polygon shapes) from circuit-json into KiCad (zone) blocks. BRep shapes are logged and skipped pending future tessellation support.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The kicadts v0.0.25 Zone class uses raw PrimitiveSExpr children rather than class-based properties. Replace ZoneNet/ZoneNetName/ZoneHatch etc. imports (which don't exist in this version) with zone.rawChildren array using nested PrimitiveSExpr tuples. Also fix inline import() type usage by importing Matrix from transformation-matrix at the top level. Fixes format-check and type-check CI failures.
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
Fixes #284 —
pcb_copper_pourrecords in circuit-json were silently dropped during KiCad PCB export. Opening the resulting.kicad_pcbshowed zero(zone)blocks even when copper pours were present.Root Cause
The PCB converter pipeline had stages for traces, vias, footprints, graphics, etc., but no stage existed to handle
pcb_copper_pourelements. They were read into the circuit-json DB but never converted.Fix
Added
AddCopperPoursStage.ts— a new pipeline stage that:pcb_copper_pourrecords from the circuit-json DB(zone ...)block using thekicadtsZoneclassrect→ 4-corner rectangular polygon (with optional rotation support)polygon→ arbitrary polygon from thepointsarraypcbNetMapviasource_net_idbrepshapes are logged and skipped (tessellation support is future work)Registered the stage in
CircuitJsonToKicadPcbConverter.tsbetweenAddViasStage/AddStandalonePcbElementsandAddGraphicsStage.Tests
Added
tests/pcb/basics/basics17-copper-pour.test.tscovering:F.CuB.CuTest plan
AddCopperPoursStagecreated with stage pattern matching existing stagesCircuitJsonToKicadPcbConverterpipeline updatedtop→F.Cu,bottom→B.Cu) verified🤖 Generated with Claude Code