-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate Capacity Autorouter (#656)
* add GenericLocalAutorouter * wip * wip autorouting * wip * wip * wip making autorouting code much better, removing somewhat unnecessary pcb net island routing * nets now get subcircuit ids * add support for using board bounds rather than computed bounds where defined * easier distances for benchmark led circuit * wip capacity mesh autorouter * wip, autorouter working again but traces not showing * remove log lines * add vias manually based on routes for now * checkpoint, autorouting seems to be working * fixes for backwards compat * remove accidentally committed data file * update for current phase fix * update snapshot, remove log lines * fix type issues * skip long test * fix test * update other randomly failing snapshots * fix descendent subcircuit handling * add todo
- Loading branch information
Showing
44 changed files
with
898 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,60 @@ | ||
import { grid } from "@tscircuit/math-utils" | ||
import { sel } from "lib/sel" | ||
import type { BoardProps } from "@tscircuit/props" | ||
|
||
export const Benchmark1LedMatrix = () => ( | ||
<board width="10mm" height="10mm" routingDisabled> | ||
{grid({ rows: 4, cols: 4, xSpacing: 5, ySpacing: 5 }).map( | ||
({ center, index }) => { | ||
const ledName = `LED${index}` | ||
const resistorName = `R${index}` | ||
return ( | ||
<group key={ledName}> | ||
<led | ||
footprint="0603" | ||
name={ledName} | ||
pcbX={center.x} | ||
pcbY={center.y} | ||
/> | ||
<resistor | ||
resistance="1k" | ||
footprint="0402" | ||
name={resistorName} | ||
pcbX={center.x} | ||
pcbY={center.y - 2} | ||
/> | ||
<trace from={`.${ledName} .pos`} to="net.VDD" /> | ||
<trace from={`.${ledName} .neg`} to={`.${resistorName} .pos`} /> | ||
<trace from={`.${resistorName} .neg`} to="net.GND" /> | ||
</group> | ||
) | ||
}, | ||
)} | ||
</board> | ||
) | ||
export const Benchmark1LedMatrix = ({ | ||
autorouter = undefined, | ||
routingDisabled = undefined, | ||
}: { | ||
autorouter?: BoardProps["autorouter"] | ||
routingDisabled?: boolean | ||
}) => { | ||
if (autorouter === undefined && routingDisabled === undefined) { | ||
routingDisabled = true | ||
} | ||
return ( | ||
<board | ||
width="50mm" | ||
height="60mm" | ||
routingDisabled={routingDisabled} | ||
autorouter={autorouter} | ||
> | ||
<pinheader | ||
name="J1" | ||
pinCount={2} | ||
pinLabels={["PWR", "GND"]} | ||
footprint="pinrow2" | ||
pcbY={28} | ||
/> | ||
<trace from={sel.J1.PWR} to={sel.net.PWR} /> | ||
<trace from={sel.J1.GND} to={sel.net.GND} /> | ||
{grid({ rows: 4, cols: 4, xSpacing: 10, ySpacing: 10 }).map( | ||
({ center, index }) => { | ||
const ledName = `LED${index}` | ||
const resistorName = `R${index}` | ||
return ( | ||
<group key={ledName}> | ||
<led | ||
footprint="0603" | ||
color="red" | ||
name={ledName} | ||
pcbX={center.x} | ||
pcbY={center.y} | ||
/> | ||
<resistor | ||
resistance="1k" | ||
footprint="0402" | ||
name={resistorName} | ||
pcbX={center.x} | ||
pcbY={center.y - 2} | ||
/> | ||
<trace from={`.${ledName} .pos`} to={sel.net.PWR} /> | ||
<trace from={`.${ledName} .neg`} to={`.${resistorName} .pos`} /> | ||
<trace from={`.${resistorName} .neg`} to={sel.net.GND} /> | ||
</group> | ||
) | ||
}, | ||
)} | ||
</board> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,13 @@ | |
"name": "@tscircuit/core", | ||
"dependencies": { | ||
"@lume/kiwi": "^0.4.3", | ||
"@tscircuit/capacity-autorouter": "^0.0.12", | ||
"@tscircuit/infgrid-ijump-astar": "^0.0.33", | ||
"@tscircuit/math-utils": "^0.0.9", | ||
"@tscircuit/props": "^0.0.152", | ||
"@tscircuit/schematic-autolayout": "^0.0.6", | ||
"@tscircuit/soup-util": "^0.0.41", | ||
"circuit-json": "^0.0.142", | ||
"circuit-json": "^0.0.144", | ||
"circuit-json-to-connectivity-map": "^0.0.17", | ||
"format-si-unit": "^0.0.3", | ||
"nanoid": "^5.0.7", | ||
|
@@ -208,6 +209,8 @@ | |
|
||
"@rollup/rollup-win32-x64-msvc": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-U0FaE5O1BCpZSeE6gBl3c5ObhePQSfk9vDRToMmTkbhCOgW4jqvtS5LGyQ76L1fH8sM0keRp4uDTsbjiUyjk0g=="], | ||
|
||
"@tscircuit/capacity-autorouter": ["@tscircuit/[email protected]", "", { "peerDependencies": { "typescript": "^5.7.3" } }, "sha512-K0rT4JlOo3vo4lRLP55hNvlLssbhF5qHWDyj2r3mGN9O91j5vdQJ4yTYJ9LZgGV1lZw2GjCoNZ27Gaz0FOXNEg=="], | ||
|
||
"@tscircuit/core": ["@tscircuit/[email protected]", "", { "dependencies": { "@lume/kiwi": "^0.4.3", "@tscircuit/footprinter": "^0.0.135", "@tscircuit/infgrid-ijump-astar": "^0.0.33", "@tscircuit/math-utils": "^0.0.9", "@tscircuit/props": "^0.0.152", "@tscircuit/schematic-autolayout": "^0.0.6", "@tscircuit/soup-util": "^0.0.41", "circuit-json": "^0.0.139", "circuit-json-to-connectivity-map": "^0.0.17", "format-si-unit": "^0.0.3", "nanoid": "^5.0.7", "performance-now": "^2.1.0", "react-reconciler": "^0.31.0", "react-reconciler-18": "npm:[email protected]", "schematic-symbols": "^0.0.121", "transformation-matrix": "^2.16.1", "zod": "^3.23.8" }, "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-rhnPwYyEQxkewis/7W+YC+mXwndras6fyFh3syHfaW5Z8zTC3njbXiGkFPWtExrWAV2+AG0g/uL6NfQ+eDCA8Q=="], | ||
|
||
"@tscircuit/footprinter": ["@tscircuit/[email protected]", "", { "dependencies": { "@tscircuit/mm": "^0.0.8", "zod": "^3.23.8" }, "peerDependencies": { "circuit-json": "*" } }, "sha512-M7Tvbp8IAt1JpWRUZr2OS5rRMZxY0stk1frhR80CYQPsyWzwifh9pgdNKOqApCJ0MPmy4rmPey5BVGtAZ+gIDw=="], | ||
|
@@ -358,7 +361,7 @@ | |
|
||
"chownr": ["[email protected]", "", {}, "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ=="], | ||
|
||
"circuit-json": ["[email protected].142", "", { "dependencies": { "nanoid": "^5.0.7", "zod": "^3.23.6" } }, "sha512-TE4fC91rGuul5oe73LNA3UC/2+LSwXH8qyEmf39Re+YNG5djo1klkm27ECGOzSboTC5XatS9uLNMUsLoFrPC0A=="], | ||
"circuit-json": ["[email protected].144", "", { "dependencies": { "nanoid": "^5.0.7", "zod": "^3.23.6" } }, "sha512-XA0/EmY1nRTl3lrmBJkG9rUljYduVlsat6SiIWPz1h+x/rHzpr2NJYnDJabnC/HPApeie2JfXyd+wuAV/CoF6Q=="], | ||
|
||
"circuit-json-to-connectivity-map": ["[email protected]", "", { "dependencies": { "@tscircuit/math-utils": "^0.0.4" }, "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-0IlFTwGWFXzlrYSvXQocXi6pYriF/JKnfihfvnVZ4p60kMC+1QvtJdivW9C4I0VNXEe922xak70v3YZNJrjI1g=="], | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.