Skip to content

fix: scale JST PH silkscreen body dynamically with pin count#636

Open
tungnguyentu wants to merge 1 commit into
tscircuit:mainfrom
tungnguyentu:fix/jst-ph-variable-pin-count
Open

fix: scale JST PH silkscreen body dynamically with pin count#636
tungnguyentu wants to merge 1 commit into
tscircuit:mainfrom
tungnguyentu:fix/jst-ph-variable-pin-count

Conversation

@tungnguyentu
Copy link
Copy Markdown

Problem

The PH silkscreen body in generateSilkscreenBody was hardcoded to a fixed ±3mm width regardless of pin count. For a jst_ph_2 this works fine, but for jst_ph_4 (pitch 2.2mm) the pad span is 6.6mm and extends beyond the 6mm-wide hardcoded silkscreen outline.

Fix

Scale the PH silkscreen width using the same dynamic formula already used by the ZH variant:

bodyLeft  = -(pinSpan / 2 + 1.5)
bodyRight =  (pinSpan / 2 + 1.5)

The Y dimensions (-2 to +3) remain fixed — they represent the connector housing depth, which is the same for all PH variants.

Verification

  • jst2_ph — silkscreen unchanged for 2-pin (same ±3mm)
  • jst_ph_4 — silkscreen now correctly spans all 4 pads
  • All 10 JST tests pass; snapshots updated

/claim #495

The PH silkscreen body was hardcoded to a fixed ±3mm width, which only
fits a 2-pin connector. For connectors with more pins (e.g. jst_ph_4),
the pads extend beyond the silkscreen outline.

Scale the body width using the same formula as the ZH variant:
bodyLeft/Right = ±(pinSpan/2 + 1.5), keeping the connector housing
depth (Y: -2 to +3) fixed for all PH variants.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant