@tscircuit/cli 0.1.2233 → 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 +89 -22
- package/dist/lib/index.js +2 -2
- package/package.json +2 -2
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,
|
|
@@ -154349,7 +154416,7 @@ var package_default = {
|
|
|
154349
154416
|
"circuit-json-to-connectivity-map": "^0.0.32",
|
|
154350
154417
|
"circuit-json-to-fdm-component-box": "^0.0.2",
|
|
154351
154418
|
"circuit-json-to-footprinter": "^0.0.59",
|
|
154352
|
-
"circuit-json-to-gerber": "^0.0.
|
|
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",
|
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,
|
|
@@ -69160,7 +69160,7 @@ var package_default = {
|
|
|
69160
69160
|
"circuit-json-to-connectivity-map": "^0.0.32",
|
|
69161
69161
|
"circuit-json-to-fdm-component-box": "^0.0.2",
|
|
69162
69162
|
"circuit-json-to-footprinter": "^0.0.59",
|
|
69163
|
-
"circuit-json-to-gerber": "^0.0.
|
|
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"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"circuit-json-to-connectivity-map": "^0.0.32",
|
|
49
49
|
"circuit-json-to-fdm-component-box": "^0.0.2",
|
|
50
50
|
"circuit-json-to-footprinter": "^0.0.59",
|
|
51
|
-
"circuit-json-to-gerber": "^0.0.
|
|
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",
|