@tscircuit/checks 0.0.201 → 0.0.202

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 CHANGED
@@ -4023,6 +4023,11 @@ var formatOverlapElementDescription = (circuitJson, element) => {
4023
4023
  };
4024
4024
  function checkPcbComponentOverlap(circuitJson) {
4025
4025
  const errors = [];
4026
+ const doNotPlaceComponentIds = new Set(
4027
+ circuitJson.flatMap(
4028
+ (element) => element.type === "pcb_component" && element.do_not_place ? [element.pcb_component_id] : []
4029
+ )
4030
+ );
4026
4031
  const connMap = getFullConnectivityMapFromCircuitJson9(circuitJson);
4027
4032
  const smtPads = cju6(circuitJson).pcb_smtpad.list();
4028
4033
  const platedHoles = cju6(circuitJson).pcb_plated_hole.list();
@@ -4078,6 +4083,7 @@ function checkPcbComponentOverlap(circuitJson) {
4078
4083
  for (let j = i + 1; j < componentsWithElements.length; j++) {
4079
4084
  const comp1 = componentsWithElements[i];
4080
4085
  const comp2 = componentsWithElements[j];
4086
+ const pairIncludesDoNotPlaceComponent = doNotPlaceComponentIds.has(comp1.component_id) || doNotPlaceComponentIds.has(comp2.component_id);
4081
4087
  if (!comp1.bounds || !comp2.bounds) {
4082
4088
  continue;
4083
4089
  }
@@ -4088,6 +4094,9 @@ function checkPcbComponentOverlap(circuitJson) {
4088
4094
  for (const elem2 of comp2.elements) {
4089
4095
  const id1 = getPrimaryId5(elem1);
4090
4096
  const id2 = getPrimaryId5(elem2);
4097
+ if (pairIncludesDoNotPlaceComponent && (isCourtyardElement2(elem1) || isCourtyardElement2(elem2))) {
4098
+ continue;
4099
+ }
4091
4100
  if ((isCourtyardElement2(elem1) || isCourtyardElement2(elem2)) && !isHoleElement(elem1) && !isHoleElement(elem2)) {
4092
4101
  continue;
4093
4102
  }