@tscircuit/checks 0.0.197 → 0.0.199
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1239,7 +1239,7 @@ function getCopperPourConnectivity(circuitJson, connectivity) {
|
|
|
1239
1239
|
polygon: getSmtPadPolygon(copper),
|
|
1240
1240
|
layers: [copper.layer],
|
|
1241
1241
|
netId,
|
|
1242
|
-
|
|
1242
|
+
portIds: copper.pcb_port_id ? [copper.pcb_port_id] : []
|
|
1243
1243
|
});
|
|
1244
1244
|
} else if (copper.type === "pcb_plated_hole") {
|
|
1245
1245
|
add({
|
|
@@ -1249,7 +1249,7 @@ function getCopperPourConnectivity(circuitJson, connectivity) {
|
|
|
1249
1249
|
),
|
|
1250
1250
|
layers: copper.layers,
|
|
1251
1251
|
netId,
|
|
1252
|
-
|
|
1252
|
+
portIds: copper.pcb_port_id ? [copper.pcb_port_id] : []
|
|
1253
1253
|
});
|
|
1254
1254
|
} else {
|
|
1255
1255
|
add({
|
|
@@ -1259,7 +1259,8 @@ function getCopperPourConnectivity(circuitJson, connectivity) {
|
|
|
1259
1259
|
copper.hole_diameter
|
|
1260
1260
|
),
|
|
1261
1261
|
layers: copper.layers,
|
|
1262
|
-
netId
|
|
1262
|
+
netId,
|
|
1263
|
+
portIds: copper.pcb_port_ids
|
|
1263
1264
|
});
|
|
1264
1265
|
}
|
|
1265
1266
|
}
|
|
@@ -1300,10 +1301,12 @@ function getCopperPourConnectivity(circuitJson, connectivity) {
|
|
|
1300
1301
|
);
|
|
1301
1302
|
const rootsByPort = /* @__PURE__ */ new Map();
|
|
1302
1303
|
for (const [i, conductor] of conductors.entries()) {
|
|
1303
|
-
if (!
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
|
|
1304
|
+
if (!pourRoots.has(find(i))) continue;
|
|
1305
|
+
for (const portId of conductor.portIds ?? []) {
|
|
1306
|
+
const roots = rootsByPort.get(portId) ?? /* @__PURE__ */ new Set();
|
|
1307
|
+
roots.add(find(i));
|
|
1308
|
+
rootsByPort.set(portId, roots);
|
|
1309
|
+
}
|
|
1307
1310
|
}
|
|
1308
1311
|
const portsByNet = /* @__PURE__ */ new Map();
|
|
1309
1312
|
for (const port of circuitJson) {
|
|
@@ -2513,6 +2516,10 @@ var getCopperElementLabel = (element) => {
|
|
|
2513
2516
|
function checkCopperToBoardEdgeClearance(circuitJson) {
|
|
2514
2517
|
const board = getPcbBoard(circuitJson);
|
|
2515
2518
|
if (!board) return [];
|
|
2519
|
+
if (!circuitJson.some(
|
|
2520
|
+
(element) => element.type === "pcb_via" || element.type === "pcb_smtpad" || element.type === "pcb_plated_hole" || element.type === "pcb_copper_pour"
|
|
2521
|
+
))
|
|
2522
|
+
return [];
|
|
2516
2523
|
const boardPolygon = convertCircuitJsonToFlattenJs([board], { strict: true }).elements[0]?.shapes[0];
|
|
2517
2524
|
if (!boardPolygon) return [];
|
|
2518
2525
|
const requiredClearance = getBoardDrcValue(board, "min_board_edge_clearance") ?? jlcMinTolerances.min_board_edge_clearance;
|