easyeda 0.0.264 → 0.0.266

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.
@@ -9290,6 +9290,10 @@ var handleCutout = (solidRegion, index) => {
9290
9290
  }))
9291
9291
  });
9292
9292
  };
9293
+ var LEAD_SHAPE_LAYER = 100;
9294
+ var isPcbSolidRegionCutout = (shape) => {
9295
+ return shape.fillStyle === "cutout" && shape.layermask !== LEAD_SHAPE_LAYER;
9296
+ };
9293
9297
  var getCadPositionZMmFromMetadata = (easyEdaJson) => {
9294
9298
  const svgNode = easyEdaJson.packageDetail.dataStr.shape.find(
9295
9299
  (shape) => shape.type === "SVGNODE" && shape.svgData.attrs?.uuid
@@ -9447,7 +9451,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
9447
9451
  } else if (pad.shape === "ELLIPSE") {
9448
9452
  soupShape = "rect";
9449
9453
  } else if (pad.shape === "OVAL") {
9450
- soupShape = "rect";
9454
+ soupShape = "pill";
9451
9455
  } else if (pad.shape === "POLYGON") {
9452
9456
  soupShape = "polygon";
9453
9457
  }
@@ -9467,12 +9471,17 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
9467
9471
  x: mil2mm(pad.center.x),
9468
9472
  y: mil2mm(pad.center.y)
9469
9473
  },
9470
- ...soupShape === "rect" ? rectSize : soupShape === "polygon" && pad.points ? {
9474
+ ...soupShape === "rect" ? rectSize : soupShape === "pill" ? {
9475
+ ...rectSize,
9476
+ radius: Math.min(rectSize.width, rectSize.height) / 2
9477
+ } : soupShape === "polygon" && pad.points ? {
9471
9478
  points: pad.points.map((p) => ({
9472
9479
  x: milx10(p.x),
9473
9480
  y: milx10(p.y)
9474
9481
  }))
9475
- } : { radius: Math.min(mil2mm(pad.width), mil2mm(pad.height)) / 2 },
9482
+ } : {
9483
+ radius: Math.min(mil2mm(pad.width), mil2mm(pad.height)) / 2
9484
+ },
9476
9485
  layer: "top",
9477
9486
  port_hints: [`pin${pinNumber}`],
9478
9487
  pcb_component_id: "pcb_component_1",
@@ -9491,7 +9500,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
9491
9500
  circuitElements.push(handleVia(v, index));
9492
9501
  });
9493
9502
  easyEdaJson.packageDetail.dataStr.shape.filter(
9494
- (shape) => shape.type === "SOLIDREGION" && shape.fillStyle === "cutout"
9503
+ (shape) => shape.type === "SOLIDREGION" && isPcbSolidRegionCutout(shape)
9495
9504
  ).forEach((sr, index) => {
9496
9505
  circuitElements.push(handleCutout(sr, index));
9497
9506
  });
@@ -9543,7 +9552,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
9543
9552
  circuitElements.push(
9544
9553
  pcb_silkscreen_text.parse({
9545
9554
  type: "pcb_silkscreen_text",
9546
- pcb_silkscreen_text_id: `pcb_silkscreen_text_designator_fallback`,
9555
+ pcb_silkscreen_text_id: "pcb_silkscreen_text_designator_fallback",
9547
9556
  pcb_component_id: "pcb_component_1",
9548
9557
  text: "{NAME}",
9549
9558
  anchor_position: {
@@ -10653,8 +10662,14 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
10653
10662
  `<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
10663
  );
10655
10664
  } else if (smtPad.shape === "rect") {
10665
+ const cornerRadius = smtPad.corner_radius ?? smtPad.rect_border_radius ?? void 0;
10666
+ const cornerRadiusAttr = cornerRadius !== void 0 ? ` cornerRadius="${mmStr(cornerRadius)}"` : "";
10667
+ elementStrings.push(
10668
+ `<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" />`
10669
+ );
10670
+ } else if (smtPad.shape === "pill") {
10656
10671
  elementStrings.push(
10657
- `<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" />`
10672
+ `<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
10673
  );
10659
10674
  } else if (smtPad.shape === "polygon") {
10660
10675
  const pointsStr = smtPad.points.map((p) => `{x: "${mmStr(p.x)}", y: "${mmStr(p.y)}"}`).join(", ");