Add courtyard rectangle support from kicad_mod files#186
Open
rkluis wants to merge 2 commits intotscircuit:mainfrom
Open
Add courtyard rectangle support from kicad_mod files#186rkluis wants to merge 2 commits intotscircuit:mainfrom
rkluis wants to merge 2 commits intotscircuit:mainfrom
Conversation
Parse fp_rect and fp_line elements on F.CrtYd/B.CrtYd layers and convert them to pcb_courtyard_rect circuit-json elements. - Add FpRect zod schema and type for fp_rect parsing - Parse fp_rect elements from kicad_mod S-expressions - Convert fp_rect on CrtYd layers to pcb_courtyard_rect - Detect rectangle shapes formed by 4 fp_line segments on CrtYd layers - Add courtyard layers to tscircuit layer mapping - Add tests for fp_rect courtyard, fp_line courtyard, and both layers Closes tscircuit/tscircuit#1081 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Fix TypeScript compilation error: use stroke normalization pattern in fp_rects push instead of passing raw `width` field - Fix import conventions in courtyard test files: use node:fs/node:path, merge duplicate imports from "src" - Replace hardcoded ternary with convertKicadLayerToTscircuitLayer() in courtyard fp_line code path for consistency - Add debug() logging when skipping non-courtyard fp_rect elements and when courtyard lines don't form a recognized rectangle - Run biome format and biome check --fix across src/ and tests/ Co-Authored-By: Claude Opus 4.6 <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.
Summary
fp_rectelements onF.CrtYd/B.CrtYdlayers from kicad_mod files and converts them topcb_courtyard_rectcircuit-json elementsfp_linesegments on courtyard layers and converts them topcb_courtyard_rectFpRectzod schema/type definition forfp_rectS-expression parsingF.CrtYd->top,B.CrtYd->bottom) in layer conversionChanges
src/kicad-zod.ts: Addedfp_rect_defschema andFpRecttype, addedfp_rectstokicad_mod_json_defsrc/parse-kicad-mod-to-kicad-json.ts: Added parsing offp_rectelements from kicad_mod S-expressionssrc/convert-kicad-json-to-tscircuit-soup.ts: Added courtyard detection from bothfp_rectandfp_lineelements, outputtingpcb_courtyard_rectelementsTest plan
fp_rectusing existingDIP-10_W10.16mm.kicad_modfixturefp_linerectangle using existingR_01005_0402Metric.kicad_modfixtureCloses tscircuit/tscircuit#1081
🤖 Generated with Claude Code