Description
This PR fixes issue #125 by updating the layer matching logic in the KiCad mod parser to properly handle the ‘*.Cu’ layer pattern.
Problem
The original code only checked for exact matches of ‘F.Cu’ when determining if a pad should be processed. This caused pads with ‘*.Cu’ layers to be skipped, leading to:
- Pads being processed as holes instead of pads
- Missing pin labels in the output
- Incorrect component dimensions
Solution
- Updated the layer checking logic to recognize ‘*.Cu’ as a valid Cu layer pattern
- Added logic to prevent duplicate processing of pads in the holes section
- Maintains backward compatibility with existing ‘F.Cu’, ‘B.Cu’, and other layer patterns
Testing
- ✅ Tested with the problematic ADOM_MEDIUM_PIN_SHORTER_v1.kicad_mod file
- ✅ Verified no duplicate processing occurs
- ✅ Confirmed pin labels are properly handled
- ✅ Ensured backward compatibility with existing test files
- ✅ No undefined values in output
Changes
- Modified
src/parse-kicad-mod-to-kicad-json.ts
to improve layer matching logic
- Added duplicate prevention logic in holes processing section
/claim #125