@tscircuit/checks 0.0.146 → 0.0.147
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 +29 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1232,6 +1232,11 @@ var getRadiusOfCircuitJsonElement = (obj) => {
|
|
|
1232
1232
|
};
|
|
1233
1233
|
|
|
1234
1234
|
// lib/check-each-pcb-trace-non-overlapping/check-each-pcb-trace-non-overlapping.ts
|
|
1235
|
+
var getPcbComponentConnectionElementId = (element) => {
|
|
1236
|
+
if (element.type === "pcb_port") return element.pcb_port_id;
|
|
1237
|
+
if (element.type === "pcb_smtpad") return element.pcb_smtpad_id;
|
|
1238
|
+
return element.pcb_plated_hole_id;
|
|
1239
|
+
};
|
|
1235
1240
|
function checkEachPcbTraceNonOverlapping(circuitJson, {
|
|
1236
1241
|
connMap,
|
|
1237
1242
|
minClearance
|
|
@@ -1266,9 +1271,28 @@ function checkEachPcbTraceNonOverlapping(circuitJson, {
|
|
|
1266
1271
|
});
|
|
1267
1272
|
const pcbSmtPads = cju2(circuitJson).pcb_smtpad.list();
|
|
1268
1273
|
const pcbPlatedHoles = cju2(circuitJson).pcb_plated_hole.list();
|
|
1274
|
+
const pcbPorts = cju2(circuitJson).pcb_port.list();
|
|
1269
1275
|
const pcbHoles = cju2(circuitJson).pcb_hole.list();
|
|
1270
1276
|
const pcbVias = cju2(circuitJson).pcb_via.list();
|
|
1271
1277
|
const pcbKeepouts = cju2(circuitJson).pcb_keepout.list();
|
|
1278
|
+
const pcbComponentConnectionElements = [
|
|
1279
|
+
...pcbPorts,
|
|
1280
|
+
...pcbSmtPads,
|
|
1281
|
+
...pcbPlatedHoles
|
|
1282
|
+
];
|
|
1283
|
+
const excludedConnectionIdsByKeepoutId = /* @__PURE__ */ new Map();
|
|
1284
|
+
for (const keepout of pcbKeepouts) {
|
|
1285
|
+
const excludedPcbComponentIds = new Set(
|
|
1286
|
+
keepout.excluded_pcb_component_ids ?? []
|
|
1287
|
+
);
|
|
1288
|
+
if (excludedPcbComponentIds.size === 0) continue;
|
|
1289
|
+
excludedConnectionIdsByKeepoutId.set(
|
|
1290
|
+
keepout.pcb_keepout_id,
|
|
1291
|
+
pcbComponentConnectionElements.filter(
|
|
1292
|
+
(element) => element.pcb_component_id && excludedPcbComponentIds.has(element.pcb_component_id)
|
|
1293
|
+
).map(getPcbComponentConnectionElementId)
|
|
1294
|
+
);
|
|
1295
|
+
}
|
|
1272
1296
|
const allObjects = [
|
|
1273
1297
|
...pcbTraceSegments,
|
|
1274
1298
|
...pcbSmtPads,
|
|
@@ -1301,6 +1325,11 @@ function checkEachPcbTraceNonOverlapping(circuitJson, {
|
|
|
1301
1325
|
if (!getLayersOfPcbElement(obj).includes(segmentA.layer)) {
|
|
1302
1326
|
continue;
|
|
1303
1327
|
}
|
|
1328
|
+
if (obj.type === "pcb_keepout" && (excludedConnectionIdsByKeepoutId.get(obj.pcb_keepout_id) ?? []).some(
|
|
1329
|
+
(connectionId) => connMap.areIdsConnected(segmentA.pcb_trace_id, connectionId)
|
|
1330
|
+
)) {
|
|
1331
|
+
continue;
|
|
1332
|
+
}
|
|
1304
1333
|
if (obj.type === "pcb_trace_segment") {
|
|
1305
1334
|
const segmentB = obj;
|
|
1306
1335
|
if (segmentA.layer !== segmentB.layer) continue;
|