Skip to content

feat: add pcb_courtyard_polygon and pcb_courtyard_circle to footprint TSX generation#27

Open
Kabi10 wants to merge 2 commits intotscircuit:mainfrom
Kabi10:feat/courtyard-polygon-circle
Open

feat: add pcb_courtyard_polygon and pcb_courtyard_circle to footprint TSX generation#27
Kabi10 wants to merge 2 commits intotscircuit:mainfrom
Kabi10:feat/courtyard-polygon-circle

Conversation

@Kabi10
Copy link
Copy Markdown

@Kabi10 Kabi10 commented Apr 15, 2026

Summary

Resolves tscircuit/tscircuit#1081 — "Make sure kicad component components create courtyards"

  • Adds <courtyardpolygon> JSX output for pcb_courtyard_polygon circuit-json elements
  • Adds <courtyardcircle> JSX output for pcb_courtyard_circle circuit-json elements
  • Passes through optional attributes: strokeWidth, isFilled, hasStroke, isStrokeDashed, color for polygons; strokeWidth, color for circles

Before

All 4 courtyard types are already produced by kicad-component-converter and rendered by circuit-to-svg, but only pcb_courtyard_outline and pcb_courtyard_rect were being converted to TSX footprint elements. Polygon and circle courtyard shapes were silently dropped.

After

Full round-trip coverage for all 4 courtyard types:

circuit-json type TSX element
pcb_courtyard_outline <courtyardoutline> (existing)
pcb_courtyard_rect <courtyardrect> (existing)
pcb_courtyard_polygon <courtyardpolygon> ✨ new
pcb_courtyard_circle <courtyardcircle> ✨ new

Test plan

  • Added test("test8 support courtyard polygon and circle") verifying both new elements are emitted with correct attributes
  • All 12 pre-existing passing tests still pass

/claim #1081

🤖 Generated with Claude Code

… TSX generation

Resolves tscircuit/tscircuit#1081 — make sure kicad component components create courtyards.

Adds <courtyardpolygon> and <courtyardcircle> JSX element generation to
generate-footprint-tsx.tsx, covering all 4 courtyard circuit-json types:
- pcb_courtyard_outline → <courtyardoutline> (existing)
- pcb_courtyard_rect → <courtyardrect> (existing)
- pcb_courtyard_polygon → <courtyardpolygon> (new)
- pcb_courtyard_circle → <courtyardcircle> (new)

Tests added to verify both new element types are emitted correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Kabi10
Copy link
Copy Markdown
Author

Kabi10 commented Apr 15, 2026

Context for reviewers:

PR #25 (merged 2026-03-06) added pcb_courtyard_outline and pcb_courtyard_rect to footprint TSX generation.

The kicad-component-converter already parses all 4 courtyard types from KiCad files (see convert-kicad-json-to-tscircuit-soup.ts lines 864-963 in main), but generate-footprint-tsx.tsx was never updated for the remaining two:

  • pcb_courtyard_polygon -> no TSX element emitted (gap)
  • pcb_courtyard_circle -> no TSX element emitted (gap)

This PR closes those two gaps, completing full round-trip coverage for all 4 courtyard types: KiCad file -> circuit-json -> TSX footprint.

@Kabi10
Copy link
Copy Markdown
Author

Kabi10 commented Apr 16, 2026

Closing since tscircuit/tscircuit#1081 was closed as completed without a reward being issued. The implementation is correct and complete — happy to reopen if the bounty is revisited.

@Kabi10 Kabi10 closed this Apr 16, 2026
@Kabi10 Kabi10 reopened this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make sure kicad component components create courtyards

1 participant