@tscircuit/cli 0.1.1492 → 0.1.1493
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/cli/main.js +697 -65
- package/dist/lib/index.js +2 -2
- package/package.json +2 -2
package/dist/cli/main.js
CHANGED
|
@@ -100763,7 +100763,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
|
|
|
100763
100763
|
// lib/getVersion.ts
|
|
100764
100764
|
import { createRequire as createRequire2 } from "node:module";
|
|
100765
100765
|
// package.json
|
|
100766
|
-
var version = "0.1.
|
|
100766
|
+
var version = "0.1.1492";
|
|
100767
100767
|
var package_default = {
|
|
100768
100768
|
name: "@tscircuit/cli",
|
|
100769
100769
|
version,
|
|
@@ -100806,7 +100806,7 @@ var package_default = {
|
|
|
100806
100806
|
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
100807
100807
|
"circuit-json-to-spice": "^0.0.10",
|
|
100808
100808
|
"circuit-json-to-step": "^0.0.33",
|
|
100809
|
-
"circuit-json-to-tscircuit": "^0.0.
|
|
100809
|
+
"circuit-json-to-tscircuit": "^0.0.35",
|
|
100810
100810
|
"circuit-json-trace-length-analysis": "github:tscircuit/circuit-json-trace-length-analysis#2b44792a40df0ca83b6bfb6ac95ed5e35e7168b8",
|
|
100811
100811
|
commander: "^14.0.0",
|
|
100812
100812
|
conf: "^13.1.0",
|
|
@@ -247293,6 +247293,9 @@ import fs46 from "node:fs/promises";
|
|
|
247293
247293
|
import path49 from "node:path";
|
|
247294
247294
|
import { parseKicadModToCircuitJson } from "kicad-component-converter";
|
|
247295
247295
|
|
|
247296
|
+
// node_modules/circuit-json-to-tscircuit/dist/chunk-WC7XDXUV.js
|
|
247297
|
+
import { su as su6 } from "@tscircuit/soup-util";
|
|
247298
|
+
|
|
247296
247299
|
// node_modules/@tscircuit/mm/dist/index.js
|
|
247297
247300
|
var unitToMm2 = {
|
|
247298
247301
|
in: 25.4,
|
|
@@ -247318,51 +247321,478 @@ var mmStr = (n3) => {
|
|
|
247318
247321
|
return `${mm3(n3)}mm`;
|
|
247319
247322
|
};
|
|
247320
247323
|
|
|
247321
|
-
// node_modules/circuit-json-to-tscircuit/dist/chunk-
|
|
247322
|
-
import { su as
|
|
247323
|
-
|
|
247324
|
-
|
|
247325
|
-
|
|
247326
|
-
|
|
247327
|
-
|
|
247328
|
-
|
|
247329
|
-
|
|
247324
|
+
// node_modules/circuit-json-to-tscircuit/dist/chunk-WC7XDXUV.js
|
|
247325
|
+
import { su as su23 } from "@tscircuit/soup-util";
|
|
247326
|
+
import { su as su33 } from "@tscircuit/soup-util";
|
|
247327
|
+
import { su as su42 } from "@tscircuit/soup-util";
|
|
247328
|
+
import { su as su5 } from "@tscircuit/soup-util";
|
|
247329
|
+
import { su as su62 } from "@tscircuit/soup-util";
|
|
247330
|
+
import { su as su7 } from "@tscircuit/soup-util";
|
|
247331
|
+
import { su as su8 } from "@tscircuit/soup-util";
|
|
247332
|
+
import { su as su9 } from "@tscircuit/soup-util";
|
|
247333
|
+
import { su as su10 } from "@tscircuit/soup-util";
|
|
247334
|
+
import { su as su11 } from "@tscircuit/soup-util";
|
|
247335
|
+
import { su as su12 } from "@tscircuit/soup-util";
|
|
247336
|
+
var escapeJsxText = (value) => String(value ?? "").replace(/"/g, "\\\"");
|
|
247337
|
+
var formatMm = (value) => mmStr(value ?? 0);
|
|
247338
|
+
var formatOptionalMmAttr = (attrName, value) => {
|
|
247339
|
+
if (value === undefined)
|
|
247340
|
+
return "";
|
|
247341
|
+
return ` ${attrName}="${mmStr(value)}"`;
|
|
247342
|
+
};
|
|
247343
|
+
var formatSolderMaskAttrs = (platedHole) => `${platedHole.is_covered_with_solder_mask === undefined ? "" : ` coveredWithSolderMask={${platedHole.is_covered_with_solder_mask}}`}${formatOptionalMmAttr("solderMaskMargin", platedHole.soldermask_margin)}`;
|
|
247344
|
+
var formatPcbRotationAttr = (rotation4, attrName = "pcbRotation") => {
|
|
247345
|
+
if (rotation4 === undefined)
|
|
247346
|
+
return "";
|
|
247347
|
+
const formatted = typeof rotation4 === "number" ? `${rotation4}deg` : rotation4;
|
|
247348
|
+
return ` ${attrName}="${formatted}"`;
|
|
247349
|
+
};
|
|
247350
|
+
var convertCopperText = (circuitJson) => {
|
|
247351
|
+
const copperTexts = su6(circuitJson).pcb_copper_text.list();
|
|
247352
|
+
const elementStrings = [];
|
|
247353
|
+
for (const copperText of copperTexts) {
|
|
247354
|
+
const anchorPosition = copperText.anchor_position ?? { x: 0, y: 0 };
|
|
247355
|
+
const attrs = [
|
|
247356
|
+
`pcbX={${anchorPosition.x}}`,
|
|
247357
|
+
`pcbY={${anchorPosition.y}}`,
|
|
247358
|
+
`anchorAlignment="${copperText.anchor_alignment ?? "center"}"`,
|
|
247359
|
+
`text="${escapeJsxText(copperText.text)}"`
|
|
247360
|
+
];
|
|
247361
|
+
if (copperText.font !== undefined) {
|
|
247362
|
+
attrs.push(`font="${copperText.font}"`);
|
|
247363
|
+
}
|
|
247364
|
+
if (copperText.font_size !== undefined) {
|
|
247365
|
+
attrs.push(`fontSize={${copperText.font_size}}`);
|
|
247366
|
+
}
|
|
247367
|
+
if (copperText.ccw_rotation !== undefined) {
|
|
247368
|
+
attrs.push(`pcbRotation="${copperText.ccw_rotation}deg"`);
|
|
247369
|
+
}
|
|
247370
|
+
if (copperText.is_knockout !== undefined) {
|
|
247371
|
+
attrs.push(`knockout={${copperText.is_knockout}}`);
|
|
247372
|
+
}
|
|
247373
|
+
if (copperText.is_mirrored !== undefined) {
|
|
247374
|
+
attrs.push(`mirrored={${copperText.is_mirrored}}`);
|
|
247375
|
+
}
|
|
247376
|
+
if (copperText.layer !== undefined && copperText.layer !== "top") {
|
|
247377
|
+
attrs.push(`layer="${copperText.layer}"`);
|
|
247378
|
+
}
|
|
247379
|
+
elementStrings.push(`<coppertext ${attrs.join(" ")} />`);
|
|
247380
|
+
}
|
|
247381
|
+
return elementStrings;
|
|
247382
|
+
};
|
|
247383
|
+
var convertCourtyard = (circuitJson) => {
|
|
247384
|
+
const courtyardOutlines = su23(circuitJson).pcb_courtyard_outline.list();
|
|
247385
|
+
const courtyardRects = su23(circuitJson).pcb_courtyard_rect.list();
|
|
247386
|
+
const courtyardCircles = su23(circuitJson).pcb_courtyard_circle.list();
|
|
247387
|
+
const elementStrings = [];
|
|
247388
|
+
for (const courtyardOutline of courtyardOutlines) {
|
|
247389
|
+
const attrs = [
|
|
247390
|
+
`outline={${JSON.stringify(courtyardOutline.outline ?? [])}}`
|
|
247391
|
+
];
|
|
247392
|
+
if (courtyardOutline.layer !== undefined) {
|
|
247393
|
+
attrs.push(`layer="${courtyardOutline.layer}"`);
|
|
247394
|
+
}
|
|
247395
|
+
elementStrings.push(`<courtyardoutline ${attrs.join(" ")} />`);
|
|
247396
|
+
}
|
|
247397
|
+
for (const courtyardRect of courtyardRects) {
|
|
247398
|
+
const attrs = [
|
|
247399
|
+
`pcbX={${courtyardRect.center?.x ?? 0}}`,
|
|
247400
|
+
`pcbY={${courtyardRect.center?.y ?? 0}}`,
|
|
247401
|
+
`width={${courtyardRect.width ?? 0}}`,
|
|
247402
|
+
`height={${courtyardRect.height ?? 0}}`
|
|
247403
|
+
];
|
|
247404
|
+
if (courtyardRect.layer !== undefined) {
|
|
247405
|
+
attrs.push(`layer="${courtyardRect.layer}"`);
|
|
247406
|
+
}
|
|
247407
|
+
elementStrings.push(`<courtyardrect ${attrs.join(" ")} />`);
|
|
247408
|
+
}
|
|
247409
|
+
for (const courtyardCircle of courtyardCircles) {
|
|
247410
|
+
const attrs = [
|
|
247411
|
+
`pcbX={${courtyardCircle.center?.x ?? 0}}`,
|
|
247412
|
+
`pcbY={${courtyardCircle.center?.y ?? 0}}`,
|
|
247413
|
+
`radius={${courtyardCircle.radius ?? 0}}`
|
|
247414
|
+
];
|
|
247415
|
+
if (courtyardCircle.layer !== undefined) {
|
|
247416
|
+
attrs.push(`layer="${courtyardCircle.layer}"`);
|
|
247417
|
+
}
|
|
247418
|
+
elementStrings.push(`<courtyardcircle ${attrs.join(" ")} />`);
|
|
247419
|
+
}
|
|
247420
|
+
return elementStrings;
|
|
247421
|
+
};
|
|
247422
|
+
var convertCutouts = (circuitJson) => {
|
|
247423
|
+
const pcbCutouts = su33(circuitJson).pcb_cutout.list();
|
|
247424
|
+
const elementStrings = [];
|
|
247425
|
+
for (const cutout of pcbCutouts) {
|
|
247426
|
+
if (cutout.shape === "rect") {
|
|
247427
|
+
const rotation4 = cutout.rotation !== undefined ? ` pcbRotation="${formatMm(cutout.rotation)}"` : "";
|
|
247428
|
+
elementStrings.push(`<cutout shape="rect" pcbX="${formatMm(cutout.center.x)}" pcbY="${formatMm(cutout.center.y)}" width="${formatMm(cutout.width)}" height="${formatMm(cutout.height)}"${rotation4} />`);
|
|
247429
|
+
} else if (cutout.shape === "circle") {
|
|
247430
|
+
elementStrings.push(`<cutout shape="circle" pcbX="${formatMm(cutout.center.x)}" pcbY="${formatMm(cutout.center.y)}" radius="${formatMm(cutout.radius)}" />`);
|
|
247431
|
+
} else if (cutout.shape === "polygon") {
|
|
247432
|
+
elementStrings.push(`<cutout shape="polygon" points={${JSON.stringify(cutout.points)}} />`);
|
|
247433
|
+
} else {
|
|
247434
|
+
console.warn(`Unhandled pcb_cutout shape: ${cutout.shape}`);
|
|
247435
|
+
}
|
|
247436
|
+
}
|
|
247437
|
+
return elementStrings;
|
|
247438
|
+
};
|
|
247439
|
+
var convertFabrication = (circuitJson) => {
|
|
247440
|
+
const fabricationNotePaths = su42(circuitJson).pcb_fabrication_note_path.list();
|
|
247441
|
+
const fabricationNoteTexts = su42(circuitJson).pcb_fabrication_note_text.list();
|
|
247442
|
+
const fabricationNoteRects = su42(circuitJson).pcb_fabrication_note_rect.list();
|
|
247443
|
+
const fabricationNoteDimensions = su42(circuitJson).pcb_fabrication_note_dimension.list();
|
|
247444
|
+
const elementStrings = [];
|
|
247445
|
+
for (const fabPath of fabricationNotePaths) {
|
|
247446
|
+
const attrs = [`route={${JSON.stringify(fabPath.route)}}`];
|
|
247447
|
+
if ("stroke_width" in fabPath && fabPath.stroke_width !== undefined) {
|
|
247448
|
+
attrs.push(`strokeWidth={${fabPath.stroke_width}}`);
|
|
247449
|
+
}
|
|
247450
|
+
if ("color" in fabPath && fabPath.color !== undefined) {
|
|
247451
|
+
attrs.push(`color="${fabPath.color}"`);
|
|
247452
|
+
}
|
|
247453
|
+
if ("layer" in fabPath && fabPath.layer === "bottom") {
|
|
247454
|
+
attrs.push(`layer="bottom"`);
|
|
247455
|
+
}
|
|
247456
|
+
elementStrings.push(`<fabricationnotepath ${attrs.join(" ")} />`);
|
|
247457
|
+
}
|
|
247458
|
+
for (const fabText of fabricationNoteTexts) {
|
|
247459
|
+
const anchorPosition = fabText.anchor_position ?? { x: 0, y: 0 };
|
|
247460
|
+
const attrs = [
|
|
247461
|
+
`pcbX={${anchorPosition.x}}`,
|
|
247462
|
+
`pcbY={${anchorPosition.y}}`,
|
|
247463
|
+
`anchorAlignment="${fabText.anchor_alignment ?? "center"}"`,
|
|
247464
|
+
`text="${escapeJsxText(fabText.text)}"`
|
|
247465
|
+
];
|
|
247466
|
+
if (fabText.font !== undefined) {
|
|
247467
|
+
attrs.push(`font="${fabText.font}"`);
|
|
247468
|
+
}
|
|
247469
|
+
if (fabText.font_size !== undefined) {
|
|
247470
|
+
attrs.push(`fontSize={${fabText.font_size}}`);
|
|
247471
|
+
}
|
|
247472
|
+
if (fabText.color !== undefined) {
|
|
247473
|
+
attrs.push(`color="${fabText.color}"`);
|
|
247474
|
+
}
|
|
247475
|
+
if (fabText.layer === "bottom") {
|
|
247476
|
+
attrs.push(`layer="bottom"`);
|
|
247477
|
+
}
|
|
247478
|
+
elementStrings.push(`<fabricationnotetext ${attrs.join(" ")} />`);
|
|
247479
|
+
}
|
|
247480
|
+
for (const fabRect of fabricationNoteRects) {
|
|
247481
|
+
const center2 = fabRect.center ?? { x: 0, y: 0 };
|
|
247482
|
+
const attrs = [
|
|
247483
|
+
`pcbX={${center2.x}}`,
|
|
247484
|
+
`pcbY={${center2.y}}`,
|
|
247485
|
+
`width={${fabRect.width ?? 0}}`,
|
|
247486
|
+
`height={${fabRect.height ?? 0}}`
|
|
247487
|
+
];
|
|
247488
|
+
if (fabRect.stroke_width !== undefined) {
|
|
247489
|
+
attrs.push(`strokeWidth={${fabRect.stroke_width}}`);
|
|
247490
|
+
}
|
|
247491
|
+
if (fabRect.is_filled !== undefined) {
|
|
247492
|
+
attrs.push(`isFilled={${fabRect.is_filled}}`);
|
|
247493
|
+
}
|
|
247494
|
+
if (fabRect.has_stroke !== undefined) {
|
|
247495
|
+
attrs.push(`hasStroke={${fabRect.has_stroke}}`);
|
|
247496
|
+
}
|
|
247497
|
+
if (fabRect.is_stroke_dashed !== undefined) {
|
|
247498
|
+
attrs.push(`isStrokeDashed={${fabRect.is_stroke_dashed}}`);
|
|
247499
|
+
}
|
|
247500
|
+
if (fabRect.color !== undefined) {
|
|
247501
|
+
attrs.push(`color="${fabRect.color}"`);
|
|
247502
|
+
}
|
|
247503
|
+
if ("corner_radius" in fabRect && fabRect.corner_radius !== undefined) {
|
|
247504
|
+
attrs.push(`cornerRadius={${fabRect.corner_radius}}`);
|
|
247505
|
+
}
|
|
247506
|
+
if (fabRect.layer === "bottom") {
|
|
247507
|
+
attrs.push(`layer="bottom"`);
|
|
247508
|
+
}
|
|
247509
|
+
elementStrings.push(`<fabricationnoterect ${attrs.join(" ")} />`);
|
|
247510
|
+
}
|
|
247511
|
+
for (const fabDimension of fabricationNoteDimensions) {
|
|
247512
|
+
const fromPoint = fabDimension.from ?? { x: 0, y: 0 };
|
|
247513
|
+
const toPoint = fabDimension.to ?? { x: 0, y: 0 };
|
|
247514
|
+
const attrs = [
|
|
247515
|
+
`from={{ x: ${fromPoint.x}, y: ${fromPoint.y} }}`,
|
|
247516
|
+
`to={{ x: ${toPoint.x}, y: ${toPoint.y} }}`
|
|
247517
|
+
];
|
|
247518
|
+
if (fabDimension.text !== undefined) {
|
|
247519
|
+
attrs.push(`text="${escapeJsxText(fabDimension.text)}"`);
|
|
247520
|
+
}
|
|
247521
|
+
if (fabDimension.font !== undefined) {
|
|
247522
|
+
attrs.push(`font="${fabDimension.font}"`);
|
|
247523
|
+
}
|
|
247524
|
+
if (fabDimension.font_size !== undefined) {
|
|
247525
|
+
attrs.push(`fontSize={${fabDimension.font_size}}`);
|
|
247526
|
+
}
|
|
247527
|
+
if (fabDimension.color !== undefined) {
|
|
247528
|
+
attrs.push(`color="${fabDimension.color}"`);
|
|
247529
|
+
}
|
|
247530
|
+
if (fabDimension.arrow_size !== undefined) {
|
|
247531
|
+
attrs.push(`arrowSize={${fabDimension.arrow_size}}`);
|
|
247532
|
+
}
|
|
247533
|
+
if (fabDimension.offset !== undefined) {
|
|
247534
|
+
attrs.push(`offset={${fabDimension.offset}}`);
|
|
247535
|
+
} else if ("offset_distance" in fabDimension && fabDimension.offset_distance !== undefined) {
|
|
247536
|
+
attrs.push(`offset={${fabDimension.offset_distance}}`);
|
|
247537
|
+
}
|
|
247538
|
+
if (fabDimension.layer === "bottom") {
|
|
247539
|
+
attrs.push(`layer="bottom"`);
|
|
247540
|
+
}
|
|
247541
|
+
elementStrings.push(`<fabricationnotedimension ${attrs.join(" ")} />`);
|
|
247542
|
+
}
|
|
247543
|
+
return elementStrings;
|
|
247544
|
+
};
|
|
247545
|
+
var convertHoles = (circuitJson) => {
|
|
247546
|
+
const holes = su5(circuitJson).pcb_hole.list();
|
|
247330
247547
|
const elementStrings = [];
|
|
247331
247548
|
for (const hole of holes) {
|
|
247332
247549
|
if (hole.hole_shape === "circle") {
|
|
247333
247550
|
elementStrings.push(`<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" diameter="${mmStr(hole.hole_diameter)}" />`);
|
|
247551
|
+
} else if (hole.hole_shape === "rect") {
|
|
247552
|
+
elementStrings.push(`<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" width="${mmStr(hole.hole_width)}" height="${mmStr(hole.hole_height)}" shape="rect" />`);
|
|
247334
247553
|
} else if (hole.hole_shape === "oval") {
|
|
247335
|
-
|
|
247554
|
+
elementStrings.push(`<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" width="${mmStr(hole.hole_width)}" height="${mmStr(hole.hole_height)}" shape="oval" />`);
|
|
247555
|
+
} else if (hole.hole_shape === "pill" || hole.hole_shape === "rotated_pill") {
|
|
247556
|
+
elementStrings.push(`<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" width="${mmStr(hole.hole_width)}" height="${mmStr(hole.hole_height)}" shape="pill"${formatPcbRotationAttr("ccw_rotation" in hole ? hole.ccw_rotation : undefined)} />`);
|
|
247557
|
+
}
|
|
247558
|
+
}
|
|
247559
|
+
return elementStrings;
|
|
247560
|
+
};
|
|
247561
|
+
var convertKeepouts = (circuitJson) => {
|
|
247562
|
+
const pcbKeepouts = su62(circuitJson).pcb_keepout.list();
|
|
247563
|
+
const elementStrings = [];
|
|
247564
|
+
for (const keepout of pcbKeepouts) {
|
|
247565
|
+
if (keepout.shape === "rect") {
|
|
247566
|
+
elementStrings.push(`<keepout shape="rect" pcbX="${formatMm(keepout.center.x)}" pcbY="${formatMm(keepout.center.y)}" width="${formatMm(keepout.width)}" height="${formatMm(keepout.height)}" />`);
|
|
247567
|
+
} else if (keepout.shape === "circle") {
|
|
247568
|
+
elementStrings.push(`<keepout shape="circle" pcbX="${formatMm(keepout.center.x)}" pcbY="${formatMm(keepout.center.y)}" radius="${formatMm(keepout.radius)}" />`);
|
|
247569
|
+
} else {
|
|
247570
|
+
console.warn(`Unhandled pcb_keepout shape: ${keepout.shape}`);
|
|
247571
|
+
}
|
|
247572
|
+
}
|
|
247573
|
+
return elementStrings;
|
|
247574
|
+
};
|
|
247575
|
+
var convertNotes = (circuitJson) => {
|
|
247576
|
+
const noteTexts = su7(circuitJson).pcb_note_text.list();
|
|
247577
|
+
const noteRects = su7(circuitJson).pcb_note_rect.list();
|
|
247578
|
+
const notePaths = su7(circuitJson).pcb_note_path.list();
|
|
247579
|
+
const noteLines = su7(circuitJson).pcb_note_line.list();
|
|
247580
|
+
const noteDimensions = su7(circuitJson).pcb_note_dimension.list();
|
|
247581
|
+
const elementStrings = [];
|
|
247582
|
+
for (const noteText of noteTexts) {
|
|
247583
|
+
const anchorPosition = noteText.anchor_position ?? { x: 0, y: 0 };
|
|
247584
|
+
const colorAttr = noteText.color ? ` color="${noteText.color}"` : "";
|
|
247585
|
+
elementStrings.push(`<pcbnotetext pcbX={${anchorPosition.x}} pcbY={${anchorPosition.y}} anchorAlignment="${noteText.anchor_alignment ?? "center"}" font="${noteText.font ?? "tscircuit2024"}" fontSize={${noteText.font_size ?? 0}} text="${escapeJsxText(noteText.text)}"${colorAttr} />`);
|
|
247586
|
+
}
|
|
247587
|
+
for (const noteRect of noteRects) {
|
|
247588
|
+
const center2 = noteRect.center ?? { x: 0, y: 0 };
|
|
247589
|
+
const attrs = [
|
|
247590
|
+
`pcbX={${center2.x}}`,
|
|
247591
|
+
`pcbY={${center2.y}}`,
|
|
247592
|
+
`width={${noteRect.width ?? 0}}`,
|
|
247593
|
+
`height={${noteRect.height ?? 0}}`,
|
|
247594
|
+
`strokeWidth={${noteRect.stroke_width ?? 0}}`
|
|
247595
|
+
];
|
|
247596
|
+
if (noteRect.is_filled !== undefined) {
|
|
247597
|
+
attrs.push(`isFilled={${noteRect.is_filled}}`);
|
|
247598
|
+
}
|
|
247599
|
+
if (noteRect.has_stroke !== undefined) {
|
|
247600
|
+
attrs.push(`hasStroke={${noteRect.has_stroke}}`);
|
|
247601
|
+
}
|
|
247602
|
+
if (noteRect.is_stroke_dashed !== undefined) {
|
|
247603
|
+
attrs.push(`isStrokeDashed={${noteRect.is_stroke_dashed}}`);
|
|
247604
|
+
}
|
|
247605
|
+
if (noteRect.color !== undefined) {
|
|
247606
|
+
attrs.push(`color="${noteRect.color}"`);
|
|
247607
|
+
}
|
|
247608
|
+
elementStrings.push(`<pcbnoterect ${attrs.join(" ")} />`);
|
|
247609
|
+
}
|
|
247610
|
+
for (const notePath of notePaths) {
|
|
247611
|
+
const attrs = [`route={${JSON.stringify(notePath.route ?? [])}}`];
|
|
247612
|
+
if (notePath.stroke_width !== undefined) {
|
|
247613
|
+
attrs.push(`strokeWidth={${notePath.stroke_width}}`);
|
|
247614
|
+
}
|
|
247615
|
+
if (notePath.color !== undefined) {
|
|
247616
|
+
attrs.push(`color="${notePath.color}"`);
|
|
247617
|
+
}
|
|
247618
|
+
elementStrings.push(`<pcbnotepath ${attrs.join(" ")} />`);
|
|
247619
|
+
}
|
|
247620
|
+
for (const noteLine of noteLines) {
|
|
247621
|
+
const attrs = [
|
|
247622
|
+
`x1={${noteLine.x1 ?? 0}}`,
|
|
247623
|
+
`y1={${noteLine.y1 ?? 0}}`,
|
|
247624
|
+
`x2={${noteLine.x2 ?? 0}}`,
|
|
247625
|
+
`y2={${noteLine.y2 ?? 0}}`
|
|
247626
|
+
];
|
|
247627
|
+
if (noteLine.stroke_width !== undefined) {
|
|
247628
|
+
attrs.push(`strokeWidth={${noteLine.stroke_width}}`);
|
|
247629
|
+
}
|
|
247630
|
+
if (noteLine.color !== undefined) {
|
|
247631
|
+
attrs.push(`color="${noteLine.color}"`);
|
|
247632
|
+
}
|
|
247633
|
+
if (noteLine.is_dashed !== undefined) {
|
|
247634
|
+
attrs.push(`isDashed={${noteLine.is_dashed}}`);
|
|
247635
|
+
}
|
|
247636
|
+
elementStrings.push(`<pcbnoteline ${attrs.join(" ")} />`);
|
|
247637
|
+
}
|
|
247638
|
+
for (const noteDimension of noteDimensions) {
|
|
247639
|
+
const fromPoint = noteDimension.from ?? { x: 0, y: 0 };
|
|
247640
|
+
const toPoint = noteDimension.to ?? { x: 0, y: 0 };
|
|
247641
|
+
const attrs = [
|
|
247642
|
+
`from={{ x: ${fromPoint.x}, y: ${fromPoint.y} }}`,
|
|
247643
|
+
`to={{ x: ${toPoint.x}, y: ${toPoint.y} }}`,
|
|
247644
|
+
`font="${noteDimension.font ?? "tscircuit2024"}"`,
|
|
247645
|
+
`fontSize={${noteDimension.font_size ?? 0}}`
|
|
247646
|
+
];
|
|
247647
|
+
if (noteDimension.arrow_size !== undefined) {
|
|
247648
|
+
attrs.push(`arrowSize={${noteDimension.arrow_size}}`);
|
|
247336
247649
|
}
|
|
247650
|
+
if ("offset" in noteDimension) {
|
|
247651
|
+
const offsetValue = noteDimension.offset;
|
|
247652
|
+
if (offsetValue !== undefined) {
|
|
247653
|
+
attrs.push(`offset={${offsetValue}}`);
|
|
247654
|
+
}
|
|
247655
|
+
}
|
|
247656
|
+
if (noteDimension.text !== undefined) {
|
|
247657
|
+
attrs.push(`text="${escapeJsxText(noteDimension.text)}"`);
|
|
247658
|
+
}
|
|
247659
|
+
if (noteDimension.color !== undefined) {
|
|
247660
|
+
attrs.push(`color="${noteDimension.color}"`);
|
|
247661
|
+
}
|
|
247662
|
+
elementStrings.push(`<pcbnotedimension ${attrs.join(" ")} />`);
|
|
247337
247663
|
}
|
|
247664
|
+
return elementStrings;
|
|
247665
|
+
};
|
|
247666
|
+
var convertPlatedHoles2 = (circuitJson) => {
|
|
247667
|
+
const platedHoles = su8(circuitJson).pcb_plated_hole.list();
|
|
247668
|
+
const elementStrings = [];
|
|
247338
247669
|
for (const platedHole of platedHoles) {
|
|
247339
247670
|
if (platedHole.shape === "oval" || platedHole.shape === "pill") {
|
|
247340
|
-
elementStrings.push(`<platedhole portHints={${JSON.stringify(platedHole.port_hints)}} pcbX="${mmStr(platedHole.x)}" pcbY="${mmStr(platedHole.y)}" outerHeight="${mmStr(platedHole.outer_height)}" outerWidth="${mmStr(platedHole.outer_width)}" holeHeight="${mmStr(platedHole.hole_height)}" holeWidth="${mmStr(platedHole.hole_width)}" height="${mmStr(platedHole.hole_height)}" shape="${platedHole.shape}" />`);
|
|
247671
|
+
elementStrings.push(`<platedhole portHints={${JSON.stringify(platedHole.port_hints)}} pcbX="${mmStr(platedHole.x)}" pcbY="${mmStr(platedHole.y)}"${formatSolderMaskAttrs(platedHole)} outerHeight="${mmStr(platedHole.outer_height)}" outerWidth="${mmStr(platedHole.outer_width)}" holeHeight="${mmStr(platedHole.hole_height)}" holeWidth="${mmStr(platedHole.hole_width)}" height="${mmStr(platedHole.hole_height)}" shape="${platedHole.shape}"${formatPcbRotationAttr("ccw_rotation" in platedHole ? platedHole.ccw_rotation : undefined)} />`);
|
|
247341
247672
|
} else if (platedHole.shape === "circle") {
|
|
247342
|
-
elementStrings.push(`<platedhole portHints={${JSON.stringify(platedHole.port_hints)}} pcbX="${mmStr(platedHole.x)}" pcbY="${mmStr(platedHole.y)}" outerDiameter="${mmStr(platedHole.outer_diameter)}" holeDiameter="${mmStr(platedHole.hole_diameter)}" shape="circle" />`);
|
|
247673
|
+
elementStrings.push(`<platedhole portHints={${JSON.stringify(platedHole.port_hints)}} pcbX="${mmStr(platedHole.x)}" pcbY="${mmStr(platedHole.y)}"${formatSolderMaskAttrs(platedHole)} outerDiameter="${mmStr(platedHole.outer_diameter)}" holeDiameter="${mmStr(platedHole.hole_diameter)}" shape="circle" />`);
|
|
247674
|
+
} else if (platedHole.shape === "circular_hole_with_rect_pad") {
|
|
247675
|
+
elementStrings.push(`<platedhole portHints={${JSON.stringify(platedHole.port_hints)}} pcbX="${mmStr(platedHole.x)}" pcbY="${mmStr(platedHole.y)}"${platedHole.hole_shape === undefined ? "" : ` holeShape="${platedHole.hole_shape}"`}${platedHole.pad_shape === undefined ? "" : ` padShape="${platedHole.pad_shape}"`}${formatSolderMaskAttrs(platedHole)} holeDiameter="${mmStr(platedHole.hole_diameter)}" rectPadWidth="${mmStr(platedHole.rect_pad_width)}" rectPadHeight="${mmStr(platedHole.rect_pad_height)}"${formatOptionalMmAttr("rectBorderRadius", platedHole.rect_border_radius)}${formatOptionalMmAttr("holeOffsetX", platedHole.hole_offset_x)}${formatOptionalMmAttr("holeOffsetY", platedHole.hole_offset_y)}${formatPcbRotationAttr(platedHole.rect_ccw_rotation)} shape="circular_hole_with_rect_pad" />`);
|
|
247676
|
+
} else if (platedHole.shape === "pill_hole_with_rect_pad" || platedHole.shape === "rotated_pill_hole_with_rect_pad") {
|
|
247677
|
+
const holeShape = platedHole.shape === "rotated_pill_hole_with_rect_pad" ? "pill" : platedHole.hole_shape;
|
|
247678
|
+
const rotation4 = platedHole.shape === "rotated_pill_hole_with_rect_pad" ? platedHole.hole_ccw_rotation : undefined;
|
|
247679
|
+
elementStrings.push(`<platedhole portHints={${JSON.stringify(platedHole.port_hints)}} pcbX="${mmStr(platedHole.x)}" pcbY="${mmStr(platedHole.y)}"${holeShape === undefined ? "" : ` holeShape="${holeShape}"`}${platedHole.pad_shape === undefined ? "" : ` padShape="${platedHole.pad_shape}"`}${formatSolderMaskAttrs(platedHole)} holeWidth="${mmStr(platedHole.hole_width)}" holeHeight="${mmStr(platedHole.hole_height)}" rectPadWidth="${mmStr(platedHole.rect_pad_width)}" rectPadHeight="${mmStr(platedHole.rect_pad_height)}"${formatOptionalMmAttr("rectBorderRadius", platedHole.rect_border_radius)}${formatOptionalMmAttr("holeOffsetX", platedHole.hole_offset_x)}${formatOptionalMmAttr("holeOffsetY", platedHole.hole_offset_y)}${formatPcbRotationAttr(rotation4)} shape="pill_hole_with_rect_pad" />`);
|
|
247680
|
+
} else if (platedHole.shape === "hole_with_polygon_pad") {
|
|
247681
|
+
const holeSizeAttrs = platedHole.hole_shape === "circle" ? ` holeDiameter="${mmStr(platedHole.hole_diameter ?? 0)}"` : `${formatOptionalMmAttr("holeWidth", platedHole.hole_width)}${formatOptionalMmAttr("holeHeight", platedHole.hole_height)}`;
|
|
247682
|
+
elementStrings.push(`<platedhole portHints={${JSON.stringify(platedHole.port_hints)}} pcbX="${mmStr(platedHole.x)}" pcbY="${mmStr(platedHole.y)}"${platedHole.hole_shape === undefined ? "" : ` holeShape="${platedHole.hole_shape}"`}${formatSolderMaskAttrs(platedHole)}${holeSizeAttrs} padOutline={${JSON.stringify(platedHole.pad_outline)}} holeOffsetX="${mmStr(platedHole.hole_offset_x ?? 0)}" holeOffsetY="${mmStr(platedHole.hole_offset_y ?? 0)}" shape="hole_with_polygon_pad" />`);
|
|
247683
|
+
}
|
|
247684
|
+
}
|
|
247685
|
+
return elementStrings;
|
|
247686
|
+
};
|
|
247687
|
+
var convertSilkscreen = (circuitJson) => {
|
|
247688
|
+
const silkscreenLines = su9(circuitJson).pcb_silkscreen_line.list();
|
|
247689
|
+
const silkscreenPaths = su9(circuitJson).pcb_silkscreen_path.list();
|
|
247690
|
+
const silkscreenRects = su9(circuitJson).pcb_silkscreen_rect.list();
|
|
247691
|
+
const silkscreenCircles = su9(circuitJson).pcb_silkscreen_circle.list();
|
|
247692
|
+
const elementStrings = [];
|
|
247693
|
+
for (const silkscreenPath of silkscreenPaths) {
|
|
247694
|
+
elementStrings.push(`<silkscreenpath route={${JSON.stringify(silkscreenPath.route)}} />`);
|
|
247695
|
+
}
|
|
247696
|
+
for (const silkscreenRect of silkscreenRects) {
|
|
247697
|
+
const center2 = silkscreenRect.center ?? { x: 0, y: 0 };
|
|
247698
|
+
const attrs = [
|
|
247699
|
+
`pcbX={${center2.x}}`,
|
|
247700
|
+
`pcbY={${center2.y}}`,
|
|
247701
|
+
`width={${silkscreenRect.width ?? 0}}`,
|
|
247702
|
+
`height={${silkscreenRect.height ?? 0}}`,
|
|
247703
|
+
`layer="${silkscreenRect.layer}"`
|
|
247704
|
+
];
|
|
247705
|
+
if (silkscreenRect.stroke_width !== undefined) {
|
|
247706
|
+
attrs.push(`strokeWidth={${silkscreenRect.stroke_width}}`);
|
|
247707
|
+
}
|
|
247708
|
+
if (silkscreenRect.is_filled !== undefined) {
|
|
247709
|
+
attrs.push(`filled={${silkscreenRect.is_filled}}`);
|
|
247710
|
+
}
|
|
247711
|
+
if (silkscreenRect.corner_radius !== undefined) {
|
|
247712
|
+
attrs.push(`cornerRadius={${silkscreenRect.corner_radius}}`);
|
|
247713
|
+
}
|
|
247714
|
+
elementStrings.push(`<silkscreenrect ${attrs.join(" ")} />`);
|
|
247715
|
+
}
|
|
247716
|
+
for (const silkscreenCircle of silkscreenCircles) {
|
|
247717
|
+
const center2 = silkscreenCircle.center ?? { x: 0, y: 0 };
|
|
247718
|
+
const attrs = [
|
|
247719
|
+
`pcbX={${center2.x}}`,
|
|
247720
|
+
`pcbY={${center2.y}}`,
|
|
247721
|
+
`radius={${silkscreenCircle.radius ?? 0}}`,
|
|
247722
|
+
`layer="${silkscreenCircle.layer}"`
|
|
247723
|
+
];
|
|
247724
|
+
if (silkscreenCircle.stroke_width !== undefined) {
|
|
247725
|
+
attrs.push(`strokeWidth={${silkscreenCircle.stroke_width}}`);
|
|
247726
|
+
}
|
|
247727
|
+
if (silkscreenCircle.is_filled !== undefined) {
|
|
247728
|
+
attrs.push(`isFilled={${silkscreenCircle.is_filled}}`);
|
|
247343
247729
|
}
|
|
247730
|
+
elementStrings.push(`<silkscreencircle ${attrs.join(" ")} />`);
|
|
247344
247731
|
}
|
|
247732
|
+
for (const silkscreenLine of silkscreenLines) {
|
|
247733
|
+
const attrs = [
|
|
247734
|
+
`x1={${silkscreenLine.x1 ?? 0}}`,
|
|
247735
|
+
`y1={${silkscreenLine.y1 ?? 0}}`,
|
|
247736
|
+
`x2={${silkscreenLine.x2 ?? 0}}`,
|
|
247737
|
+
`y2={${silkscreenLine.y2 ?? 0}}`
|
|
247738
|
+
];
|
|
247739
|
+
if (silkscreenLine.stroke_width !== undefined) {
|
|
247740
|
+
attrs.push(`strokeWidth={${silkscreenLine.stroke_width}}`);
|
|
247741
|
+
}
|
|
247742
|
+
if (silkscreenLine.layer === "bottom") {
|
|
247743
|
+
attrs.push(`layer="bottom"`);
|
|
247744
|
+
}
|
|
247745
|
+
elementStrings.push(`<silkscreenline ${attrs.join(" ")} />`);
|
|
247746
|
+
}
|
|
247747
|
+
return elementStrings;
|
|
247748
|
+
};
|
|
247749
|
+
var convertSilkscreenText = (circuitJson) => {
|
|
247750
|
+
const silkscreenTexts = su10(circuitJson).pcb_silkscreen_text.list();
|
|
247751
|
+
const elementStrings = [];
|
|
247752
|
+
for (const silkscreenText of silkscreenTexts) {
|
|
247753
|
+
const pcbX = silkscreenText.anchor_position?.x ?? 0;
|
|
247754
|
+
const pcbY = silkscreenText.anchor_position?.y ?? 0;
|
|
247755
|
+
const knockoutPadding = silkscreenText.knockout_padding;
|
|
247756
|
+
const hasUniformKnockoutPadding = knockoutPadding && knockoutPadding.left === knockoutPadding.top && knockoutPadding.top === knockoutPadding.right && knockoutPadding.right === knockoutPadding.bottom;
|
|
247757
|
+
elementStrings.push(`<silkscreentext pcbX={${pcbX}} pcbY={${pcbY}} anchorAlignment="${silkscreenText.anchor_alignment}" fontSize={${silkscreenText.font_size}}${silkscreenText.font !== undefined ? ` font="${silkscreenText.font}"` : ""}${silkscreenText.ccw_rotation !== undefined ? ` pcbRotation="${typeof silkscreenText.ccw_rotation === "number" ? `${silkscreenText.ccw_rotation}deg` : silkscreenText.ccw_rotation}"` : ""}${silkscreenText.is_knockout !== undefined ? ` isKnockout={${silkscreenText.is_knockout}}` : ""}${knockoutPadding ? hasUniformKnockoutPadding ? ` knockoutPadding="${mmStr(knockoutPadding.left)}"` : ` knockoutPaddingLeft="${mmStr(knockoutPadding.left)}" knockoutPaddingTop="${mmStr(knockoutPadding.top)}" knockoutPaddingRight="${mmStr(knockoutPadding.right)}" knockoutPaddingBottom="${mmStr(knockoutPadding.bottom)}"` : ""}${silkscreenText.is_mirrored !== undefined ? ` mirrored={${silkscreenText.is_mirrored}}` : ""}${silkscreenText.layer !== undefined ? ` layer="${silkscreenText.layer}"` : ""} text="${escapeJsxText(silkscreenText.text)}" />`);
|
|
247758
|
+
}
|
|
247759
|
+
return elementStrings;
|
|
247760
|
+
};
|
|
247761
|
+
var convertSmtPads = (circuitJson) => {
|
|
247762
|
+
const smtPads = su11(circuitJson).pcb_smtpad.list();
|
|
247763
|
+
const elementStrings = [];
|
|
247345
247764
|
for (const smtPad of smtPads) {
|
|
247346
247765
|
if (smtPad.shape === "circle") {
|
|
247347
247766
|
elementStrings.push(`<smtpad portHints={${JSON.stringify(smtPad.port_hints)}} pcbX="${mmStr(smtPad.x)}" pcbY="${mmStr(smtPad.y)}" radius="${mmStr(smtPad.radius)}" shape="circle" />`);
|
|
247348
247767
|
} else if (smtPad.shape === "rect") {
|
|
247349
247768
|
elementStrings.push(`<smtpad portHints={${JSON.stringify(smtPad.port_hints)}} pcbX="${mmStr(smtPad.x)}" pcbY="${mmStr(smtPad.y)}" width="${mmStr(smtPad.width)}" height="${mmStr(smtPad.height)}" shape="rect" />`);
|
|
247769
|
+
} else if (smtPad.shape === "pill") {
|
|
247770
|
+
elementStrings.push(`<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" />`);
|
|
247771
|
+
} else if (smtPad.shape === "polygon") {
|
|
247772
|
+
elementStrings.push(`<smtpad portHints={${JSON.stringify(smtPad.port_hints)}} shape="polygon" points={${JSON.stringify(smtPad.points)}} />`);
|
|
247773
|
+
} else if (smtPad.shape === "rotated_rect") {
|
|
247774
|
+
elementStrings.push(`<smtpad portHints={${JSON.stringify(smtPad.port_hints)}} pcbX="${mmStr(smtPad.x)}" pcbY="${mmStr(smtPad.y)}" width="${mmStr(smtPad.width)}" height="${mmStr(smtPad.height)}" ccwRotation={${smtPad.ccw_rotation}} shape="rotated_rect" />`);
|
|
247350
247775
|
}
|
|
247351
247776
|
}
|
|
247352
|
-
|
|
247353
|
-
|
|
247354
|
-
|
|
247355
|
-
|
|
247356
|
-
|
|
247357
|
-
|
|
247358
|
-
|
|
247359
|
-
|
|
247360
|
-
|
|
247361
|
-
|
|
247362
|
-
|
|
247363
|
-
|
|
247364
|
-
|
|
247365
|
-
|
|
247777
|
+
return elementStrings;
|
|
247778
|
+
};
|
|
247779
|
+
var generateFootprintTsx = (circuitJson) => {
|
|
247780
|
+
const converters = [
|
|
247781
|
+
convertHoles,
|
|
247782
|
+
convertPlatedHoles2,
|
|
247783
|
+
convertSmtPads,
|
|
247784
|
+
convertSilkscreen,
|
|
247785
|
+
convertFabrication,
|
|
247786
|
+
convertSilkscreenText,
|
|
247787
|
+
convertCopperText,
|
|
247788
|
+
convertKeepouts,
|
|
247789
|
+
convertCutouts,
|
|
247790
|
+
convertNotes,
|
|
247791
|
+
convertCourtyard
|
|
247792
|
+
];
|
|
247793
|
+
const elementStrings = converters.flatMap((convert) => convert(circuitJson));
|
|
247794
|
+
if (elementStrings.length === 0) {
|
|
247795
|
+
return null;
|
|
247366
247796
|
}
|
|
247367
247797
|
return `
|
|
247368
247798
|
<footprint>
|
|
@@ -247371,6 +247801,206 @@ var generateFootprintTsx = (circuitJson) => {
|
|
|
247371
247801
|
</footprint>
|
|
247372
247802
|
`.trim();
|
|
247373
247803
|
};
|
|
247804
|
+
var escapeJsxText2 = (text) => text.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
247805
|
+
var generateSymbolTsx = (circuitJson) => {
|
|
247806
|
+
const schematicArcs = su12(circuitJson).schematic_arc.list();
|
|
247807
|
+
const schematicLines = su12(circuitJson).schematic_line.list();
|
|
247808
|
+
const schematicPaths = su12(circuitJson).schematic_path.list();
|
|
247809
|
+
const schematicTexts = su12(circuitJson).schematic_text.list();
|
|
247810
|
+
const schematicCircles = su12(circuitJson).schematic_circle.list();
|
|
247811
|
+
const schematicBoxes = su12(circuitJson).schematic_box.list();
|
|
247812
|
+
const schematicRects = su12(circuitJson).schematic_rect.list();
|
|
247813
|
+
const schematicTables = su12(circuitJson).schematic_table.list();
|
|
247814
|
+
const schematicTableCells = su12(circuitJson).schematic_table_cell.list();
|
|
247815
|
+
const elementStrings = [];
|
|
247816
|
+
for (const arc2 of schematicArcs) {
|
|
247817
|
+
const center2 = arc2.center ?? { x: 0, y: 0 };
|
|
247818
|
+
const radius = arc2.radius ?? 0;
|
|
247819
|
+
const startAngle = arc2.start_angle_degrees ?? 0;
|
|
247820
|
+
const endAngle = arc2.end_angle_degrees ?? 0;
|
|
247821
|
+
const strokeWidth = arc2.stroke_width ?? 0.05;
|
|
247822
|
+
const color = arc2.color ?? "black";
|
|
247823
|
+
const isDashed = arc2.is_dashed ?? false;
|
|
247824
|
+
const direction2 = arc2.direction ?? "counterclockwise";
|
|
247825
|
+
elementStrings.push(`<schematicarc
|
|
247826
|
+
center={{ x: ${center2.x}, y: ${center2.y} }}
|
|
247827
|
+
radius={${radius}}
|
|
247828
|
+
startAngleDegrees={${startAngle}}
|
|
247829
|
+
endAngleDegrees={${endAngle}}
|
|
247830
|
+
strokeWidth={${strokeWidth}}
|
|
247831
|
+
color="${color}"
|
|
247832
|
+
isDashed={${isDashed}}
|
|
247833
|
+
direction="${direction2}"
|
|
247834
|
+
/>`);
|
|
247835
|
+
}
|
|
247836
|
+
for (const line2 of schematicLines) {
|
|
247837
|
+
const x12 = line2.x1 ?? 0;
|
|
247838
|
+
const y12 = line2.y1 ?? 0;
|
|
247839
|
+
const x23 = line2.x2 ?? 0;
|
|
247840
|
+
const y23 = line2.y2 ?? 0;
|
|
247841
|
+
const strokeWidth = line2.stroke_width ?? 0.05;
|
|
247842
|
+
const color = line2.color ?? "black";
|
|
247843
|
+
const isDashed = line2.is_dashed ?? false;
|
|
247844
|
+
const dashLength = line2.dash_length;
|
|
247845
|
+
const dashGap = line2.dash_gap;
|
|
247846
|
+
const attrs = [
|
|
247847
|
+
`x1={${x12}}`,
|
|
247848
|
+
`y1={${y12}}`,
|
|
247849
|
+
`x2={${x23}}`,
|
|
247850
|
+
`y2={${y23}}`,
|
|
247851
|
+
`strokeWidth={${strokeWidth}}`,
|
|
247852
|
+
`color="${color}"`,
|
|
247853
|
+
`isDashed={${isDashed}}`
|
|
247854
|
+
];
|
|
247855
|
+
if (dashLength != null) {
|
|
247856
|
+
attrs.push(`dashLength={${dashLength}}`);
|
|
247857
|
+
}
|
|
247858
|
+
if (dashGap != null) {
|
|
247859
|
+
attrs.push(`dashGap={${dashGap}}`);
|
|
247860
|
+
}
|
|
247861
|
+
elementStrings.push(`<schematicline ${attrs.join(" ")}/>`);
|
|
247862
|
+
}
|
|
247863
|
+
for (const box2 of schematicBoxes) {
|
|
247864
|
+
const x3 = box2.x ?? 0;
|
|
247865
|
+
const y4 = box2.y ?? 0;
|
|
247866
|
+
const width = box2.width ?? 0;
|
|
247867
|
+
const height = box2.height ?? 0;
|
|
247868
|
+
const isDashed = box2.is_dashed ?? false;
|
|
247869
|
+
elementStrings.push(`<schematicbox center={{ x: ${x3}, y: ${y4} }} width={${width}} height={${height}} isDashed={${isDashed}}/>`);
|
|
247870
|
+
}
|
|
247871
|
+
for (const rect of schematicRects) {
|
|
247872
|
+
const center2 = rect.center ?? { x: 0, y: 0 };
|
|
247873
|
+
const width = rect.width ?? 0;
|
|
247874
|
+
const height = rect.height ?? 0;
|
|
247875
|
+
const rotation4 = rect.rotation ?? 0;
|
|
247876
|
+
const strokeWidth = rect.stroke_width ?? 0;
|
|
247877
|
+
const color = rect.color ?? "black";
|
|
247878
|
+
const isFilled = rect.is_filled ?? false;
|
|
247879
|
+
const fillColor = rect.fill_color ?? color;
|
|
247880
|
+
const isDashed = rect.is_dashed ?? false;
|
|
247881
|
+
elementStrings.push(`<schematicrect schX={${center2.x}} schY={${center2.y}} width={${width}} height={${height}} rotation={${rotation4}} strokeWidth={${strokeWidth}} color="${color}" isFilled={${isFilled}} fillColor="${fillColor}" isDashed={${isDashed}} />`);
|
|
247882
|
+
}
|
|
247883
|
+
for (const path49 of schematicPaths) {
|
|
247884
|
+
const points = path49.points ?? [];
|
|
247885
|
+
const fillColor = path49.fill_color ?? "red";
|
|
247886
|
+
const isFilled = path49.is_filled ?? false;
|
|
247887
|
+
const dashLength = path49.dash_length;
|
|
247888
|
+
const dashGap = path49.dash_gap;
|
|
247889
|
+
const attrs = [
|
|
247890
|
+
`points={${JSON.stringify(points)}}`,
|
|
247891
|
+
`strokeColor="${fillColor}"`,
|
|
247892
|
+
`fillColor="${fillColor}"`,
|
|
247893
|
+
`isFilled={${isFilled}}`
|
|
247894
|
+
];
|
|
247895
|
+
if (dashLength != null) {
|
|
247896
|
+
attrs.push(`dashLength={${dashLength}}`);
|
|
247897
|
+
}
|
|
247898
|
+
if (dashGap != null) {
|
|
247899
|
+
attrs.push(`dashGap={${dashGap}}`);
|
|
247900
|
+
}
|
|
247901
|
+
elementStrings.push(`<schematicpath ${attrs.join(" ")}/>`);
|
|
247902
|
+
}
|
|
247903
|
+
for (const text of schematicTexts) {
|
|
247904
|
+
const x3 = text.position?.x ?? 0;
|
|
247905
|
+
const y4 = text.position?.y ?? 0;
|
|
247906
|
+
const rawText = String(text.text ?? "");
|
|
247907
|
+
const escapedText = escapeJsxText2(rawText);
|
|
247908
|
+
const anchorAlignment = text.anchor ?? "center";
|
|
247909
|
+
const fontSize = text.font_size ?? 0.1;
|
|
247910
|
+
const color = text.color ?? "black";
|
|
247911
|
+
const rotation4 = text.rotation ?? 0;
|
|
247912
|
+
elementStrings.push(`<schematictext text="${escapedText}" x={${x3}} y={${y4}} anchorAlignment="${anchorAlignment}" fontSize={${fontSize}} color="${color}" rotation={${rotation4}} />`);
|
|
247913
|
+
}
|
|
247914
|
+
for (const circle2 of schematicCircles) {
|
|
247915
|
+
const x3 = circle2.center?.x ?? 0;
|
|
247916
|
+
const y4 = circle2.center?.y ?? 0;
|
|
247917
|
+
const radius = circle2.radius ?? 0;
|
|
247918
|
+
const strokeWidth = circle2.stroke_width ?? 0.05;
|
|
247919
|
+
const color = circle2.color ?? "black";
|
|
247920
|
+
const isFilled = circle2.is_filled ?? false;
|
|
247921
|
+
const isDashed = circle2.is_dashed ?? false;
|
|
247922
|
+
elementStrings.push(`<schematiccircle center={{ x: ${x3}, y: ${y4} }} radius={${radius}} strokeWidth={${strokeWidth}} color="${color}" isFilled={${isFilled}} isDashed={${isDashed}} />`);
|
|
247923
|
+
}
|
|
247924
|
+
for (const table of schematicTables) {
|
|
247925
|
+
const tableCells = schematicTableCells.filter((cell) => cell.schematic_table_id === table.schematic_table_id).sort((a2, b) => {
|
|
247926
|
+
if (a2.start_row_index !== b.start_row_index) {
|
|
247927
|
+
return a2.start_row_index - b.start_row_index;
|
|
247928
|
+
}
|
|
247929
|
+
return a2.start_column_index - b.start_column_index;
|
|
247930
|
+
});
|
|
247931
|
+
const rowCount = table.row_heights.length;
|
|
247932
|
+
const rowStrings = [];
|
|
247933
|
+
for (let rowIndex = 0;rowIndex < rowCount; rowIndex++) {
|
|
247934
|
+
const rowHeight = table.row_heights[rowIndex];
|
|
247935
|
+
const rowCells = tableCells.filter((cell) => cell.start_row_index === rowIndex);
|
|
247936
|
+
const cellStrings = [];
|
|
247937
|
+
for (const cell of rowCells) {
|
|
247938
|
+
const rowSpan = cell.end_row_index - cell.start_row_index + 1;
|
|
247939
|
+
const colSpan = cell.end_column_index - cell.start_column_index + 1;
|
|
247940
|
+
const columnWidths = table.column_widths.slice(cell.start_column_index, cell.end_column_index + 1);
|
|
247941
|
+
const averageColumnWidth = columnWidths.length > 0 ? columnWidths.reduce((sum, width) => sum + width, 0) / columnWidths.length : cell.width / Math.max(colSpan, 1);
|
|
247942
|
+
const props = [];
|
|
247943
|
+
const text = cell.text ?? "";
|
|
247944
|
+
if (text.length > 0) {
|
|
247945
|
+
props.push(`text="${escapeJsxText2(text)}"`);
|
|
247946
|
+
}
|
|
247947
|
+
if (cell.horizontal_align) {
|
|
247948
|
+
props.push(`horizontalAlign="${cell.horizontal_align}"`);
|
|
247949
|
+
}
|
|
247950
|
+
if (cell.vertical_align) {
|
|
247951
|
+
props.push(`verticalAlign="${cell.vertical_align}"`);
|
|
247952
|
+
}
|
|
247953
|
+
if (cell.font_size != null) {
|
|
247954
|
+
props.push(`fontSize={${cell.font_size}}`);
|
|
247955
|
+
}
|
|
247956
|
+
if (rowSpan !== 1) {
|
|
247957
|
+
props.push(`rowSpan={${rowSpan}}`);
|
|
247958
|
+
}
|
|
247959
|
+
if (colSpan !== 1) {
|
|
247960
|
+
props.push(`colSpan={${colSpan}}`);
|
|
247961
|
+
}
|
|
247962
|
+
if (averageColumnWidth > 0) {
|
|
247963
|
+
props.push(`width={${averageColumnWidth}}`);
|
|
247964
|
+
}
|
|
247965
|
+
cellStrings.push(`<schematiccell ${props.join(" ")} />`);
|
|
247966
|
+
}
|
|
247967
|
+
rowStrings.push(`<schematicrow height={${rowHeight}}>
|
|
247968
|
+
${cellStrings.join(`
|
|
247969
|
+
`)}
|
|
247970
|
+
</schematicrow>`);
|
|
247971
|
+
}
|
|
247972
|
+
const tableProps = [
|
|
247973
|
+
`schX={${table.anchor_position.x}}`,
|
|
247974
|
+
`schY={${table.anchor_position.y}}`
|
|
247975
|
+
];
|
|
247976
|
+
if (table.cell_padding != null) {
|
|
247977
|
+
tableProps.push(`cellPadding={${table.cell_padding}}`);
|
|
247978
|
+
}
|
|
247979
|
+
if (table.border_width != null) {
|
|
247980
|
+
tableProps.push(`borderWidth={${table.border_width}}`);
|
|
247981
|
+
}
|
|
247982
|
+
if (table.anchor) {
|
|
247983
|
+
tableProps.push(`anchor="${table.anchor}"`);
|
|
247984
|
+
}
|
|
247985
|
+
elementStrings.push(`<schematictable ${tableProps.join(" ")}>
|
|
247986
|
+
${rowStrings.map((s2) => s2.split(`
|
|
247987
|
+
`).join(`
|
|
247988
|
+
`)).join(`
|
|
247989
|
+
`)}
|
|
247990
|
+
</schematictable>`);
|
|
247991
|
+
}
|
|
247992
|
+
if (elementStrings.length === 0) {
|
|
247993
|
+
return null;
|
|
247994
|
+
}
|
|
247995
|
+
return `
|
|
247996
|
+
<symbol>
|
|
247997
|
+
${elementStrings.map((s2) => s2.split(`
|
|
247998
|
+
`).join(`
|
|
247999
|
+
`)).join(`
|
|
248000
|
+
`)}
|
|
248001
|
+
</symbol>
|
|
248002
|
+
`.trim();
|
|
248003
|
+
};
|
|
247374
248004
|
var getComponentUsingTemplate = ({
|
|
247375
248005
|
pinLabels,
|
|
247376
248006
|
componentName,
|
|
@@ -247380,12 +248010,14 @@ var getComponentUsingTemplate = ({
|
|
|
247380
248010
|
manufacturerPartNumber
|
|
247381
248011
|
}) => {
|
|
247382
248012
|
const footprintTsx = generateFootprintTsx(circuitJson);
|
|
248013
|
+
const symbolTsx = generateSymbolTsx(circuitJson);
|
|
247383
248014
|
return `
|
|
247384
248015
|
import { type ChipProps } from "tscircuit"
|
|
247385
248016
|
${pinLabels ? `const pinLabels = ${JSON.stringify(pinLabels, null, " ")} as const
|
|
247386
248017
|
` : ""}export const ${componentName} = (props: ChipProps${pinLabels ? `<typeof pinLabels>` : ""}) => (
|
|
247387
248018
|
<chip
|
|
247388
|
-
footprint={${footprintTsx}}
|
|
248019
|
+
${footprintTsx ? `footprint={${footprintTsx}}` : ""}
|
|
248020
|
+
${symbolTsx ? `symbol={${symbolTsx}}` : ""}
|
|
247389
248021
|
${pinLabels ? "pinLabels={pinLabels}" : ""}
|
|
247390
248022
|
${objUrl ? `cadModel={{
|
|
247391
248023
|
objUrl: "${objUrl}",
|
|
@@ -252236,16 +252868,16 @@ import {
|
|
|
252236
252868
|
} from "circuit-to-svg";
|
|
252237
252869
|
|
|
252238
252870
|
// node_modules/dsn-converter/dist/index.js
|
|
252239
|
-
import { su as
|
|
252871
|
+
import { su as su13 } from "@tscircuit/soup-util";
|
|
252240
252872
|
import { applyToPoint as applyToPoint25, scale as scale7 } from "transformation-matrix";
|
|
252241
|
-
import { su as
|
|
252242
|
-
import { su as
|
|
252873
|
+
import { su as su24 } from "@tscircuit/soup-util";
|
|
252874
|
+
import { su as su34 } from "@tscircuit/soup-util";
|
|
252243
252875
|
import Debug4 from "debug";
|
|
252244
|
-
import { su as
|
|
252876
|
+
import { su as su43 } from "@tscircuit/soup-util";
|
|
252245
252877
|
import { applyToPoint as applyToPoint24, scale as scale22 } from "transformation-matrix";
|
|
252246
252878
|
import Debug22 from "debug";
|
|
252247
252879
|
import { applyToPoint as applyToPoint92, scale as scale32 } from "transformation-matrix";
|
|
252248
|
-
import { su as
|
|
252880
|
+
import { su as su52 } from "@tscircuit/soup-util";
|
|
252249
252881
|
import { applyToPoint as applyToPoint32 } from "transformation-matrix";
|
|
252250
252882
|
import Debug32 from "debug";
|
|
252251
252883
|
import { applyToPoint as applyToPoint42 } from "transformation-matrix";
|
|
@@ -252257,7 +252889,7 @@ import { applyToPoint as applyToPoint62 } from "transformation-matrix";
|
|
|
252257
252889
|
import Debug5 from "debug";
|
|
252258
252890
|
import { applyToPoint as applyToPoint72 } from "transformation-matrix";
|
|
252259
252891
|
import"transformation-matrix";
|
|
252260
|
-
import { su as
|
|
252892
|
+
import { su as su63 } from "@tscircuit/soup-util";
|
|
252261
252893
|
import Debug7 from "debug";
|
|
252262
252894
|
import { applyToPoint as applyToPoint112, scale as scale42 } from "transformation-matrix";
|
|
252263
252895
|
import"transformation-matrix";
|
|
@@ -252488,8 +253120,8 @@ function processComponentsAndPads(componentGroups, circuitElements, pcb) {
|
|
|
252488
253120
|
const { pcb_component_id, pcb_smtpads } = group;
|
|
252489
253121
|
if (pcb_smtpads.length === 0)
|
|
252490
253122
|
continue;
|
|
252491
|
-
const pcbComponent =
|
|
252492
|
-
const sourceComponent =
|
|
253123
|
+
const pcbComponent = su13(circuitElements).pcb_component.list().find((e4) => e4.pcb_component_id === pcb_component_id);
|
|
253124
|
+
const sourceComponent = su13(circuitElements).source_component.list().find((e4) => e4.source_component_id === pcbComponent?.source_component_id);
|
|
252493
253125
|
const footprintName = getFootprintName(sourceComponent, pcbComponent);
|
|
252494
253126
|
const componentName = sourceComponent?.name || "Unknown";
|
|
252495
253127
|
const circuitSpaceCoordinates = applyToPoint25(transformMmToUm, pcbComponent.center);
|
|
@@ -252520,8 +253152,8 @@ function processComponentsAndPads(componentGroups, circuitElements, pcb) {
|
|
|
252520
253152
|
outlines: [],
|
|
252521
253153
|
pins: componentGroup.pcb_smtpads.map((pad2) => {
|
|
252522
253154
|
const pcbComponent = circuitElements.find((e4) => e4.type === "pcb_component" && e4.source_component_id === firstComponent.sourceComponent?.source_component_id);
|
|
252523
|
-
const pcbPort =
|
|
252524
|
-
const sourcePort =
|
|
253155
|
+
const pcbPort = su13(circuitElements).pcb_port.list().find((e4) => e4.pcb_port_id === pad2.pcb_port_id);
|
|
253156
|
+
const sourcePort = su13(circuitElements).source_port.list().find((e4) => e4.source_port_id === pcbPort?.source_port_id);
|
|
252525
253157
|
return createPinForImage(pad2, pcbComponent, sourcePort);
|
|
252526
253158
|
}).filter((pin) => pin !== undefined)
|
|
252527
253159
|
};
|
|
@@ -252550,9 +253182,9 @@ function processNets(circuitElements, pcb) {
|
|
|
252550
253182
|
const padsBySourcePortId = /* @__PURE__ */ new Map;
|
|
252551
253183
|
for (const element of circuitElements) {
|
|
252552
253184
|
if ((element.type === "pcb_smtpad" || element.type === "pcb_plated_hole") && element.pcb_port_id) {
|
|
252553
|
-
const pcbPort =
|
|
253185
|
+
const pcbPort = su24(circuitElements).pcb_port.list().find((e4) => e4.pcb_port_id === element.pcb_port_id);
|
|
252554
253186
|
if (pcbPort && "source_port_id" in pcbPort) {
|
|
252555
|
-
const sourcePort =
|
|
253187
|
+
const sourcePort = su24(circuitElements).source_port.list().find((e4) => e4.source_port_id === pcbPort.source_port_id);
|
|
252556
253188
|
if (sourcePort && "source_component_id" in sourcePort) {
|
|
252557
253189
|
const componentName = componentNameMap.get(sourcePort.source_component_id ?? "") || "";
|
|
252558
253190
|
const pinNumber = sourcePort.port_hints?.find((hint) => !Number.isNaN(Number(hint)));
|
|
@@ -252813,10 +253445,10 @@ function processPcbTraces(circuitElements, pcb, numLayers = 2) {
|
|
|
252813
253445
|
for (const element of circuitElements) {
|
|
252814
253446
|
if (element.type === "pcb_trace") {
|
|
252815
253447
|
const pcbTrace = element;
|
|
252816
|
-
const source_trace2 =
|
|
253448
|
+
const source_trace2 = su34(circuitElements).source_trace.getWhere({
|
|
252817
253449
|
source_trace_id: pcbTrace.source_trace_id
|
|
252818
253450
|
});
|
|
252819
|
-
const source_net2 = source_trace2 &&
|
|
253451
|
+
const source_net2 = source_trace2 && su34(circuitElements).source_net.list().find((n3) => source_trace2.connected_source_net_ids.includes(n3.source_net_id));
|
|
252820
253452
|
debug14(`PCB TRACE
|
|
252821
253453
|
----------
|
|
252822
253454
|
`, pcbTrace);
|
|
@@ -252994,17 +253626,17 @@ function processPlatedHoles(componentGroups, circuitElements, pcb, numLayers = 2
|
|
|
252994
253626
|
const { pcb_component_id, pcb_plated_holes, pcb_smtpads } = group;
|
|
252995
253627
|
if (pcb_plated_holes.length === 0)
|
|
252996
253628
|
continue;
|
|
252997
|
-
const pcbComponent =
|
|
253629
|
+
const pcbComponent = su43(circuitElements).pcb_component.list().find((e4) => e4.pcb_component_id === pcb_component_id);
|
|
252998
253630
|
if (!pcbComponent)
|
|
252999
253631
|
continue;
|
|
253000
|
-
const sourceComponent =
|
|
253632
|
+
const sourceComponent = su43(circuitElements).source_component.list().find((e4) => e4.source_component_id === pcbComponent.source_component_id);
|
|
253001
253633
|
const footprintName = getFootprintName(sourceComponent, pcbComponent);
|
|
253002
253634
|
const image = ensureImage(footprintName);
|
|
253003
253635
|
const nextPinNumber = createNextPinNumberGenerator(image);
|
|
253004
253636
|
for (const hole of pcb_plated_holes) {
|
|
253005
253637
|
const padstackName = ensurePadstack(hole);
|
|
253006
|
-
const pcbPort = hole.pcb_port_id ?
|
|
253007
|
-
const sourcePort = pcbPort ?
|
|
253638
|
+
const pcbPort = hole.pcb_port_id ? su43(circuitElements).pcb_port.list().find((e4) => e4.pcb_port_id === hole.pcb_port_id) : undefined;
|
|
253639
|
+
const sourcePort = pcbPort ? su43(circuitElements).source_port.list().find((e4) => e4.source_port_id === pcbPort.source_port_id) : undefined;
|
|
253008
253640
|
const pinNumber = findNumericHint(sourcePort) ?? nextPinNumber();
|
|
253009
253641
|
const pin = {
|
|
253010
253642
|
padstack_name: padstackName,
|
|
@@ -255566,14 +256198,14 @@ var convertBomRowsToCsv = (bom_rows) => {
|
|
|
255566
256198
|
// node_modules/circuit-json-to-pnp-csv/dist/index.js
|
|
255567
256199
|
var import_papaparse2 = __toESM2(require_papaparse(), 1);
|
|
255568
256200
|
import"circuit-json";
|
|
255569
|
-
import { su as
|
|
256201
|
+
import { su as su15 } from "@tscircuit/soup-util";
|
|
255570
256202
|
var fixedDecimals = 3;
|
|
255571
256203
|
var convertCircuitJsonToPickAndPlaceRows = (circuitJson, opts = {}) => {
|
|
255572
256204
|
opts.flip_y_axis ??= false;
|
|
255573
256205
|
const rows = [];
|
|
255574
256206
|
for (const element of circuitJson) {
|
|
255575
256207
|
if (element.type === "pcb_component") {
|
|
255576
|
-
const source_component =
|
|
256208
|
+
const source_component = su15(circuitJson).source_component.get(element.source_component_id);
|
|
255577
256209
|
rows.push({
|
|
255578
256210
|
designator: source_component?.name ?? element.pcb_component_id,
|
|
255579
256211
|
mid_x: element.center.x,
|
|
@@ -263660,7 +264292,7 @@ var cju8 = (circuitJsonInput, options = {}) => {
|
|
|
263660
264292
|
}
|
|
263661
264293
|
}
|
|
263662
264294
|
}
|
|
263663
|
-
const
|
|
264295
|
+
const su25 = new Proxy({}, {
|
|
263664
264296
|
get: (proxy_target, prop) => {
|
|
263665
264297
|
if (prop === "toArray") {
|
|
263666
264298
|
return () => {
|
|
@@ -263699,7 +264331,7 @@ var cju8 = (circuitJsonInput, options = {}) => {
|
|
|
263699
264331
|
}
|
|
263700
264332
|
if (prop === "insertAll") {
|
|
263701
264333
|
return (elms) => {
|
|
263702
|
-
return elms.map((elm) =>
|
|
264334
|
+
return elms.map((elm) => su25.insert(elm));
|
|
263703
264335
|
};
|
|
263704
264336
|
}
|
|
263705
264337
|
const component_type = prop;
|
|
@@ -263780,10 +264412,10 @@ var cju8 = (circuitJsonInput, options = {}) => {
|
|
|
263780
264412
|
};
|
|
263781
264413
|
}
|
|
263782
264414
|
});
|
|
263783
|
-
return
|
|
264415
|
+
return su25;
|
|
263784
264416
|
};
|
|
263785
264417
|
cju8.unparsed = cju8;
|
|
263786
|
-
var
|
|
264418
|
+
var su16 = cju8;
|
|
263787
264419
|
function createIdKey2(element) {
|
|
263788
264420
|
const type = element.type;
|
|
263789
264421
|
return `${type}:${element[`${type}_id`]}`;
|
|
@@ -266207,13 +266839,13 @@ var mapPortHints = (portHints2, portHintsMap) => {
|
|
|
266207
266839
|
return portHints2.flatMap((hint) => portHintsMap[hint] ?? [hint]);
|
|
266208
266840
|
};
|
|
266209
266841
|
var generateFootprintTsx2 = (circuitJson, options = {}) => {
|
|
266210
|
-
const holes =
|
|
266211
|
-
const platedHoles =
|
|
266212
|
-
const smtPads =
|
|
266213
|
-
const vias =
|
|
266214
|
-
const silkscreenPaths =
|
|
266215
|
-
const silkscreenTexts =
|
|
266216
|
-
const courtyardOutlines =
|
|
266842
|
+
const holes = su16(circuitJson).pcb_hole.list();
|
|
266843
|
+
const platedHoles = su16(circuitJson).pcb_plated_hole.list();
|
|
266844
|
+
const smtPads = su16(circuitJson).pcb_smtpad.list();
|
|
266845
|
+
const vias = su16(circuitJson).pcb_via.list();
|
|
266846
|
+
const silkscreenPaths = su16(circuitJson).pcb_silkscreen_path.list();
|
|
266847
|
+
const silkscreenTexts = su16(circuitJson).pcb_silkscreen_text.list();
|
|
266848
|
+
const courtyardOutlines = su16(circuitJson).pcb_courtyard_outline.list();
|
|
266217
266849
|
const elementStrings = [];
|
|
266218
266850
|
for (const hole of holes) {
|
|
266219
266851
|
if (hole.hole_shape === "circle") {
|
|
@@ -266458,14 +267090,14 @@ var convertBetterEasyToTsx = async ({
|
|
|
266458
267090
|
cadModelBounds: cadPlacement?.bounds,
|
|
266459
267091
|
showDesignator: true
|
|
266460
267092
|
});
|
|
266461
|
-
const [cadComponent] =
|
|
267093
|
+
const [cadComponent] = su16(circuitJson).cad_component.list();
|
|
266462
267094
|
if (cadComponent) {
|
|
266463
267095
|
cadComponent.position.x = 0;
|
|
266464
267096
|
cadComponent.position.y = 0;
|
|
266465
267097
|
}
|
|
266466
267098
|
const rawPn = betterEasy.dataStr.head.c_para["Manufacturer Part"];
|
|
266467
267099
|
const pn3 = rawPn ? normalizeManufacturerPartNumber(rawPn) : "unknown";
|
|
266468
|
-
const sourcePorts =
|
|
267100
|
+
const sourcePorts = su16(circuitJson).source_port.list();
|
|
266469
267101
|
const pinLabels = {};
|
|
266470
267102
|
const sortedPorts = sourcePorts.sort((a2, b) => {
|
|
266471
267103
|
const aNum = Number.parseInt(a2.name.replace("pin", ""));
|
|
@@ -270447,7 +271079,7 @@ var cju9 = (circuitJsonInput, options = {}) => {
|
|
|
270447
271079
|
}
|
|
270448
271080
|
}
|
|
270449
271081
|
}
|
|
270450
|
-
const
|
|
271082
|
+
const su25 = new Proxy({}, {
|
|
270451
271083
|
get: (proxy_target, prop) => {
|
|
270452
271084
|
if (prop === "toArray") {
|
|
270453
271085
|
return () => {
|
|
@@ -270486,7 +271118,7 @@ var cju9 = (circuitJsonInput, options = {}) => {
|
|
|
270486
271118
|
}
|
|
270487
271119
|
if (prop === "insertAll") {
|
|
270488
271120
|
return (elms) => {
|
|
270489
|
-
return elms.map((elm) =>
|
|
271121
|
+
return elms.map((elm) => su25.insert(elm));
|
|
270490
271122
|
};
|
|
270491
271123
|
}
|
|
270492
271124
|
const component_type = prop;
|
|
@@ -270567,7 +271199,7 @@ var cju9 = (circuitJsonInput, options = {}) => {
|
|
|
270567
271199
|
};
|
|
270568
271200
|
}
|
|
270569
271201
|
});
|
|
270570
|
-
return
|
|
271202
|
+
return su25;
|
|
270571
271203
|
};
|
|
270572
271204
|
cju9.unparsed = cju9;
|
|
270573
271205
|
function createIdKey3(element) {
|
package/dist/lib/index.js
CHANGED
|
@@ -65808,7 +65808,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
65808
65808
|
}));
|
|
65809
65809
|
};
|
|
65810
65810
|
// package.json
|
|
65811
|
-
var version = "0.1.
|
|
65811
|
+
var version = "0.1.1492";
|
|
65812
65812
|
var package_default = {
|
|
65813
65813
|
name: "@tscircuit/cli",
|
|
65814
65814
|
version,
|
|
@@ -65851,7 +65851,7 @@ var package_default = {
|
|
|
65851
65851
|
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
65852
65852
|
"circuit-json-to-spice": "^0.0.10",
|
|
65853
65853
|
"circuit-json-to-step": "^0.0.33",
|
|
65854
|
-
"circuit-json-to-tscircuit": "^0.0.
|
|
65854
|
+
"circuit-json-to-tscircuit": "^0.0.35",
|
|
65855
65855
|
"circuit-json-trace-length-analysis": "github:tscircuit/circuit-json-trace-length-analysis#2b44792a40df0ca83b6bfb6ac95ed5e35e7168b8",
|
|
65856
65856
|
commander: "^14.0.0",
|
|
65857
65857
|
conf: "^13.1.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1493",
|
|
4
4
|
"main": "dist/cli/main.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/cli/main.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
41
41
|
"circuit-json-to-spice": "^0.0.10",
|
|
42
42
|
"circuit-json-to-step": "^0.0.33",
|
|
43
|
-
"circuit-json-to-tscircuit": "^0.0.
|
|
43
|
+
"circuit-json-to-tscircuit": "^0.0.35",
|
|
44
44
|
"circuit-json-trace-length-analysis": "github:tscircuit/circuit-json-trace-length-analysis#2b44792a40df0ca83b6bfb6ac95ed5e35e7168b8",
|
|
45
45
|
"commander": "^14.0.0",
|
|
46
46
|
"conf": "^13.1.0",
|