/closes #159 /claim #159
The KiCad component converter was unable to parse fp_poly elements that contained arc definitions. This was because the parser only expected xy coordinates within the pts attribute of an fp_poly. When an arc was present, the parser would fail, leading to incorrect or incomplete component conversions.
This pull request introduces the following changes to address the issue:
fp_poly_def in src/kicad-zod.ts has been updated to include a poly_pts_def that allows for both xy coordinates and arc definitions within the pts array.formatAttr Function: The formatAttr function in src/get-attr.ts has been improved to correctly parse pts attributes containing both xy and arc elements. It now identifies the type of each element and formats it accordingly.convertKicadJsonToTsCircuitSoup function in src/convert-kicad-json-to-tscircuit-soup.ts has been updated to handle the new arc elements within fp_poly. It now generates a series of points to represent the arc, ensuring that the resulting tscircuit-soup is a correct representation of the KiCad component.BEFORE FIX:
https://github.com/user-attachments/assets/0bf924a2-f31c-4bd4-a9e2-9a39dfa8e0e9
AFTER FIX:
https://github.com/user-attachments/assets/b12bcecd-5be6-4c3d-b120-42bd480a71c5
Exceluyi
@Exceluyi
tscircuit
@tscircuit