Skip to content

fix: add support for pcb_silkscreen_rect in KiCad footprint export#267

Open
64johnlee wants to merge 4 commits intotscircuit:mainfrom
64johnlee:fix/issue-191-silkscreenrect
Open

fix: add support for pcb_silkscreen_rect in KiCad footprint export#267
64johnlee wants to merge 4 commits intotscircuit:mainfrom
64johnlee:fix/issue-191-silkscreenrect

Conversation

@64johnlee
Copy link
Copy Markdown

Summary

When using silkscreenrect in tscircuit, the silkscreen graphics were not being exported to KiCad as fp_rect elements inside footprints. Instead, they were being silently dropped.

This PR adds:

  1. Footprint-level support: Converts pcb_silkscreen_rect elements associated with components into FpRect inside the footprint (footprint.fpRects)
  2. Board-level support: Converts standalone pcb_silkscreen_rect elements (not associated with any component) into fp_rect board-level elements in AddGraphicsStage

Changes

  • New converter: lib/pcb/stages/footprints-stage-converters/convertSilkscreenRects.ts - converts PcbSilkscreenRect[]FpRect[] using the same relative-coordinate pattern as other silkscreen converters
  • AddFootprintsStage.ts: Added silkscreen rect conversion for component-associated rects (mirrors the pattern used for pcb_silkscreen_path, pcb_silkscreen_circle)
  • AddGraphicsStage.ts: Added standalone silkscreen rect conversion (mirrors the pattern used for pcb_silkscreen_path)

Behavior

tscircuit Element Before After
silkscreenrect (in component) Silently dropped ✗ fp_rect inside footprint ✓
silkscreenrect (standalone) Silently dropped ✗ fp_rect board-level ✓

Closes #191

Convert pcb_silkscreen_rect elements to FpRect inside footprints (component-associated)
and as board-level fp_rect elements (standalone).

Closes tscircuit#191
@vercel
Copy link
Copy Markdown

vercel Bot commented May 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
circuit-json-to-kicad Ready Ready Preview, Comment May 3, 2026 6:38am

Request Review

Copy link
Copy Markdown
Author

@64johnlee 64johnlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All checks passing ✅ This PR fixes silkscreen_rect placement inside footprint. Ready to merge! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant