Summary
The jst_ph_4 footprint (JST PH connector with 4 pins) only generates 2 pads instead of 4.
Root Cause
In src/fn/jst.ts:
-
Line 169 hardcodes numPins = 2 for the PH variant:
let numPins = variant === "sh" ? 4 : 2
-
The SH variant parses pin count from the string (e.g., jst_sh6 → 6 pins), but PH does not.
-
The generatePads() function for PH (lines 84-105) only creates 2 pads at fixed positions, ignoring the numPins parameter entirely.
Reproduction
<chip name="J1" footprint="jst_ph_4" />
Export to KiCad PCB - only 2 pads are generated.
Expected
4 through-hole pads for jst_ph_4, similar to how jst_sh6 generates 6 pads.
Suggested Fix
- Parse pin count from the footprint string for PH variant (e.g.,
jst_ph_4 → 4 pins)
- Update
generatePads() to dynamically create numPins pads for the PH variant
Impact
JST PH connectors with more than 2 pins cannot be used via the built-in footprint string.
Summary
The
jst_ph_4footprint (JST PH connector with 4 pins) only generates 2 pads instead of 4.Root Cause
In
src/fn/jst.ts:Line 169 hardcodes
numPins = 2for the PH variant:The SH variant parses pin count from the string (e.g.,
jst_sh6→ 6 pins), but PH does not.The
generatePads()function for PH (lines 84-105) only creates 2 pads at fixed positions, ignoring thenumPinsparameter entirely.Reproduction
Export to KiCad PCB - only 2 pads are generated.
Expected
4 through-hole pads for
jst_ph_4, similar to howjst_sh6generates 6 pads.Suggested Fix
jst_ph_4→ 4 pins)generatePads()to dynamically createnumPinspads for the PH variantImpact
JST PH connectors with more than 2 pins cannot be used via the built-in footprint string.