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/browser/index.js +15 -4
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +16 -10
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -9447,7 +9447,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
9447
9447
|
} else if (pad.shape === "ELLIPSE") {
|
|
9448
9448
|
soupShape = "rect";
|
|
9449
9449
|
} else if (pad.shape === "OVAL") {
|
|
9450
|
-
soupShape = "
|
|
9450
|
+
soupShape = "pill";
|
|
9451
9451
|
} else if (pad.shape === "POLYGON") {
|
|
9452
9452
|
soupShape = "polygon";
|
|
9453
9453
|
}
|
|
@@ -9467,12 +9467,17 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
9467
9467
|
x: mil2mm(pad.center.x),
|
|
9468
9468
|
y: mil2mm(pad.center.y)
|
|
9469
9469
|
},
|
|
9470
|
-
...soupShape === "rect" ? rectSize : soupShape === "
|
|
9470
|
+
...soupShape === "rect" ? rectSize : soupShape === "pill" ? {
|
|
9471
|
+
...rectSize,
|
|
9472
|
+
radius: Math.min(rectSize.width, rectSize.height) / 2
|
|
9473
|
+
} : soupShape === "polygon" && pad.points ? {
|
|
9471
9474
|
points: pad.points.map((p) => ({
|
|
9472
9475
|
x: milx10(p.x),
|
|
9473
9476
|
y: milx10(p.y)
|
|
9474
9477
|
}))
|
|
9475
|
-
} : {
|
|
9478
|
+
} : {
|
|
9479
|
+
radius: Math.min(mil2mm(pad.width), mil2mm(pad.height)) / 2
|
|
9480
|
+
},
|
|
9476
9481
|
layer: "top",
|
|
9477
9482
|
port_hints: [`pin${pinNumber}`],
|
|
9478
9483
|
pcb_component_id: "pcb_component_1",
|
|
@@ -10653,8 +10658,14 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
|
|
|
10653
10658
|
`<smtpad portHints={${JSON.stringify(mapPortHints(smtPad.port_hints, options.portHintsMap))}} pcbX="${mmStr(smtPad.x)}" pcbY="${mmStr(smtPad.y)}" radius="${mmStr(smtPad.radius)}" shape="circle" />`
|
|
10654
10659
|
);
|
|
10655
10660
|
} else if (smtPad.shape === "rect") {
|
|
10661
|
+
const cornerRadius = smtPad.corner_radius ?? smtPad.rect_border_radius ?? void 0;
|
|
10662
|
+
const cornerRadiusAttr = cornerRadius !== void 0 ? ` cornerRadius="${mmStr(cornerRadius)}"` : "";
|
|
10663
|
+
elementStrings.push(
|
|
10664
|
+
`<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" />`
|
|
10665
|
+
);
|
|
10666
|
+
} else if (smtPad.shape === "pill") {
|
|
10656
10667
|
elementStrings.push(
|
|
10657
|
-
`<smtpad portHints={${JSON.stringify(
|
|
10668
|
+
`<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" />`
|
|
10658
10669
|
);
|
|
10659
10670
|
} else if (smtPad.shape === "polygon") {
|
|
10660
10671
|
const pointsStr = smtPad.points.map((p) => `{x: "${mmStr(p.x)}", y: "${mmStr(p.y)}"}`).join(", ");
|