tscircuit/autorouting-dataset-01
This code manages the hardware and electronic components for circuit design and PCB layout, defining components like resistors, capacitors, transistors, connectors, and footprints, and providing tools for component placement, PCB topology, and electrical connections.
- Version
- 1.0.102
- License
- unset
- Stars
- 4
scripts/validate-srj/all-are-with-in-outline.ts
import {
type Bounds,
doBoundsOverlap,
getBoundFromCenteredRect,
} from "lib/maths/box"
import type { Obstacle } from "tscircuit"
/** Verifies every obstacle overlaps with the board outline bounds. */
export const allAreWithinOutline = (
obstacles: Obstacle[],
outlineBounds: Bounds | undefined,
): boolean => {
if (!outlineBounds) {
return true
}
const bounds = obstacles.map((obstacle) => getBoundFromCenteredRect(obstacle))
return bounds.every((bound) => doBoundsOverlap(bound, outlineBounds))
}