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/index.js CHANGED
@@ -5564,7 +5564,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
5564
5564
  } else if (pad.shape === "ELLIPSE") {
5565
5565
  soupShape = "rect";
5566
5566
  } else if (pad.shape === "OVAL") {
5567
- soupShape = "rect";
5567
+ soupShape = "pill";
5568
5568
  } else if (pad.shape === "POLYGON") {
5569
5569
  soupShape = "polygon";
5570
5570
  }
@@ -5584,12 +5584,17 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
5584
5584
  x: mil2mm(pad.center.x),
5585
5585
  y: mil2mm(pad.center.y)
5586
5586
  },
5587
- ...soupShape === "rect" ? rectSize : soupShape === "polygon" && pad.points ? {
5587
+ ...soupShape === "rect" ? rectSize : soupShape === "pill" ? {
5588
+ ...rectSize,
5589
+ radius: Math.min(rectSize.width, rectSize.height) / 2
5590
+ } : soupShape === "polygon" && pad.points ? {
5588
5591
  points: pad.points.map((p) => ({
5589
5592
  x: milx10(p.x),
5590
5593
  y: milx10(p.y)
5591
5594
  }))
5592
- } : { radius: Math.min(mil2mm(pad.width), mil2mm(pad.height)) / 2 },
5595
+ } : {
5596
+ radius: Math.min(mil2mm(pad.width), mil2mm(pad.height)) / 2
5597
+ },
5593
5598
  layer: "top",
5594
5599
  port_hints: [`pin${pinNumber}`],
5595
5600
  pcb_component_id: "pcb_component_1",
@@ -6905,8 +6910,14 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
6905
6910
  `<smtpad portHints={${JSON.stringify(mapPortHints(smtPad.port_hints, options.portHintsMap))}} pcbX="${mmStr(smtPad.x)}" pcbY="${mmStr(smtPad.y)}" radius="${mmStr(smtPad.radius)}" shape="circle" />`
6906
6911
  );
6907
6912
  } else if (smtPad.shape === "rect") {
6913
+ const cornerRadius = smtPad.corner_radius ?? smtPad.rect_border_radius ?? void 0;
6914
+ const cornerRadiusAttr = cornerRadius !== void 0 ? ` cornerRadius="${mmStr(cornerRadius)}"` : "";
6915
+ elementStrings.push(
6916
+ `<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" />`
6917
+ );
6918
+ } else if (smtPad.shape === "pill") {
6908
6919
  elementStrings.push(
6909
- `<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" />`
6920
+ `<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" />`
6910
6921
  );
6911
6922
  } else if (smtPad.shape === "polygon") {
6912
6923
  const pointsStr = smtPad.points.map((p) => `{x: "${mmStr(p.x)}", y: "${mmStr(p.y)}"}`).join(", ");