diff --git a/algos/tscircuit-builtin/index.ts b/algos/tscircuit-builtin/index.ts index e6d7ef4..1ba21ab 100644 --- a/algos/tscircuit-builtin/index.ts +++ b/algos/tscircuit-builtin/index.ts @@ -1,4 +1,4 @@ -import type { AnySoupElement } from "@tscircuit/soup" +import type { AnySoupElement, PCBTrace } from "@tscircuit/soup" import { buildPcbTraceElements } from "@tscircuit/builder" import { su } from "@tscircuit/soup-util" import { mm } from "@tscircuit/mm" @@ -35,7 +35,7 @@ export const tscircuitBuiltinSolver = (soup: AnySoupElement[]) => { }, ctx, ) - newElements.push(pcb_trace, ...pcb_errors, ...pcb_vias) + newElements.push(pcb_trace as PCBTrace, ...pcb_errors, ...pcb_vias) } return newElements } diff --git a/bun.lockb b/bun.lockb index 540435f..735de2d 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/module/lib/solver-utils/getObstaclesFromCircuitJson.ts b/module/lib/solver-utils/getObstaclesFromCircuitJson.ts index ee6a47d..f4d95c2 100644 --- a/module/lib/solver-utils/getObstaclesFromCircuitJson.ts +++ b/module/lib/solver-utils/getObstaclesFromCircuitJson.ts @@ -30,7 +30,33 @@ export const getObstaclesFromCircuitJson = (soup: AnySoupElement[]) => { connectedTo: [], }) } - } else if (element.type === "pcb_hole") { + } else if (element.type === "pcb_keepout") { + if (element.shape === "circle") { + obstacles.push({ + // @ts-ignore + type: "oval", + center: { + x: element.center.x, + y: element.center.y, + }, + width: element.radius * 2, + height: element.radius * 2, + connectedTo: [], + }) + } else if (element.shape === "rect") { + obstacles.push({ + type: "rect", + center: { + x: element.x, + y: element.y, + }, + width: element.width, + height: element.height, + connectedTo: [], + }) + } + } + else if (element.type === "pcb_hole") { if (element.hole_shape === "oval") { obstacles.push({ // @ts-ignore diff --git a/package.json b/package.json index 5b0a465..3504954 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,11 @@ "devDependencies": { "@biomejs/biome": "^1.8.3", "@timohausmann/quadtree-ts": "^2.2.2", - "@tscircuit/builder": "1.9.5", + "@tscircuit/builder": "1.11.2", "@tscircuit/pcb-viewer": "1.4.5", "@tscircuit/props": "^0.0.26", - "@tscircuit/soup": "^0.0.39", - "@tscircuit/soup-util": "^0.0.13", + "@tscircuit/soup": "^0.0.66", + "@tscircuit/soup-util": "^0.0.21", "@types/bun": "latest", "@types/d3-delaunay": "^6.0.4", "@types/debug": "^4.1.12",