kicad-to-circuit-json 0.0.76 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +37 -0
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -791,6 +791,43 @@ function createSmdPad({
791
791
  radius: Math.max(size.x, size.y) / 2
792
792
  };
793
793
  ctx.db.pcb_smtpad.insert(smtpad);
794
+ } else if (shape === "oval") {
795
+ const normalizedCcwRotation = normalizeRotationDegrees(ccwRotationDegrees);
796
+ const rightAngleTurns = getRightAngleTurns(normalizedCcwRotation);
797
+ const radius = Math.min(size.x, size.y) / 2;
798
+ if (rightAngleTurns === null && normalizedCcwRotation !== 0) {
799
+ const rotatedSmtPad = {
800
+ type: "pcb_smtpad",
801
+ pcb_component_id: componentId,
802
+ x: pos.x,
803
+ y: pos.y,
804
+ width: size.x,
805
+ height: size.y,
806
+ radius,
807
+ layer,
808
+ pcb_port_id: pcbPortId,
809
+ port_hints: [pad.number.toString()],
810
+ shape: "rotated_pill",
811
+ ccw_rotation: normalizedCcwRotation
812
+ };
813
+ ctx.db.pcb_smtpad.insert(rotatedSmtPad);
814
+ return;
815
+ }
816
+ const shouldSwapDimensions = rightAngleTurns !== null && Math.abs(rightAngleTurns) % 2 === 1;
817
+ const smtpad = {
818
+ type: "pcb_smtpad",
819
+ pcb_component_id: componentId,
820
+ x: pos.x,
821
+ y: pos.y,
822
+ width: shouldSwapDimensions ? size.y : size.x,
823
+ height: shouldSwapDimensions ? size.x : size.y,
824
+ radius,
825
+ layer,
826
+ pcb_port_id: pcbPortId,
827
+ port_hints: [pad.number.toString()],
828
+ shape: "pill"
829
+ };
830
+ ctx.db.pcb_smtpad.insert(smtpad);
794
831
  } else if (shape === "rect" || shape === "roundrect") {
795
832
  const roundrectRatio = pad._sxRoundrectRatio?.value ?? pad.roundrect_rratio;
796
833
  let cornerRadius;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "kicad-to-circuit-json",
3
3
  "main": "dist/index.js",
4
4
  "type": "module",
5
- "version": "0.0.76",
5
+ "version": "0.0.78",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
@@ -32,10 +32,10 @@
32
32
  "@vitejs/plugin-react": "^6.0.1",
33
33
  "bun-match-svg": "^0.0.14",
34
34
  "circuit-json-to-connectivity-map": "^0.0.23",
35
- "kicadts": "^0.0.42",
35
+ "kicadts": "^0.0.43",
36
36
  "react": "^19.2.0",
37
37
  "react-dom": "^19.2.5",
38
- "tscircuit": "^0.0.1775",
38
+ "tscircuit": "^0.0.1792",
39
39
  "tsup": "^8.5.0",
40
40
  "vercel": "^50.42.0",
41
41
  "vite": "^8.0.8"