@tscircuit/schematic-trace-solver 0.0.94 → 0.0.96
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/dist/index.d.ts +19 -12
- package/dist/index.js +78 -57
- package/lib/solvers/{VccNetLabelCornerPlacementSolver/VccNetLabelCornerPlacementSolver.ts → RailNetLabelCornerPlacementSolver/RailNetLabelCornerPlacementSolver.ts} +27 -9
- package/lib/solvers/{VccNetLabelCornerPlacementSolver → RailNetLabelCornerPlacementSolver}/types.ts +7 -1
- package/lib/solvers/{VccNetLabelCornerPlacementSolver → RailNetLabelCornerPlacementSolver}/visualize.ts +1 -1
- package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +17 -12
- package/lib/solvers/SchematicTracePipelineSolver/visualizeInputProblem.ts +47 -40
- package/lib/types/InputProblem.ts +1 -0
- package/package.json +1 -1
- package/tests/bug-reports/bug-report-20260706T213649Z/__snapshots__/bug-report-20260706T213649Z.snap.svg +1 -1
- package/tests/bug-reports/bug-report-20260706T213649Z/bug-report-20260706T213649Z.test.ts +3 -1
- package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +314 -314
- package/tests/bug-reports/bug-report-20260707T092615Z/__snapshots__/bug-report-20260707T092615Z.snap.svg +5 -5
- package/tests/bug-reports/bug-report-20260707T092615Z/bug-report-20260707T092615Z.test.ts +3 -1
- package/tests/bug-reports/bug-report-20260707T134722Z/__snapshots__/bug-report-20260707T134722Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260707T140410Z/__snapshots__/bug-report-20260707T140410Z.snap.svg +8 -8
- package/tests/bug-reports/bug-report-20260707T141421Z/__snapshots__/bug-report-20260707T141421Z.snap.svg +4 -4
- package/tests/bug-reports/bug-report-20260707T230831Z/__snapshots__/bug-report-20260707T230831Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260708T095725Z/__snapshots__/bug-report-20260708T095725Z.snap.svg +2 -2
- package/tests/examples/__snapshots__/example01.snap.svg +2 -2
- package/tests/examples/__snapshots__/example02.snap.svg +4 -4
- package/tests/examples/__snapshots__/example07.snap.svg +2 -2
- package/tests/examples/__snapshots__/example12.snap.svg +2 -2
- package/tests/examples/__snapshots__/example14.snap.svg +36 -36
- package/tests/examples/__snapshots__/example15.snap.svg +2 -2
- package/tests/examples/__snapshots__/example18.snap.svg +4 -4
- package/tests/examples/__snapshots__/example19.snap.svg +22 -22
- package/tests/examples/__snapshots__/example21.snap.svg +4 -4
- package/tests/examples/__snapshots__/example25.snap.svg +35 -35
- package/tests/examples/__snapshots__/example29.snap.svg +10 -10
- package/tests/examples/__snapshots__/example31.snap.svg +6 -6
- package/tests/examples/__snapshots__/example32.snap.svg +2 -2
- package/tests/examples/__snapshots__/example46.snap.svg +2 -2
- package/tests/examples/__snapshots__/example47.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-ina237-current-monitor.snap.svg +4 -4
- package/tests/repros/__snapshots__/repro-netlabel-overlap-trace.snap.svg +2 -2
- package/tests/repros/__snapshots__/trace-overlap-box-resistor.snap.svg +2 -2
- /package/lib/solvers/{VccNetLabelCornerPlacementSolver → RailNetLabelCornerPlacementSolver}/geometry.ts +0 -0
|
@@ -9,9 +9,14 @@ export const visualizeInputProblem = (
|
|
|
9
9
|
opts: {
|
|
10
10
|
chipAlpha?: number
|
|
11
11
|
connectionAlpha?: number
|
|
12
|
+
hideRatsNet?: boolean
|
|
12
13
|
} = {},
|
|
13
14
|
): GraphicsObject => {
|
|
14
|
-
const {
|
|
15
|
+
const {
|
|
16
|
+
connectionAlpha = 0.8,
|
|
17
|
+
chipAlpha = 0.8,
|
|
18
|
+
hideRatsNet = inputProblem._hideRatsNet ?? false,
|
|
19
|
+
} = opts
|
|
15
20
|
const graphics: Pick<
|
|
16
21
|
Required<GraphicsObject>,
|
|
17
22
|
"lines" | "points" | "rects"
|
|
@@ -58,48 +63,50 @@ export const visualizeInputProblem = (
|
|
|
58
63
|
} as any)
|
|
59
64
|
}
|
|
60
65
|
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
if (!hideRatsNet) {
|
|
67
|
+
for (const directConn of inputProblem.directConnections) {
|
|
68
|
+
const [pinId1, pinId2] = directConn.pinIds
|
|
69
|
+
const pin1 = pinIdMap.get(pinId1)!
|
|
70
|
+
const pin2 = pinIdMap.get(pinId2)!
|
|
71
|
+
if (arePinsInDifferentSchematicSections(inputProblem, pin1, pin2)) {
|
|
72
|
+
continue
|
|
73
|
+
}
|
|
74
|
+
graphics.lines.push({
|
|
75
|
+
points: [
|
|
76
|
+
{
|
|
77
|
+
x: pin1.x,
|
|
78
|
+
y: pin1.y,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
x: pin2.x,
|
|
82
|
+
y: pin2.y,
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
strokeColor: getColorFromString(
|
|
86
|
+
directConn.netId ?? `${pinId1}-${pinId2}`,
|
|
87
|
+
connectionAlpha,
|
|
88
|
+
),
|
|
89
|
+
})
|
|
67
90
|
}
|
|
68
|
-
graphics.lines.push({
|
|
69
|
-
points: [
|
|
70
|
-
{
|
|
71
|
-
x: pin1.x,
|
|
72
|
-
y: pin1.y,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
x: pin2.x,
|
|
76
|
-
y: pin2.y,
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
strokeColor: getColorFromString(
|
|
80
|
-
directConn.netId ?? `${pinId1}-${pinId2}`,
|
|
81
|
-
connectionAlpha,
|
|
82
|
-
),
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
91
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
for (const netConn of inputProblem.netConnections) {
|
|
93
|
+
const pins = netConn.pinIds.map((pinId) => pinIdMap.get(pinId)!)
|
|
94
|
+
for (let i = 0; i < pins.length - 1; i++) {
|
|
95
|
+
for (let j = i + 1; j < pins.length; j++) {
|
|
96
|
+
const pin1 = pins[i]!
|
|
97
|
+
const pin2 = pins[j]!
|
|
98
|
+
if (arePinsInDifferentSchematicSections(inputProblem, pin1, pin2)) {
|
|
99
|
+
continue
|
|
100
|
+
}
|
|
101
|
+
graphics.lines.push({
|
|
102
|
+
points: [
|
|
103
|
+
{ x: pin1.x, y: pin1.y },
|
|
104
|
+
{ x: pin2.x, y: pin2.y },
|
|
105
|
+
],
|
|
106
|
+
strokeColor: getColorFromString(netConn.netId, connectionAlpha),
|
|
107
|
+
strokeDash: "4 2",
|
|
108
|
+
})
|
|
94
109
|
}
|
|
95
|
-
graphics.lines.push({
|
|
96
|
-
points: [
|
|
97
|
-
{ x: pin1.x, y: pin1.y },
|
|
98
|
-
{ x: pin2.x, y: pin2.y },
|
|
99
|
-
],
|
|
100
|
-
strokeColor: getColorFromString(netConn.netId, connectionAlpha),
|
|
101
|
-
strokeDash: "4 2",
|
|
102
|
-
})
|
|
103
110
|
}
|
|
104
111
|
}
|
|
105
112
|
}
|