seveibar/f1c1990s-dev-board

This code manages the entire PCB assembly process for a computer hardware module, including component placement, schematic integration, automated routing, copper pouring, and design rule checks, focused on a four-layer carrier board with integrated support components and connectors.

Version
1.8.0
License
unset
Stars
0

routing-boundary.ts

import { applyPartMetadata, applyCadMetadata, applyAssemblyPasteMetadata } from "./assembly-metadata"
/** Native keepouts currently apply to both autorouting and finished copper.
 * This board needs a routing-only reservation around a pre-routed module.
 * Let native routing use the reservation, then remove ONLY the temporary central and east-edge
 * reservations before copper filling and the unmodified full copper/connectivity DRC.
 * No trace, via, clearance error, or connectivity error is suppressed. */
export function routingBoundaryRef(board: any) {
  const clear = () => {
    const table=board.root.db.pcb_keepout
    for(const k of table.list()) {
      if(k.shape==='rect' && ((k.width===25.6 && k.height===25.6 && k.center.x===0 && k.center.y===0) || (k.width===0.8 && k.height===1.1 && k.center.x===13.3 && k.center.y===2.65)))
        table.delete(k.pcb_keepout_id)
    }
  }
  const pour=board.doInitialPcbImplicitCopperPourRender.bind(board)
  board.doInitialPcbImplicitCopperPourRender=()=>{ clear(); pour() }
  const check=board.doInitialPcbDesignRuleChecks.bind(board)
  board.doInitialPcbDesignRuleChecks=()=>{ clear(); applyPartMetadata(board); check() }
  const parts=board.doInitialPartsEngineRender.bind(board)
  board.doInitialPartsEngineRender=()=>{ applyCadMetadata(board); applyAssemblyPasteMetadata(board); return parts() }
}