@tscircuit/checks 0.0.201 → 0.0.203
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 +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2258,7 +2258,7 @@ function checkEachPcbTraceNonOverlapping(circuitJson, {
|
|
|
2258
2258
|
const pcbPorts = cju2(circuitJson).pcb_port.list();
|
|
2259
2259
|
const pcbHoles = cju2(circuitJson).pcb_hole.list();
|
|
2260
2260
|
const pcbVias = cju2(circuitJson).pcb_via.list();
|
|
2261
|
-
const pcbKeepouts = cju2(circuitJson).pcb_keepout.list();
|
|
2261
|
+
const pcbKeepouts = cju2(circuitJson).pcb_keepout.list().filter((keepout) => !keepout.allow_traces);
|
|
2262
2262
|
const pcbComponentConnectionElements = [
|
|
2263
2263
|
...pcbPorts,
|
|
2264
2264
|
...pcbSmtPads,
|
|
@@ -3006,6 +3006,7 @@ function checkPcbCopperOverKeepout(circuitJson) {
|
|
|
3006
3006
|
keepout.excluded_pcb_component_ids ?? []
|
|
3007
3007
|
);
|
|
3008
3008
|
for (const copperElement of copper) {
|
|
3009
|
+
if (keepout.allow_placements && copperElement.type !== "pcb_via") continue;
|
|
3009
3010
|
const copperComponentId = "pcb_component_id" in copperElement ? copperElement.pcb_component_id : void 0;
|
|
3010
3011
|
if (copperComponentId && excludedComponentIds.has(copperComponentId)) {
|
|
3011
3012
|
continue;
|
|
@@ -4023,6 +4024,11 @@ var formatOverlapElementDescription = (circuitJson, element) => {
|
|
|
4023
4024
|
};
|
|
4024
4025
|
function checkPcbComponentOverlap(circuitJson) {
|
|
4025
4026
|
const errors = [];
|
|
4027
|
+
const doNotPlaceComponentIds = new Set(
|
|
4028
|
+
circuitJson.flatMap(
|
|
4029
|
+
(element) => element.type === "pcb_component" && element.do_not_place ? [element.pcb_component_id] : []
|
|
4030
|
+
)
|
|
4031
|
+
);
|
|
4026
4032
|
const connMap = getFullConnectivityMapFromCircuitJson9(circuitJson);
|
|
4027
4033
|
const smtPads = cju6(circuitJson).pcb_smtpad.list();
|
|
4028
4034
|
const platedHoles = cju6(circuitJson).pcb_plated_hole.list();
|
|
@@ -4078,6 +4084,7 @@ function checkPcbComponentOverlap(circuitJson) {
|
|
|
4078
4084
|
for (let j = i + 1; j < componentsWithElements.length; j++) {
|
|
4079
4085
|
const comp1 = componentsWithElements[i];
|
|
4080
4086
|
const comp2 = componentsWithElements[j];
|
|
4087
|
+
const pairIncludesDoNotPlaceComponent = doNotPlaceComponentIds.has(comp1.component_id) || doNotPlaceComponentIds.has(comp2.component_id);
|
|
4081
4088
|
if (!comp1.bounds || !comp2.bounds) {
|
|
4082
4089
|
continue;
|
|
4083
4090
|
}
|
|
@@ -4088,6 +4095,9 @@ function checkPcbComponentOverlap(circuitJson) {
|
|
|
4088
4095
|
for (const elem2 of comp2.elements) {
|
|
4089
4096
|
const id1 = getPrimaryId5(elem1);
|
|
4090
4097
|
const id2 = getPrimaryId5(elem2);
|
|
4098
|
+
if (pairIncludesDoNotPlaceComponent && (isCourtyardElement2(elem1) || isCourtyardElement2(elem2))) {
|
|
4099
|
+
continue;
|
|
4100
|
+
}
|
|
4091
4101
|
if ((isCourtyardElement2(elem1) || isCourtyardElement2(elem2)) && !isHoleElement(elem1) && !isHoleElement(elem2)) {
|
|
4092
4102
|
continue;
|
|
4093
4103
|
}
|