@tscircuit/schematic-trace-solver 0.0.115 → 0.0.116

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,518 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": 0,
7
+ "y": 0
8
+ },
9
+ "width": 2.5,
10
+ "height": 4,
11
+ "pins": [
12
+ {
13
+ "pinId": "schematic_port_0",
14
+ "x": 1.25,
15
+ "y": -1.2000000000000002
16
+ },
17
+ {
18
+ "pinId": "schematic_port_1",
19
+ "x": 1.25,
20
+ "y": 1.4000000000000001
21
+ },
22
+ {
23
+ "pinId": "schematic_port_2",
24
+ "x": 1.25,
25
+ "y": 0.8499999999999999
26
+ },
27
+ {
28
+ "pinId": "schematic_port_3",
29
+ "x": 1.25,
30
+ "y": 0.2999999999999998
31
+ },
32
+ {
33
+ "pinId": "schematic_port_4",
34
+ "x": 1.25,
35
+ "y": -0.10000000000000009
36
+ },
37
+ {
38
+ "pinId": "schematic_port_5",
39
+ "x": 1.25,
40
+ "y": -0.6500000000000001
41
+ },
42
+ {
43
+ "pinId": "schematic_port_6",
44
+ "x": 1.25,
45
+ "y": -0.8500000000000001
46
+ },
47
+ {
48
+ "pinId": "schematic_port_7",
49
+ "x": 1.25,
50
+ "y": -0.30000000000000004
51
+ },
52
+ {
53
+ "pinId": "schematic_port_8",
54
+ "x": 1.25,
55
+ "y": 0.09999999999999987
56
+ },
57
+ {
58
+ "pinId": "schematic_port_9",
59
+ "x": 1.25,
60
+ "y": 0.6499999999999997
61
+ },
62
+ {
63
+ "pinId": "schematic_port_10",
64
+ "x": 1.25,
65
+ "y": 1.2
66
+ },
67
+ {
68
+ "pinId": "schematic_port_11",
69
+ "x": 1.25,
70
+ "y": -1.4000000000000001
71
+ },
72
+ {
73
+ "pinId": "schematic_port_12",
74
+ "x": -0.37500000000000006,
75
+ "y": -2
76
+ },
77
+ {
78
+ "pinId": "schematic_port_13",
79
+ "x": -0.17500000000000004,
80
+ "y": -2
81
+ },
82
+ {
83
+ "pinId": "schematic_port_14",
84
+ "x": 0.024999999999999967,
85
+ "y": -2
86
+ },
87
+ {
88
+ "pinId": "schematic_port_15",
89
+ "x": 0.22500000000000003,
90
+ "y": -2
91
+ }
92
+ ],
93
+ "sectionId": "Power Input & 3V3 Regulator"
94
+ },
95
+ {
96
+ "chipId": "schematic_component_1",
97
+ "center": {
98
+ "x": 2.98,
99
+ "y": 1.5149999999999988
100
+ },
101
+ "width": 1.04,
102
+ "height": 0.6799999999999999,
103
+ "pins": [
104
+ {
105
+ "pinId": "schematic_port_16",
106
+ "x": 2.46,
107
+ "y": 1.4449999999999987,
108
+ "_facingDirection": "x-"
109
+ },
110
+ {
111
+ "pinId": "schematic_port_17",
112
+ "x": 3.5,
113
+ "y": 1.4449999999999987,
114
+ "_facingDirection": "x+"
115
+ }
116
+ ],
117
+ "sectionId": "Power Input & 3V3 Regulator"
118
+ },
119
+ {
120
+ "chipId": "schematic_component_2",
121
+ "center": {
122
+ "x": 2.88,
123
+ "y": -0.6500000000000015
124
+ },
125
+ "width": 0.8399999999999999,
126
+ "height": 1.1000000000000003,
127
+ "pins": [
128
+ {
129
+ "pinId": "schematic_port_18",
130
+ "x": 3.1799999999999997,
131
+ "y": -0.10000000000000131
132
+ },
133
+ {
134
+ "pinId": "schematic_port_19",
135
+ "x": 3.19,
136
+ "y": -1.2000000000000015
137
+ },
138
+ {
139
+ "pinId": "schematic_port_20",
140
+ "x": 2.46,
141
+ "y": -0.7500000000000013
142
+ }
143
+ ],
144
+ "sectionId": "Power Input & 3V3 Regulator"
145
+ },
146
+ {
147
+ "chipId": "schematic_component_3",
148
+ "center": {
149
+ "x": 5.057499999999999,
150
+ "y": -0.4000000000000013
151
+ },
152
+ "width": 1.085,
153
+ "height": 0.6,
154
+ "pins": [
155
+ {
156
+ "pinId": "schematic_port_21",
157
+ "x": 4.84,
158
+ "y": -0.10000000000000131,
159
+ "_facingDirection": "y+"
160
+ },
161
+ {
162
+ "pinId": "schematic_port_22",
163
+ "x": 4.84,
164
+ "y": -0.7000000000000013,
165
+ "_facingDirection": "y-"
166
+ }
167
+ ],
168
+ "sectionId": "Power Input & 3V3 Regulator"
169
+ },
170
+ {
171
+ "chipId": "schematic_component_4",
172
+ "center": {
173
+ "x": 2.65,
174
+ "y": -3.2050000000000014
175
+ },
176
+ "width": 2,
177
+ "height": 0.7999999999999998,
178
+ "pins": [
179
+ {
180
+ "pinId": "schematic_port_23",
181
+ "x": 1.65,
182
+ "y": -3.0050000000000012
183
+ },
184
+ {
185
+ "pinId": "schematic_port_24",
186
+ "x": 1.65,
187
+ "y": -3.2050000000000014
188
+ },
189
+ {
190
+ "pinId": "schematic_port_25",
191
+ "x": 1.65,
192
+ "y": -3.4050000000000016
193
+ },
194
+ {
195
+ "pinId": "schematic_port_26",
196
+ "x": 3.65,
197
+ "y": -3.3050000000000015
198
+ },
199
+ {
200
+ "pinId": "schematic_port_27",
201
+ "x": 3.65,
202
+ "y": -3.1050000000000013
203
+ }
204
+ ],
205
+ "sectionId": "Power Input & 3V3 Regulator"
206
+ },
207
+ {
208
+ "chipId": "schematic_component_5",
209
+ "center": {
210
+ "x": 5.26,
211
+ "y": 1.4099999999999986
212
+ },
213
+ "width": 0.9200000000000008,
214
+ "height": 0.7599999999999998,
215
+ "pins": [
216
+ {
217
+ "pinId": "schematic_port_28",
218
+ "x": 5.125,
219
+ "y": 1.7899999999999985,
220
+ "_facingDirection": "y+"
221
+ },
222
+ {
223
+ "pinId": "schematic_port_29",
224
+ "x": 5.125,
225
+ "y": 1.0299999999999987,
226
+ "_facingDirection": "y-"
227
+ }
228
+ ],
229
+ "sectionId": "Power Input & 3V3 Regulator"
230
+ },
231
+ {
232
+ "chipId": "schematic_component_6",
233
+ "center": {
234
+ "x": 4.914999999999999,
235
+ "y": -3.8050000000000015
236
+ },
237
+ "width": 1.04,
238
+ "height": 0.7600000000000011,
239
+ "pins": [
240
+ {
241
+ "pinId": "schematic_port_30",
242
+ "x": 4.72,
243
+ "y": -3.4250000000000007,
244
+ "_facingDirection": "y+"
245
+ },
246
+ {
247
+ "pinId": "schematic_port_31",
248
+ "x": 4.72,
249
+ "y": -4.185000000000002,
250
+ "_facingDirection": "y-"
251
+ }
252
+ ],
253
+ "sectionId": "Power Input & 3V3 Regulator"
254
+ },
255
+ {
256
+ "chipId": "schematic_component_7",
257
+ "center": {
258
+ "x": 6.464999999999999,
259
+ "y": -3.8050000000000015
260
+ },
261
+ "width": 1.4499999999999993,
262
+ "height": 0.7799999999999994,
263
+ "pins": [
264
+ {
265
+ "pinId": "schematic_port_32",
266
+ "x": 6.289999999999999,
267
+ "y": -4.195000000000001,
268
+ "_facingDirection": "y-"
269
+ },
270
+ {
271
+ "pinId": "schematic_port_33",
272
+ "x": 6.289999999999999,
273
+ "y": -3.415000000000002,
274
+ "_facingDirection": "y+"
275
+ }
276
+ ],
277
+ "sectionId": "Power Input & 3V3 Regulator"
278
+ },
279
+ {
280
+ "chipId": "schematic_component_8",
281
+ "center": {
282
+ "x": 7.794999999999999,
283
+ "y": -3.8050000000000015
284
+ },
285
+ "width": 0.9199999999999999,
286
+ "height": 0.7600000000000011,
287
+ "pins": [
288
+ {
289
+ "pinId": "schematic_port_34",
290
+ "x": 7.659999999999999,
291
+ "y": -3.4250000000000007,
292
+ "_facingDirection": "y+"
293
+ },
294
+ {
295
+ "pinId": "schematic_port_35",
296
+ "x": 7.659999999999999,
297
+ "y": -4.185000000000002,
298
+ "_facingDirection": "y-"
299
+ }
300
+ ],
301
+ "sectionId": "Power Input & 3V3 Regulator"
302
+ },
303
+ {
304
+ "chipId": "schematic_component_9",
305
+ "center": {
306
+ "x": 0.032500000000000334,
307
+ "y": -5.044999999999999
308
+ },
309
+ "width": 1.0050000000000001,
310
+ "height": 1.1300000000000008,
311
+ "pins": [
312
+ {
313
+ "pinId": "schematic_port_36",
314
+ "x": -0.14499999999999957,
315
+ "y": -4.479999999999999,
316
+ "_facingDirection": "y+"
317
+ },
318
+ {
319
+ "pinId": "schematic_port_37",
320
+ "x": -0.1449999999999998,
321
+ "y": -5.609999999999999,
322
+ "_facingDirection": "y-"
323
+ }
324
+ ],
325
+ "sectionId": "Power Input & 3V3 Regulator"
326
+ },
327
+ {
328
+ "chipId": "schematic_component_10",
329
+ "center": {
330
+ "x": 0.012500000000000316,
331
+ "y": -3.504999999999999
332
+ },
333
+ "width": 0.9650000000000001,
334
+ "height": 0.5999999999999996,
335
+ "pins": [
336
+ {
337
+ "pinId": "schematic_port_38",
338
+ "x": -0.14499999999999963,
339
+ "y": -3.204999999999999,
340
+ "_facingDirection": "y+"
341
+ },
342
+ {
343
+ "pinId": "schematic_port_39",
344
+ "x": -0.14499999999999974,
345
+ "y": -3.804999999999999,
346
+ "_facingDirection": "y-"
347
+ }
348
+ ],
349
+ "sectionId": "Power Input & 3V3 Regulator"
350
+ }
351
+ ],
352
+ "directConnections": [
353
+ {
354
+ "netId": ".U3 > .BYP to .C2 > .pin1",
355
+ "pinIds": [
356
+ "schematic_port_26",
357
+ "schematic_port_30"
358
+ ]
359
+ },
360
+ {
361
+ "netId": ".R1 > .pin2 to .LED1 > .anode",
362
+ "pinIds": [
363
+ "schematic_port_39",
364
+ "schematic_port_36"
365
+ ]
366
+ }
367
+ ],
368
+ "netConnections": [
369
+ {
370
+ "netId": "GND",
371
+ "netLabelWidth": 0.42,
372
+ "netLabelHeight": 0.48,
373
+ "pinIds": [
374
+ "schematic_port_0",
375
+ "schematic_port_11",
376
+ "schematic_port_12",
377
+ "schematic_port_13",
378
+ "schematic_port_14",
379
+ "schematic_port_15",
380
+ "schematic_port_22",
381
+ "schematic_port_24",
382
+ "schematic_port_29",
383
+ "schematic_port_31",
384
+ "schematic_port_32",
385
+ "schematic_port_35",
386
+ "schematic_port_37"
387
+ ]
388
+ },
389
+ {
390
+ "netId": "V5",
391
+ "netLabelWidth": 0.42,
392
+ "netLabelHeight": 0.36,
393
+ "pinIds": [
394
+ "schematic_port_1",
395
+ "schematic_port_10",
396
+ "schematic_port_16",
397
+ "schematic_port_20",
398
+ "schematic_port_21"
399
+ ]
400
+ },
401
+ {
402
+ "netId": "DP",
403
+ "netLabelWidth": 0.36,
404
+ "pinIds": [
405
+ "schematic_port_3",
406
+ "schematic_port_8"
407
+ ]
408
+ },
409
+ {
410
+ "netId": "DM",
411
+ "netLabelWidth": 0.36,
412
+ "pinIds": [
413
+ "schematic_port_4",
414
+ "schematic_port_7"
415
+ ]
416
+ },
417
+ {
418
+ "netId": "VBUS",
419
+ "netLabelWidth": 0.42,
420
+ "netLabelHeight": 0.6,
421
+ "pinIds": [
422
+ "schematic_port_17",
423
+ "schematic_port_19",
424
+ "schematic_port_23",
425
+ "schematic_port_28"
426
+ ]
427
+ },
428
+ {
429
+ "netId": "BATT",
430
+ "netLabelWidth": 0.6,
431
+ "pinIds": [
432
+ "schematic_port_18"
433
+ ]
434
+ },
435
+ {
436
+ "netId": "LDO_EN",
437
+ "netLabelWidth": 0.84,
438
+ "pinIds": [
439
+ "schematic_port_25"
440
+ ]
441
+ },
442
+ {
443
+ "netId": "V3V3",
444
+ "netLabelWidth": 0.42,
445
+ "netLabelHeight": 0.6,
446
+ "pinIds": [
447
+ "schematic_port_27",
448
+ "schematic_port_33",
449
+ "schematic_port_34",
450
+ "schematic_port_38"
451
+ ]
452
+ }
453
+ ],
454
+ "textBoxes": [
455
+ {
456
+ "chipId": "schematic_component_0",
457
+ "center": {
458
+ "x": 1.07,
459
+ "y": 1.7149999999999999
460
+ },
461
+ "width": 0.3599999999999999,
462
+ "height": 0.24999999999999978,
463
+ "text": "J1"
464
+ },
465
+ {
466
+ "chipId": "schematic_component_4",
467
+ "center": {
468
+ "x": 3.07,
469
+ "y": -3.735000000000001
470
+ },
471
+ "width": 2.04,
472
+ "height": 0.17999999999999972,
473
+ "text": "MIC5219_3_3YM5_TR"
474
+ },
475
+ {
476
+ "chipId": "schematic_component_4",
477
+ "center": {
478
+ "x": 2.17,
479
+ "y": -2.6900000000000013
480
+ },
481
+ "width": 0.3600000000000003,
482
+ "height": 0.24999999999999956,
483
+ "text": "U3"
484
+ }
485
+ ],
486
+ "availableNetLabelOrientations": {
487
+ "V5": [
488
+ "y+"
489
+ ],
490
+ "GND": [
491
+ "y-"
492
+ ],
493
+ "DP": [
494
+ "x-",
495
+ "x+"
496
+ ],
497
+ "DM": [
498
+ "x-",
499
+ "x+"
500
+ ],
501
+ "VBUS": [
502
+ "y+"
503
+ ],
504
+ "BATT": [
505
+ "x-",
506
+ "x+"
507
+ ],
508
+ "LDO_EN": [
509
+ "x-",
510
+ "x+"
511
+ ],
512
+ "V3V3": [
513
+ "y+"
514
+ ]
515
+ },
516
+ "maxMspPairDistance": 8,
517
+ "_hideRatsNet": false
518
+ }
@@ -0,0 +1,30 @@
1
+ import { expect, test } from "bun:test"
2
+ import { isPathCollidingWithObstacles } from "lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/collisions"
3
+ import { getObstacleRects } from "lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/rect"
4
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
5
+ import type { InputProblem } from "lib/types/InputProblem"
6
+ import inputProblemJson from "./assets/board-15984-schematic-trace-input.json"
7
+ import "tests/fixtures/matcher"
8
+
9
+ test("board 15984 extends the V3V3 rail through schematic component 8", () => {
10
+ const inputProblem: InputProblem = JSON.parse(
11
+ JSON.stringify(inputProblemJson),
12
+ )
13
+ const solver = new SchematicTracePipelineSolver(inputProblem)
14
+
15
+ solver.solve()
16
+
17
+ const component8Trace =
18
+ solver.sameNetJunctionAlignmentSolver!.outputTraces.find(
19
+ (trace) => trace.mspPairId === "schematic_port_34-schematic_port_33",
20
+ )!
21
+ expect(component8Trace.tracePath[1]!.y).toBeCloseTo(-3.105)
22
+ expect(component8Trace.tracePath[2]!.y).toBeCloseTo(-3.105)
23
+ const obstacles = getObstacleRects(inputProblem)
24
+ const tracesCrossingComponents =
25
+ solver.sameNetJunctionAlignmentSolver!.outputTraces.filter((trace) =>
26
+ isPathCollidingWithObstacles(trace.tracePath, obstacles),
27
+ )
28
+ expect(tracesCrossingComponents).toHaveLength(0)
29
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
30
+ })