easyeda 0.0.264 → 0.0.265

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.
package/dist/main.cjs CHANGED
@@ -997,7 +997,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
997
997
  var package_default = {
998
998
  name: "easyeda",
999
999
  type: "module",
1000
- version: "0.0.263",
1000
+ version: "0.0.264",
1001
1001
  files: [
1002
1002
  "dist"
1003
1003
  ],
@@ -1041,10 +1041,6 @@ var package_default = {
1041
1041
  "easyeda-converter": "./dist/main.cjs",
1042
1042
  easyeda: "./dist/main.cjs"
1043
1043
  },
1044
- files: [
1045
- "dist"
1046
- ],
1047
- license: "MIT",
1048
1044
  scripts: {
1049
1045
  test: "bun test",
1050
1046
  cli: "bun cli/main.ts",
@@ -1054,7 +1050,6 @@ var package_default = {
1054
1050
  format: "biome format . --write",
1055
1051
  "add-test-for-part": "bun run scripts/add-test-for-part.ts"
1056
1052
  },
1057
- type: "module",
1058
1053
  types: "./dist/index.d.ts"
1059
1054
  };
1060
1055
 
@@ -6618,7 +6613,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
6618
6613
  } else if (pad.shape === "ELLIPSE") {
6619
6614
  soupShape = "rect";
6620
6615
  } else if (pad.shape === "OVAL") {
6621
- soupShape = "rect";
6616
+ soupShape = "pill";
6622
6617
  } else if (pad.shape === "POLYGON") {
6623
6618
  soupShape = "polygon";
6624
6619
  }
@@ -6638,12 +6633,17 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
6638
6633
  x: mil2mm(pad.center.x),
6639
6634
  y: mil2mm(pad.center.y)
6640
6635
  },
6641
- ...soupShape === "rect" ? rectSize : soupShape === "polygon" && pad.points ? {
6636
+ ...soupShape === "rect" ? rectSize : soupShape === "pill" ? {
6637
+ ...rectSize,
6638
+ radius: Math.min(rectSize.width, rectSize.height) / 2
6639
+ } : soupShape === "polygon" && pad.points ? {
6642
6640
  points: pad.points.map((p) => ({
6643
6641
  x: milx10(p.x),
6644
6642
  y: milx10(p.y)
6645
6643
  }))
6646
- } : { radius: Math.min(mil2mm(pad.width), mil2mm(pad.height)) / 2 },
6644
+ } : {
6645
+ radius: Math.min(mil2mm(pad.width), mil2mm(pad.height)) / 2
6646
+ },
6647
6647
  layer: "top",
6648
6648
  port_hints: [`pin${pinNumber}`],
6649
6649
  pcb_component_id: "pcb_component_1",
@@ -7814,8 +7814,14 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
7814
7814
  `<smtpad portHints={${JSON.stringify(mapPortHints(smtPad.port_hints, options.portHintsMap))}} pcbX="${mmStr(smtPad.x)}" pcbY="${mmStr(smtPad.y)}" radius="${mmStr(smtPad.radius)}" shape="circle" />`
7815
7815
  );
7816
7816
  } else if (smtPad.shape === "rect") {
7817
+ const cornerRadius = smtPad.corner_radius ?? smtPad.rect_border_radius ?? void 0;
7818
+ const cornerRadiusAttr = cornerRadius !== void 0 ? ` cornerRadius="${mmStr(cornerRadius)}"` : "";
7819
+ elementStrings.push(
7820
+ `<smtpad portHints={${JSON.stringify(smtPad.port_hints)}} pcbX="${mmStr(smtPad.x)}" pcbY="${mmStr(smtPad.y)}" width="${mmStr(smtPad.width)}" height="${mmStr(smtPad.height)}"${cornerRadiusAttr} shape="rect" />`
7821
+ );
7822
+ } else if (smtPad.shape === "pill") {
7817
7823
  elementStrings.push(
7818
- `<smtpad portHints={${JSON.stringify(mapPortHints(smtPad.port_hints, options.portHintsMap))}} pcbX="${mmStr(smtPad.x)}" pcbY="${mmStr(smtPad.y)}" width="${mmStr(smtPad.width)}" height="${mmStr(smtPad.height)}" shape="rect" />`
7824
+ `<smtpad portHints={${JSON.stringify(smtPad.port_hints)}} pcbX="${mmStr(smtPad.x)}" pcbY="${mmStr(smtPad.y)}" width="${mmStr(smtPad.width)}" height="${mmStr(smtPad.height)}" radius="${mmStr(smtPad.radius)}" shape="pill" />`
7819
7825
  );
7820
7826
  } else if (smtPad.shape === "polygon") {
7821
7827
  const pointsStr = smtPad.points.map((p) => `{x: "${mmStr(p.x)}", y: "${mmStr(p.y)}"}`).join(", ");