@tscircuit/copper-pour-solver 0.0.32 → 0.0.34
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/README.md +139 -20
- package/cosmos.config.json +2 -1
- package/dist/index.d.ts +24 -6
- package/dist/index.js +176 -7
- package/lib/circuit-json/ConvertCircuitJsonToInputProblemOptions.ts +18 -0
- package/lib/circuit-json/buildSubcircuitConnectivityLookup.ts +54 -0
- package/lib/circuit-json/convert-circuit-json-to-input-problem.ts +31 -21
- package/lib/circuit-json/getElementSubcircuitConnectivityKey.ts +8 -0
- package/lib/circuit-json/resolvePourConnectivityKey.ts +61 -0
- package/lib/index.ts +1 -0
- package/lib/solvers/copper-pour/polygon-primitives.ts +53 -0
- package/lib/solvers/copper-pour/process-obstacles.ts +17 -0
- package/lib/types.ts +11 -0
- package/package.json +5 -1
- package/site/Welcome.page.tsx +214 -0
- package/tests/__snapshots__/pill-pad-copper-pour.snap.svg +1 -0
- package/tests/connectivity-key-api.test.ts +100 -0
- package/tests/pill-pad-copper-pour.test.ts +124 -0
- package/tests/repro01-business-via-card/__snapshots__/repro01-business-via-card.snap.svg +1 -1
- package/tests/utils/run-solver-and-render-to-svg.ts +5 -13
- package/vercel.json +5 -0
|
@@ -8,7 +8,6 @@ import type {
|
|
|
8
8
|
PcbCopperPourBRep,
|
|
9
9
|
SourceNet,
|
|
10
10
|
} from "circuit-json"
|
|
11
|
-
import { getFullConnectivityMapFromCircuitJson } from "circuit-json-to-connectivity-map"
|
|
12
11
|
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
|
|
13
12
|
import type { Point } from "@tscircuit/math-utils"
|
|
14
13
|
|
|
@@ -30,7 +29,6 @@ export const runSolverAndRenderToSvg = (
|
|
|
30
29
|
? pour_options
|
|
31
30
|
: [pour_options]
|
|
32
31
|
|
|
33
|
-
const connectivityMap = getFullConnectivityMapFromCircuitJson(circuitJson)
|
|
34
32
|
const allCopperPours: PcbCopperPourBRep[] = []
|
|
35
33
|
|
|
36
34
|
for (const options of pourOptionsArray) {
|
|
@@ -43,21 +41,15 @@ export const runSolverAndRenderToSvg = (
|
|
|
43
41
|
throw new Error(`Net with name "${options.net_name}" not found`)
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (!pour_connectivity_key && source_net.subcircuit_connectivity_map_key) {
|
|
51
|
-
pour_connectivity_key = source_net.subcircuit_connectivity_map_key
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (!pour_connectivity_key) {
|
|
55
|
-
throw new Error(`Net "${options.net_name}" has no connectivity mapping`)
|
|
44
|
+
if (!source_net.subcircuit_connectivity_map_key) {
|
|
45
|
+
throw new Error(
|
|
46
|
+
`Net "${options.net_name}" has no subcircuit_connectivity_map_key`,
|
|
47
|
+
)
|
|
56
48
|
}
|
|
57
49
|
|
|
58
50
|
const inputProblem = convertCircuitJsonToInputProblem(circuitJson, {
|
|
59
51
|
...options,
|
|
60
|
-
|
|
52
|
+
source_net_id: source_net.source_net_id,
|
|
61
53
|
})
|
|
62
54
|
|
|
63
55
|
const solver = new CopperPourPipelineSolver(inputProblem)
|