@tscircuit/cli 0.1.2232 → 0.1.2234
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 +146 -45
- package/dist/lib/index.js +4 -4
- package/package.json +4 -4
package/dist/cli/main.js
CHANGED
|
@@ -57790,7 +57790,7 @@ var require_fast_json_stable_stringify = __commonJS2(function(exports2, module2)
|
|
|
57790
57790
|
};
|
|
57791
57791
|
});
|
|
57792
57792
|
|
|
57793
|
-
// node_modules/circuit-json-to-gerber/dist/chunk-
|
|
57793
|
+
// node_modules/circuit-json-to-gerber/dist/chunk-5TBXNZXW.js
|
|
57794
57794
|
import { z as z4 } from "zod";
|
|
57795
57795
|
import { z as z23 } from "zod";
|
|
57796
57796
|
import { z as z32 } from "zod";
|
|
@@ -58033,7 +58033,7 @@ function getAllApertureTemplateConfigsForLayer({
|
|
|
58033
58033
|
} else {
|
|
58034
58034
|
addConfigIfNew(getApertureConfigFromCirclePcbHole(elm));
|
|
58035
58035
|
}
|
|
58036
|
-
} else if (elm.hole_shape === "rotated_pill") {
|
|
58036
|
+
} else if (elm.hole_shape === "rotated_pill" || elm.hole_shape === "oval") {
|
|
58037
58037
|
const soldermaskMargin = isSoldermaskLayer ? elm.soldermask_margin ?? 0 : 0;
|
|
58038
58038
|
addConfigIfNew(getApertureConfigFromRotatedPillPcbHole(elm, soldermaskMargin));
|
|
58039
58039
|
} else
|
|
@@ -59739,6 +59739,58 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
59739
59739
|
builder.add("plot_operation", { x: ordered[i].x, y: mfy(ordered[i].y) });
|
|
59740
59740
|
}
|
|
59741
59741
|
builder.add("plot_operation", { x: ordered[0].x, y: mfy(ordered[0].y) });
|
|
59742
|
+
}, renderStiffenerLayers = (circuitJson, { flip_y_axis = false }) => {
|
|
59743
|
+
const layers = {};
|
|
59744
|
+
const boardCenters = new Map(circuitJson.filter((element) => element.type === "pcb_board").map((board) => [board.pcb_board_id, board.center]));
|
|
59745
|
+
const stiffeners = circuitJson.filter((element) => element.type === "pcb_stiffener");
|
|
59746
|
+
for (const stiffener of stiffeners) {
|
|
59747
|
+
const prefix = stiffener.layer === "top" ? "F" : "B";
|
|
59748
|
+
const layerName = `${prefix}_Stiffener_${stiffener.material}`;
|
|
59749
|
+
layers[layerName] ??= [
|
|
59750
|
+
...getCommandHeaders({
|
|
59751
|
+
layer: stiffener.layer,
|
|
59752
|
+
layer_type: "stiffener"
|
|
59753
|
+
}),
|
|
59754
|
+
...gerberBuilder().add("comment", {
|
|
59755
|
+
comment: `Stiffener material: ${stiffener.material}`
|
|
59756
|
+
}).add("define_aperture_template", {
|
|
59757
|
+
aperture_number: 10,
|
|
59758
|
+
standard_template_code: "C",
|
|
59759
|
+
diameter: 0.05
|
|
59760
|
+
}).add("select_aperture", { aperture_number: 10 }).build()
|
|
59761
|
+
];
|
|
59762
|
+
const localPoints = stiffener.shape === "rect" ? getRotatedRectPoints({
|
|
59763
|
+
center: stiffener.center,
|
|
59764
|
+
width: stiffener.width,
|
|
59765
|
+
height: stiffener.height,
|
|
59766
|
+
ccwRotationDegrees: stiffener.rotation ?? 0
|
|
59767
|
+
}) : stiffener.outline;
|
|
59768
|
+
const boardCenter = boardCenters.get(stiffener.pcb_board_id) ?? {
|
|
59769
|
+
x: 0,
|
|
59770
|
+
y: 0
|
|
59771
|
+
};
|
|
59772
|
+
const points = localPoints.map((point) => ({
|
|
59773
|
+
x: point.x + boardCenter.x,
|
|
59774
|
+
y: point.y + boardCenter.y
|
|
59775
|
+
}));
|
|
59776
|
+
const first = points[0];
|
|
59777
|
+
if (!first || points.length < 3)
|
|
59778
|
+
continue;
|
|
59779
|
+
const mfy = (y) => flip_y_axis ? -y : y;
|
|
59780
|
+
const builder = gerberBuilder().add("comment", {
|
|
59781
|
+
comment: `Stiffener thickness: ${stiffener.thickness} mm${stiffener.adhesive_thickness === undefined ? "" : `; adhesive thickness: ${stiffener.adhesive_thickness} mm`}`
|
|
59782
|
+
});
|
|
59783
|
+
builder.add("move_operation", { x: first.x, y: mfy(first.y) });
|
|
59784
|
+
for (const point of points.slice(1)) {
|
|
59785
|
+
builder.add("plot_operation", { x: point.x, y: mfy(point.y) });
|
|
59786
|
+
}
|
|
59787
|
+
const last = points[points.length - 1];
|
|
59788
|
+
if (last.x !== first.x || last.y !== first.y) {
|
|
59789
|
+
builder.add("plot_operation", { x: first.x, y: mfy(first.y) });
|
|
59790
|
+
}
|
|
59791
|
+
layers[layerName].push(...builder.build());
|
|
59792
|
+
}
|
|
59793
|
+
return layers;
|
|
59742
59794
|
}, getEllipsePoints = ({
|
|
59743
59795
|
x,
|
|
59744
59796
|
y,
|
|
@@ -60463,14 +60515,16 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
60463
60515
|
height: element.height,
|
|
60464
60516
|
rotationDegrees: rotation2
|
|
60465
60517
|
});
|
|
60466
|
-
|
|
60467
|
-
|
|
60468
|
-
|
|
60469
|
-
|
|
60470
|
-
|
|
60471
|
-
|
|
60472
|
-
|
|
60473
|
-
|
|
60518
|
+
if (element.is_covered_with_solder_mask !== true) {
|
|
60519
|
+
renderPillFlash({
|
|
60520
|
+
glayer: glayers[getGerberLayerName(layer, "soldermask")],
|
|
60521
|
+
x: element.x,
|
|
60522
|
+
y: element.y,
|
|
60523
|
+
width: element.width + soldermaskMargin * 2,
|
|
60524
|
+
height: element.height + soldermaskMargin * 2,
|
|
60525
|
+
rotationDegrees: rotation2
|
|
60526
|
+
});
|
|
60527
|
+
}
|
|
60474
60528
|
continue;
|
|
60475
60529
|
}
|
|
60476
60530
|
if (element.shape === "rotated_rect" && !element.corner_radius && !element.rect_border_radius) {
|
|
@@ -60487,6 +60541,9 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
60487
60541
|
height: element.height + soldermaskMargin * 2
|
|
60488
60542
|
}
|
|
60489
60543
|
]) {
|
|
60544
|
+
if (element.is_covered_with_solder_mask === true && glayer === glayers[getGerberLayerName(layer, "soldermask")]) {
|
|
60545
|
+
continue;
|
|
60546
|
+
}
|
|
60490
60547
|
addClosedRegionFromPoints({
|
|
60491
60548
|
target: glayer,
|
|
60492
60549
|
apertureSource: glayer,
|
|
@@ -60511,6 +60568,9 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
60511
60568
|
apertureConfig: getApertureConfigFromPcbSmtpadSoldermask(element)
|
|
60512
60569
|
}
|
|
60513
60570
|
]) {
|
|
60571
|
+
if (element.is_covered_with_solder_mask === true && glayer === glayers[getGerberLayerName(layer, "soldermask")]) {
|
|
60572
|
+
continue;
|
|
60573
|
+
}
|
|
60514
60574
|
const apertureNumber = findApertureNumber(glayer, apertureConfig);
|
|
60515
60575
|
const gb = gerberBuilder().add("select_aperture", {
|
|
60516
60576
|
aperture_number: apertureNumber
|
|
@@ -60759,7 +60819,7 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
60759
60819
|
for (const glayer of [
|
|
60760
60820
|
glayers[getGerberLayerName(layer, "soldermask")]
|
|
60761
60821
|
]) {
|
|
60762
|
-
if (element.hole_shape === "rotated_pill") {
|
|
60822
|
+
if (element.hole_shape === "rotated_pill" || element.hole_shape === "oval") {
|
|
60763
60823
|
const soldermaskMargin = element.soldermask_margin ?? 0;
|
|
60764
60824
|
renderPillFlash({
|
|
60765
60825
|
glayer,
|
|
@@ -60767,7 +60827,7 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
60767
60827
|
y: element.y,
|
|
60768
60828
|
width: element.hole_width + soldermaskMargin * 2,
|
|
60769
60829
|
height: element.hole_height + soldermaskMargin * 2,
|
|
60770
|
-
rotationDegrees: element.ccw_rotation
|
|
60830
|
+
rotationDegrees: element.hole_shape === "rotated_pill" ? element.ccw_rotation : 0
|
|
60771
60831
|
});
|
|
60772
60832
|
continue;
|
|
60773
60833
|
}
|
|
@@ -60785,8 +60845,12 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
60785
60845
|
const layersToAddTo = [
|
|
60786
60846
|
glayers[getGerberLayerName(layer, "copper")]
|
|
60787
60847
|
];
|
|
60788
|
-
if (
|
|
60789
|
-
|
|
60848
|
+
if (isOuterLayerRef(layer)) {
|
|
60849
|
+
const tenting = element;
|
|
60850
|
+
const isTented = (layer === "top" ? tenting.tented_on_top : tenting.tented_on_bottom) ?? tenting.is_tented;
|
|
60851
|
+
if (isTented === false) {
|
|
60852
|
+
layersToAddTo.push(glayers[getGerberLayerName(layer, "soldermask")]);
|
|
60853
|
+
}
|
|
60790
60854
|
}
|
|
60791
60855
|
for (const glayer of layersToAddTo) {
|
|
60792
60856
|
glayer.push(...gerberBuilder().add("select_aperture", {
|
|
@@ -60894,7 +60958,7 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
60894
60958
|
if (element.type !== "pcb_hole") {
|
|
60895
60959
|
continue;
|
|
60896
60960
|
}
|
|
60897
|
-
if (element.hole_shape === "rotated_pill") {
|
|
60961
|
+
if (element.hole_shape === "rotated_pill" || element.hole_shape === "oval") {
|
|
60898
60962
|
copperGlayer.push(...gerberBuilder().add("set_layer_polarity", { polarity: "C" }).build());
|
|
60899
60963
|
renderPillFlash({
|
|
60900
60964
|
glayer: copperGlayer,
|
|
@@ -60902,7 +60966,7 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
60902
60966
|
y: element.y,
|
|
60903
60967
|
width: element.hole_width,
|
|
60904
60968
|
height: element.hole_height,
|
|
60905
|
-
rotationDegrees: element.ccw_rotation
|
|
60969
|
+
rotationDegrees: element.hole_shape === "rotated_pill" ? element.ccw_rotation : 0
|
|
60906
60970
|
});
|
|
60907
60971
|
copperGlayer.push(...gerberBuilder().add("set_layer_polarity", { polarity: "D" }).build());
|
|
60908
60972
|
continue;
|
|
@@ -60914,6 +60978,7 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
60914
60978
|
}).add("flash_operation", { x: element.x, y: mfy(element.y) }).add("set_layer_polarity", { polarity: "D" }).build());
|
|
60915
60979
|
}
|
|
60916
60980
|
}
|
|
60981
|
+
Object.assign(glayers, renderStiffenerLayers(circuitJson, opts));
|
|
60917
60982
|
for (const key of Object.keys(glayers)) {
|
|
60918
60983
|
glayers[key].push(...gerberBuilder().add("end_of_file", {}).build());
|
|
60919
60984
|
}
|
|
@@ -60934,7 +60999,7 @@ var import_polygon_clipping2, import_fast_json_stable_stringify, import_polygon_
|
|
|
60934
60999
|
]));
|
|
60935
61000
|
return { ...gerberFiles, ...drillFiles };
|
|
60936
61001
|
};
|
|
60937
|
-
var
|
|
61002
|
+
var init_chunk_5TBXNZXW = __esm(() => {
|
|
60938
61003
|
import_polygon_clipping2 = __toESM3(require_polygon_clipping_cjs(), 1);
|
|
60939
61004
|
import_fast_json_stable_stringify = __toESM3(require_fast_json_stable_stringify(), 1);
|
|
60940
61005
|
import_polygon_clipping3 = __toESM3(require_polygon_clipping_cjs(), 1);
|
|
@@ -61549,7 +61614,7 @@ ${template_code}%`;
|
|
|
61549
61614
|
};
|
|
61550
61615
|
package_default6 = {
|
|
61551
61616
|
name: "circuit-json-to-gerber",
|
|
61552
|
-
version: "0.0.
|
|
61617
|
+
version: "0.0.109",
|
|
61553
61618
|
repository: {
|
|
61554
61619
|
type: "git",
|
|
61555
61620
|
url: "https://github.com/tscircuit/circuit-json-to-gerber"
|
|
@@ -61579,7 +61644,7 @@ ${template_code}%`;
|
|
|
61579
61644
|
"@types/react-dom": "^19.1.5",
|
|
61580
61645
|
archiver: "^7.0.1",
|
|
61581
61646
|
"bun-match-svg": "^0.0.13",
|
|
61582
|
-
"circuit-json": "^0.0.
|
|
61647
|
+
"circuit-json": "^0.0.509",
|
|
61583
61648
|
commander: "^12.1.0",
|
|
61584
61649
|
"format-si-unit": "^0.0.7",
|
|
61585
61650
|
"gerber-to-svg": "^4.2.8",
|
|
@@ -61611,6 +61676,8 @@ ${template_code}%`;
|
|
|
61611
61676
|
"bottom-silkscreen": "Legend,Bot",
|
|
61612
61677
|
"top-fabrication": "Other,Fab,Top",
|
|
61613
61678
|
"bottom-fabrication": "Other,Fab,Bot",
|
|
61679
|
+
"top-stiffener": "Other,Stiffener,Top",
|
|
61680
|
+
"bottom-stiffener": "Other,Stiffener,Bot",
|
|
61614
61681
|
"top-paste": "Paste,Top",
|
|
61615
61682
|
"bottom-paste": "Paste,Bot",
|
|
61616
61683
|
edgecut: "Profile,NP"
|
|
@@ -61633,7 +61700,7 @@ ${template_code}%`;
|
|
|
61633
61700
|
|
|
61634
61701
|
// node_modules/circuit-json-to-gerber/dist/index.js
|
|
61635
61702
|
var init_dist = __esm(() => {
|
|
61636
|
-
|
|
61703
|
+
init_chunk_5TBXNZXW();
|
|
61637
61704
|
});
|
|
61638
61705
|
|
|
61639
61706
|
// node_modules/@tracespace/xml-id/index.js
|
|
@@ -154298,7 +154365,7 @@ var import_perfect_cli = __toESM3(require_dist3(), 1);
|
|
|
154298
154365
|
// lib/getVersion.ts
|
|
154299
154366
|
import { createRequire as createRequire2 } from "node:module";
|
|
154300
154367
|
// package.json
|
|
154301
|
-
var version = "0.1.
|
|
154368
|
+
var version = "0.1.2233";
|
|
154302
154369
|
var package_default = {
|
|
154303
154370
|
name: "@tscircuit/cli",
|
|
154304
154371
|
version,
|
|
@@ -154322,7 +154389,7 @@ var package_default = {
|
|
|
154322
154389
|
"@tscircuit/eval": "0.0.1402",
|
|
154323
154390
|
"@tscircuit/fake-snippets": "^0.0.182",
|
|
154324
154391
|
"@tscircuit/file-server": "^0.0.32",
|
|
154325
|
-
"@tscircuit/footprinter": "^0.0.
|
|
154392
|
+
"@tscircuit/footprinter": "^0.0.430",
|
|
154326
154393
|
"@tscircuit/image-utils": "^0.0.8",
|
|
154327
154394
|
"@tscircuit/krt-wasm": "^0.1.6",
|
|
154328
154395
|
"@tscircuit/math-utils": "0.0.36",
|
|
@@ -154348,8 +154415,8 @@ var package_default = {
|
|
|
154348
154415
|
"circuit-json-to-bom-csv": "^0.0.19",
|
|
154349
154416
|
"circuit-json-to-connectivity-map": "^0.0.32",
|
|
154350
154417
|
"circuit-json-to-fdm-component-box": "^0.0.2",
|
|
154351
|
-
"circuit-json-to-footprinter": "^0.0.
|
|
154352
|
-
"circuit-json-to-gerber": "^0.0.
|
|
154418
|
+
"circuit-json-to-footprinter": "^0.0.59",
|
|
154419
|
+
"circuit-json-to-gerber": "^0.0.110",
|
|
154353
154420
|
"circuit-json-to-kicad": "0.0.230",
|
|
154354
154421
|
"circuit-json-to-pnp-csv": "^0.0.18",
|
|
154355
154422
|
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
@@ -337889,7 +337956,7 @@ var convertKicadFootprintToTsx = async ({
|
|
|
337889
337956
|
console.log(kleur_default.green(`Converted ${outputPath}`));
|
|
337890
337957
|
};
|
|
337891
337958
|
|
|
337892
|
-
// node_modules/circuit-json-to-footprinter/dist/chunk-
|
|
337959
|
+
// node_modules/circuit-json-to-footprinter/dist/chunk-K4WFTP36.js
|
|
337893
337960
|
import {
|
|
337894
337961
|
getBoundsCenter,
|
|
337895
337962
|
getBoundsFromPoints as getBoundsFromPoints4
|
|
@@ -340635,7 +340702,7 @@ var getManifoldModule = async () => {
|
|
|
340635
340702
|
return manifoldModulePromise;
|
|
340636
340703
|
};
|
|
340637
340704
|
|
|
340638
|
-
// node_modules/circuit-json-to-footprinter/dist/chunk-
|
|
340705
|
+
// node_modules/circuit-json-to-footprinter/dist/chunk-K4WFTP36.js
|
|
340639
340706
|
import { getBoundsCenter as getBoundsCenter2, isPointInsidePolygon as isPointInsidePolygon3 } from "@tscircuit/math-utils";
|
|
340640
340707
|
var HOLE_SHAPE_KIND = {
|
|
340641
340708
|
circle: "circle",
|
|
@@ -341045,6 +341112,7 @@ var getNumericPinNumbers = (pad) => [
|
|
|
341045
341112
|
return match?.[1] ? [Number.parseInt(match[1], 10)] : [];
|
|
341046
341113
|
}))
|
|
341047
341114
|
];
|
|
341115
|
+
var getBallCoordinates = (pad) => (pad?.element.port_hints ?? []).filter((hint) => /^[A-Z]+[1-9]\d*$/.test(hint));
|
|
341048
341116
|
var matchPadsByPosition = (leftPads, rightPads) => {
|
|
341049
341117
|
const availableRight = new Set(rightPads.map((_, index) => index));
|
|
341050
341118
|
const pairs = [];
|
|
@@ -341079,10 +341147,14 @@ var comparePinHints = (left, right) => {
|
|
|
341079
341147
|
for (const [leftPad, rightPad] of pairs) {
|
|
341080
341148
|
const leftPinNumbers = getNumericPinNumbers(leftPad);
|
|
341081
341149
|
const rightPinNumbers = getNumericPinNumbers(rightPad);
|
|
341082
|
-
|
|
341150
|
+
const leftBalls = getBallCoordinates(leftPad);
|
|
341151
|
+
const rightBalls = getBallCoordinates(rightPad);
|
|
341152
|
+
if (leftPinNumbers.length === 0 && rightPinNumbers.length === 0 && leftBalls.length === 0 && rightBalls.length === 0)
|
|
341083
341153
|
continue;
|
|
341084
341154
|
comparedPinCount += 1;
|
|
341085
|
-
|
|
341155
|
+
const hasNumericPair = leftPinNumbers.length > 0 && rightPinNumbers.length > 0;
|
|
341156
|
+
const hasBallPair = leftBalls.length > 0 && rightBalls.length > 0;
|
|
341157
|
+
if ((hasNumericPair || leftPinNumbers.length === 0 && rightPinNumbers.length === 0 && hasBallPair) && (!hasNumericPair || leftPinNumbers.some((pinNumber) => rightPinNumbers.includes(pinNumber))) && (!hasBallPair || leftBalls.some((ball) => rightBalls.includes(ball)))) {
|
|
341086
341158
|
matchedPinCount += 1;
|
|
341087
341159
|
continue;
|
|
341088
341160
|
}
|
|
@@ -342999,36 +343071,66 @@ var getSot223Seed = (target) => {
|
|
|
342999
343071
|
}
|
|
343000
343072
|
return;
|
|
343001
343073
|
};
|
|
343002
|
-
var
|
|
343074
|
+
var getBgaGridSeeds = (target) => {
|
|
343003
343075
|
const pads = getPadGeometries(target);
|
|
343004
|
-
if (pads.length < 4 || pads.some(({ copper, drill, element }) => element.type !== "pcb_smtpad" || drill || copper.shape !== "rect")) {
|
|
343005
|
-
return;
|
|
343076
|
+
if (pads.length < 4 || pads.some(({ copper, drill, element }) => element.type !== "pcb_smtpad" || drill || copper.shape !== "rect" && copper.shape !== "circle")) {
|
|
343077
|
+
return [];
|
|
343006
343078
|
}
|
|
343007
343079
|
const bounds = pads.map(({ copper }) => getPadBounds3(copper));
|
|
343008
343080
|
const pad = median(bounds.map(({ width, height }) => (width + height) / 2));
|
|
343009
343081
|
const tolerance = Math.max(0.005, pad * 0.08);
|
|
343010
343082
|
if (bounds.some(({ width, height }) => Math.abs(width - height) > tolerance || Math.abs(width - pad) > tolerance || Math.abs(height - pad) > tolerance)) {
|
|
343011
|
-
return;
|
|
343083
|
+
return [];
|
|
343012
343084
|
}
|
|
343013
343085
|
const columns = clusterCoordinates(pads.map(({ copper }) => copper.x), tolerance);
|
|
343014
343086
|
const rows = clusterCoordinates(pads.map(({ copper }) => copper.y), tolerance);
|
|
343015
|
-
if (columns.length < 2 || rows.length < 2 || columns.length * rows.length
|
|
343016
|
-
return;
|
|
343087
|
+
if (columns.length < 2 || rows.length < 2 || columns.length * rows.length < pads.length) {
|
|
343088
|
+
return [];
|
|
343017
343089
|
}
|
|
343018
343090
|
const columnPitches = columns.slice(1).map((coordinate, index) => coordinate - columns[index]);
|
|
343019
343091
|
const rowPitches = rows.slice(1).map((coordinate, index) => coordinate - rows[index]);
|
|
343020
|
-
const pitch = median([
|
|
343092
|
+
const pitch = median([
|
|
343093
|
+
(columns.at(-1) - columns[0]) / (columns.length - 1),
|
|
343094
|
+
(rows.at(-1) - rows[0]) / (rows.length - 1)
|
|
343095
|
+
]);
|
|
343021
343096
|
if (pitch <= pad || [...columnPitches, ...rowPitches].some((candidate) => Math.abs(candidate - pitch) > tolerance)) {
|
|
343022
|
-
return;
|
|
343097
|
+
return [];
|
|
343023
343098
|
}
|
|
343024
|
-
|
|
343025
|
-
|
|
343026
|
-
|
|
343027
|
-
|
|
343099
|
+
const occupied = /* @__PURE__ */ new Set;
|
|
343100
|
+
for (const { copper } of pads) {
|
|
343101
|
+
const x = columns.findIndex((column) => Math.abs(copper.x - column) <= tolerance);
|
|
343102
|
+
const y = rows.findIndex((row) => Math.abs(copper.y - row) <= tolerance);
|
|
343103
|
+
const position = y * columns.length + x;
|
|
343104
|
+
if (x < 0 || y < 0 || occupied.has(position))
|
|
343105
|
+
return [];
|
|
343106
|
+
occupied.add(position);
|
|
343107
|
+
}
|
|
343108
|
+
const shapes = new Set(pads.map(({ copper }) => copper.shape));
|
|
343109
|
+
if (shapes.size !== 1)
|
|
343110
|
+
return [];
|
|
343111
|
+
const base = `bga${pads.length}_grid${columns.length}x${rows.length}_p${formatPreciseLength(pitch)}_pad${formatPreciseLength(pad)}`;
|
|
343112
|
+
const padModifier = shapes.has("rect") ? "_rectpads" : "";
|
|
343113
|
+
const seeds = [];
|
|
343114
|
+
for (const origin of ["tl", "bl", "tr", "br"]) {
|
|
343115
|
+
const missing = [];
|
|
343116
|
+
for (let y = 0;y < rows.length; y++) {
|
|
343117
|
+
for (let x = 0;x < columns.length; x++) {
|
|
343118
|
+
if (occupied.has(y * columns.length + x))
|
|
343119
|
+
continue;
|
|
343120
|
+
const pinX = origin.endsWith("r") ? columns.length - 1 - x : x;
|
|
343121
|
+
const pinY = origin.startsWith("b") ? rows.length - 1 - y : y;
|
|
343122
|
+
missing.push(pinY * columns.length + pinX + 1);
|
|
343028
343123
|
}
|
|
343029
343124
|
}
|
|
343125
|
+
missing.sort((left, right) => left - right);
|
|
343126
|
+
const mask = missing.length ? `_missing(${missing.join(",")})` : "";
|
|
343127
|
+
const seed = `${base}${mask}_${origin}origin${padModifier}`;
|
|
343128
|
+
seeds.push(seed);
|
|
343129
|
+
for (const numbering of ["rowmajor", "columnmajor", "ballcoords"]) {
|
|
343130
|
+
seeds.push(`${seed}_pinnumbering(${numbering})`);
|
|
343131
|
+
}
|
|
343030
343132
|
}
|
|
343031
|
-
return
|
|
343133
|
+
return seeds;
|
|
343032
343134
|
};
|
|
343033
343135
|
var getStaggeredSmdPinHeaderSeed = (target) => {
|
|
343034
343136
|
const description = `${target.title} ${target.subtitle} ${target.sourceHints?.join(" ") ?? ""}`.toLowerCase();
|
|
@@ -343189,9 +343291,8 @@ var generateSeeds = (target, analysis) => {
|
|
|
343189
343291
|
if (family !== "usbcmidmount")
|
|
343190
343292
|
seeds.add(family);
|
|
343191
343293
|
}
|
|
343192
|
-
const
|
|
343193
|
-
|
|
343194
|
-
seeds.add(bgaGridSeed);
|
|
343294
|
+
for (const seed of getBgaGridSeeds(target))
|
|
343295
|
+
seeds.add(seed);
|
|
343195
343296
|
const staggeredSmdPinHeaderSeed = getStaggeredSmdPinHeaderSeed(target);
|
|
343196
343297
|
if (staggeredSmdPinHeaderSeed)
|
|
343197
343298
|
seeds.add(staggeredSmdPinHeaderSeed);
|
|
@@ -343696,7 +343797,7 @@ var selectSeedsToOptimize = (candidates, analysis, target) => {
|
|
|
343696
343797
|
return [...selected.values()].slice(0, MAX_OPTIMIZED_SEEDS);
|
|
343697
343798
|
};
|
|
343698
343799
|
var findActiveParameters = (seed, analysis) => {
|
|
343699
|
-
if (seed.family === "fpc" || seed.family === "jst" && (seed.footprinterString.includes("_smd") || seed.footprinterString.includes("_zh"))) {
|
|
343800
|
+
if (seed.family === "bga" && seed.footprinterString.includes("_pinnumbering(") || seed.family === "fpc" || seed.family === "jst" && (seed.footprinterString.includes("_smd") || seed.footprinterString.includes("_zh"))) {
|
|
343700
343801
|
return [];
|
|
343701
343802
|
}
|
|
343702
343803
|
const active = [];
|
package/dist/lib/index.js
CHANGED
|
@@ -69109,7 +69109,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
69109
69109
|
}));
|
|
69110
69110
|
};
|
|
69111
69111
|
// package.json
|
|
69112
|
-
var version = "0.1.
|
|
69112
|
+
var version = "0.1.2233";
|
|
69113
69113
|
var package_default = {
|
|
69114
69114
|
name: "@tscircuit/cli",
|
|
69115
69115
|
version,
|
|
@@ -69133,7 +69133,7 @@ var package_default = {
|
|
|
69133
69133
|
"@tscircuit/eval": "0.0.1402",
|
|
69134
69134
|
"@tscircuit/fake-snippets": "^0.0.182",
|
|
69135
69135
|
"@tscircuit/file-server": "^0.0.32",
|
|
69136
|
-
"@tscircuit/footprinter": "^0.0.
|
|
69136
|
+
"@tscircuit/footprinter": "^0.0.430",
|
|
69137
69137
|
"@tscircuit/image-utils": "^0.0.8",
|
|
69138
69138
|
"@tscircuit/krt-wasm": "^0.1.6",
|
|
69139
69139
|
"@tscircuit/math-utils": "0.0.36",
|
|
@@ -69159,8 +69159,8 @@ var package_default = {
|
|
|
69159
69159
|
"circuit-json-to-bom-csv": "^0.0.19",
|
|
69160
69160
|
"circuit-json-to-connectivity-map": "^0.0.32",
|
|
69161
69161
|
"circuit-json-to-fdm-component-box": "^0.0.2",
|
|
69162
|
-
"circuit-json-to-footprinter": "^0.0.
|
|
69163
|
-
"circuit-json-to-gerber": "^0.0.
|
|
69162
|
+
"circuit-json-to-footprinter": "^0.0.59",
|
|
69163
|
+
"circuit-json-to-gerber": "^0.0.110",
|
|
69164
69164
|
"circuit-json-to-kicad": "0.0.230",
|
|
69165
69165
|
"circuit-json-to-pnp-csv": "^0.0.18",
|
|
69166
69166
|
"circuit-json-to-readable-netlist": "^0.0.15",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2234",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/tscircuit/cli"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@tscircuit/eval": "0.0.1402",
|
|
22
22
|
"@tscircuit/fake-snippets": "^0.0.182",
|
|
23
23
|
"@tscircuit/file-server": "^0.0.32",
|
|
24
|
-
"@tscircuit/footprinter": "^0.0.
|
|
24
|
+
"@tscircuit/footprinter": "^0.0.430",
|
|
25
25
|
"@tscircuit/image-utils": "^0.0.8",
|
|
26
26
|
"@tscircuit/krt-wasm": "^0.1.6",
|
|
27
27
|
"@tscircuit/math-utils": "0.0.36",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"circuit-json-to-bom-csv": "^0.0.19",
|
|
48
48
|
"circuit-json-to-connectivity-map": "^0.0.32",
|
|
49
49
|
"circuit-json-to-fdm-component-box": "^0.0.2",
|
|
50
|
-
"circuit-json-to-footprinter": "^0.0.
|
|
51
|
-
"circuit-json-to-gerber": "^0.0.
|
|
50
|
+
"circuit-json-to-footprinter": "^0.0.59",
|
|
51
|
+
"circuit-json-to-gerber": "^0.0.110",
|
|
52
52
|
"circuit-json-to-kicad": "0.0.230",
|
|
53
53
|
"circuit-json-to-pnp-csv": "^0.0.18",
|
|
54
54
|
"circuit-json-to-readable-netlist": "^0.0.15",
|