@tscircuit/schematic-trace-solver 0.0.169 → 0.0.171

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.
@@ -0,0 +1,282 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": 4.5,
7
+ "y": 0
8
+ },
9
+ "width": 4,
10
+ "height": 4.6,
11
+ "pins": [
12
+ {
13
+ "pinId": "schematic_port_0",
14
+ "displayName": "VDD",
15
+ "x": 2.5,
16
+ "y": 0.525
17
+ },
18
+ {
19
+ "pinId": "schematic_port_1",
20
+ "displayName": "SCL",
21
+ "x": 2.5,
22
+ "y": 0.325
23
+ },
24
+ {
25
+ "pinId": "schematic_port_2",
26
+ "displayName": "SDA",
27
+ "x": 2.5,
28
+ "y": -0.125
29
+ },
30
+ {
31
+ "pinId": "schematic_port_3",
32
+ "displayName": "GPIO",
33
+ "x": 2.5,
34
+ "y": -0.32500000000000007
35
+ },
36
+ {
37
+ "pinId": "schematic_port_4",
38
+ "displayName": "GND",
39
+ "x": 2.5,
40
+ "y": -0.525
41
+ }
42
+ ]
43
+ },
44
+ {
45
+ "chipId": "schematic_component_1",
46
+ "center": {
47
+ "x": -2.1,
48
+ "y": 0
49
+ },
50
+ "width": 4,
51
+ "height": 4.6,
52
+ "pins": [
53
+ {
54
+ "pinId": "schematic_port_5",
55
+ "displayName": "I2C_SDA",
56
+ "x": -0.10000000000000009,
57
+ "y": -0.12500000000000022
58
+ },
59
+ {
60
+ "pinId": "schematic_port_6",
61
+ "displayName": "I2C_ADDR",
62
+ "x": -0.10000000000000009,
63
+ "y": -1.4250000000000003
64
+ },
65
+ {
66
+ "pinId": "schematic_port_7",
67
+ "displayName": "ALERT",
68
+ "x": -0.10000000000000009,
69
+ "y": -0.3250000000000002
70
+ },
71
+ {
72
+ "pinId": "schematic_port_8",
73
+ "displayName": "I2C_SCL",
74
+ "x": -0.10000000000000009,
75
+ "y": 0.3250000000000002
76
+ },
77
+ {
78
+ "pinId": "schematic_port_9",
79
+ "displayName": "VDD",
80
+ "x": -0.10000000000000009,
81
+ "y": 0.5250000000000004
82
+ },
83
+ {
84
+ "pinId": "schematic_port_10",
85
+ "displayName": "RESET",
86
+ "x": -0.10000000000000009,
87
+ "y": -0.7750000000000001
88
+ },
89
+ {
90
+ "pinId": "schematic_port_11",
91
+ "displayName": "I2C_ADDR1",
92
+ "x": -0.10000000000000009,
93
+ "y": -1.8750000000000002
94
+ },
95
+ {
96
+ "pinId": "schematic_port_12",
97
+ "displayName": "GND",
98
+ "x": -0.10000000000000009,
99
+ "y": -2.075
100
+ }
101
+ ]
102
+ },
103
+ {
104
+ "chipId": "schematic_component_2",
105
+ "center": {
106
+ "x": 0.735,
107
+ "y": 2.15
108
+ },
109
+ "width": 0.97,
110
+ "height": 0.6000000000000001,
111
+ "pins": [
112
+ {
113
+ "pinId": "schematic_port_13",
114
+ "displayName": "anode",
115
+ "x": 0.7,
116
+ "y": 2.45
117
+ },
118
+ {
119
+ "pinId": "schematic_port_14",
120
+ "displayName": "cathode",
121
+ "x": 0.7,
122
+ "y": 1.8499999999999999
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "chipId": "schematic_component_3",
128
+ "center": {
129
+ "x": 1.5350000000000001,
130
+ "y": 2.15
131
+ },
132
+ "width": 0.97,
133
+ "height": 0.6000000000000001,
134
+ "pins": [
135
+ {
136
+ "pinId": "schematic_port_15",
137
+ "displayName": "anode",
138
+ "x": 1.5,
139
+ "y": 2.45
140
+ },
141
+ {
142
+ "pinId": "schematic_port_16",
143
+ "displayName": "cathode",
144
+ "x": 1.5,
145
+ "y": 1.8499999999999999
146
+ }
147
+ ]
148
+ }
149
+ ],
150
+ "directConnections": [],
151
+ "netConnections": [
152
+ {
153
+ "netId": "VDD",
154
+ "isGround": false,
155
+ "netLabelWidth": 0.42,
156
+ "netLabelHeight": 0.48,
157
+ "pinIds": [
158
+ "schematic_port_0",
159
+ "schematic_port_9",
160
+ "schematic_port_13",
161
+ "schematic_port_15"
162
+ ]
163
+ },
164
+ {
165
+ "netId": "SCL",
166
+ "isGround": false,
167
+ "netLabelWidth": 0.48,
168
+ "anchoredNetLabelWidth": 0.48,
169
+ "allowInlineNetLabel": true,
170
+ "inlineNetLabelHeight": 0.12,
171
+ "inlineNetLabelWidth": 0.32,
172
+ "pinIds": [
173
+ "schematic_port_1",
174
+ "schematic_port_8",
175
+ "schematic_port_14"
176
+ ]
177
+ },
178
+ {
179
+ "netId": "SDA",
180
+ "isGround": false,
181
+ "netLabelWidth": 0.48,
182
+ "anchoredNetLabelWidth": 0.48,
183
+ "allowInlineNetLabel": true,
184
+ "inlineNetLabelHeight": 0.12,
185
+ "inlineNetLabelWidth": 0.32,
186
+ "pinIds": [
187
+ "schematic_port_2",
188
+ "schematic_port_5",
189
+ "schematic_port_16"
190
+ ]
191
+ },
192
+ {
193
+ "netId": "ALERT",
194
+ "isGround": false,
195
+ "netLabelWidth": 0.72,
196
+ "anchoredNetLabelWidth": 0.72,
197
+ "allowInlineNetLabel": true,
198
+ "inlineNetLabelHeight": 0.12,
199
+ "inlineNetLabelWidth": 0.48,
200
+ "pinIds": [
201
+ "schematic_port_3",
202
+ "schematic_port_7"
203
+ ]
204
+ },
205
+ {
206
+ "netId": "GND",
207
+ "isGround": true,
208
+ "netLabelWidth": 0.42,
209
+ "netLabelHeight": 0.48,
210
+ "pinIds": [
211
+ "schematic_port_4",
212
+ "schematic_port_6",
213
+ "schematic_port_11",
214
+ "schematic_port_12"
215
+ ]
216
+ }
217
+ ],
218
+ "textBoxes": [
219
+ {
220
+ "chipId": "schematic_component_0",
221
+ "center": {
222
+ "x": 3.08,
223
+ "y": -2.4299999999999997
224
+ },
225
+ "width": 0.3599999999999999,
226
+ "height": 0.17999999999999972,
227
+ "text": "MCU"
228
+ },
229
+ {
230
+ "chipId": "schematic_component_0",
231
+ "center": {
232
+ "x": 3.0199999999999996,
233
+ "y": 2.415
234
+ },
235
+ "width": 0.3599999999999999,
236
+ "height": 0.24999999999999956,
237
+ "text": "U2"
238
+ },
239
+ {
240
+ "chipId": "schematic_component_1",
241
+ "center": {
242
+ "x": -3.04,
243
+ "y": -2.4299999999999997
244
+ },
245
+ "width": 1.3199999999999998,
246
+ "height": 0.17999999999999972,
247
+ "text": "HDC3020DEFR"
248
+ },
249
+ {
250
+ "chipId": "schematic_component_1",
251
+ "center": {
252
+ "x": -3.58,
253
+ "y": 2.415
254
+ },
255
+ "width": 0.3600000000000003,
256
+ "height": 0.24999999999999956,
257
+ "text": "U1"
258
+ }
259
+ ],
260
+ "availableNetLabelOrientations": {
261
+ "VDD": [
262
+ "y+"
263
+ ],
264
+ "SCL": [
265
+ "x-",
266
+ "x+"
267
+ ],
268
+ "SDA": [
269
+ "x-",
270
+ "x+"
271
+ ],
272
+ "ALERT": [
273
+ "x-",
274
+ "x+"
275
+ ],
276
+ "GND": [
277
+ "y-"
278
+ ]
279
+ },
280
+ "maxMspPairDistance": 2.4,
281
+ "_hideRatsNet": false
282
+ }
@@ -0,0 +1,25 @@
1
+ import { expect, test } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import type { InputProblem } from "lib/types/InputProblem"
4
+ import "tests/fixtures/matcher"
5
+ import inputProblem from "./assets/repro-hdc3020-ground-label-alignment.input.json"
6
+
7
+ test("repro HDC3020 shared ground rail label alignment", () => {
8
+ const solver = new SchematicTracePipelineSolver(
9
+ inputProblem as InputProblem,
10
+ {
11
+ hideRatsNet: true,
12
+ },
13
+ )
14
+
15
+ solver.solve()
16
+
17
+ const groundLabel = solver
18
+ .availableNetOrientationSolver!.getOutput()
19
+ .netLabelPlacements.find((label) =>
20
+ label.pinIds.includes("schematic_port_6"),
21
+ )
22
+
23
+ expect(groundLabel?.anchorPoint.x).toBeCloseTo(0.1)
24
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
25
+ })