easyeda 0.0.310 → 0.0.311

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
@@ -6073,6 +6073,18 @@ var handleSilkscreenPath = (track, index) => {
6073
6073
  };
6074
6074
  var isCourtyardLayer = (layer) => layer === 13 || layer === 14 || layer === 15;
6075
6075
  var isSilkscreenLayer = (layer) => layer === 3 || layer === 4;
6076
+ var isDocumentLayer = (layer) => layer === 12;
6077
+ var handleFabricationNotePath = (track, index) => pcb_fabrication_note_path.parse({
6078
+ type: "pcb_fabrication_note_path",
6079
+ pcb_fabrication_note_path_id: `pcb_fabrication_note_path_${index + 1}`,
6080
+ pcb_component_id: "pcb_component_1",
6081
+ layer: "top",
6082
+ route: track.points.map((point2) => ({
6083
+ x: mil10ToMm(point2.x),
6084
+ y: mil10ToMm(point2.y)
6085
+ })),
6086
+ stroke_width: mil10ToMm(track.width)
6087
+ });
6076
6088
  var getSideFromLayer = (layer) => {
6077
6089
  if (layer === 4 || layer === 14) return "bottom";
6078
6090
  return "top";
@@ -6423,8 +6435,10 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
6423
6435
  let hasFoundDesignator = false;
6424
6436
  easyEdaJson.packageDetail.dataStr.shape.forEach((shape, index) => {
6425
6437
  if (shape.type === "TRACK") {
6426
- if (!isCourtyardLayer(shape.layer)) {
6438
+ if (isSilkscreenLayer(shape.layer)) {
6427
6439
  circuitElements.push(handleSilkscreenPath(shape, index));
6440
+ } else if (isDocumentLayer(shape.layer)) {
6441
+ circuitElements.push(handleFabricationNotePath(shape, index));
6428
6442
  }
6429
6443
  } else if (shape.type === "CIRCLE") {
6430
6444
  if (isSilkscreenLayer(shape.layer)) {
@@ -7765,6 +7779,7 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
7765
7779
  const vias = su(circuitJson).pcb_via.list();
7766
7780
  const silkscreenPaths = su(circuitJson).pcb_silkscreen_path.list();
7767
7781
  const silkscreenTexts = su(circuitJson).pcb_silkscreen_text.list();
7782
+ const fabricationNotePaths = su(circuitJson).pcb_fabrication_note_path.list();
7768
7783
  const courtyardOutlines = su(circuitJson).pcb_courtyard_outline.list();
7769
7784
  const elementStrings = [];
7770
7785
  for (const hole of holes) {
@@ -7841,6 +7856,11 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
7841
7856
  `<silkscreentext text=${textValue} pcbX="${mmStr(silkscreenText.anchor_position.x)}" pcbY="${mmStr(silkscreenText.anchor_position.y)}" anchorAlignment="${silkscreenText.anchor_alignment}"${rotationAttr}${silkscreenText.font_size ? ` fontSize="${mmStr(silkscreenText.font_size)}"` : ""} />`
7842
7857
  );
7843
7858
  }
7859
+ for (const fabricationNotePath of fabricationNotePaths) {
7860
+ elementStrings.push(
7861
+ `<fabricationnotepath route={${JSON.stringify(fabricationNotePath.route)}} strokeWidth="${mmStr(fabricationNotePath.stroke_width)}" />`
7862
+ );
7863
+ }
7844
7864
  for (const courtyardOutline of courtyardOutlines) {
7845
7865
  elementStrings.push(
7846
7866
  `<courtyardoutline outline={${JSON.stringify(courtyardOutline.outline)}} />`