@tscircuit/schematic-trace-solver 0.0.33 → 0.0.35

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.
Files changed (27) hide show
  1. package/dist/index.js +36 -4
  2. package/lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver.ts +25 -4
  3. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2.ts +19 -0
  4. package/package.json +2 -2
  5. package/site/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2_01-example17.page.tsx +324 -0
  6. package/site/examples/example15-rp2040-caps.page.tsx +623 -0
  7. package/site/examples/example16-core-repro51.page.tsx +107 -0
  8. package/site/examples/example17-straight-line-trace.page.tsx +165 -0
  9. package/site/examples/example18.page.tsx +181 -0
  10. package/site/examples/example19.page.tsx +169 -0
  11. package/tests/examples/__snapshots__/example02.snap.svg +5 -8
  12. package/tests/examples/__snapshots__/example04.snap.svg +15 -12
  13. package/tests/examples/__snapshots__/example15.snap.svg +797 -71
  14. package/tests/examples/__snapshots__/example16.snap.svg +40 -86
  15. package/tests/examples/__snapshots__/example17.snap.svg +187 -0
  16. package/tests/examples/__snapshots__/example18.snap.svg +235 -0
  17. package/tests/examples/__snapshots__/example19.snap.svg +195 -0
  18. package/tests/examples/example15.test.tsx +524 -82
  19. package/tests/examples/example16.test.tsx +56 -118
  20. package/tests/examples/example17.test.tsx +171 -0
  21. package/tests/examples/example18.test.tsx +187 -0
  22. package/tests/examples/example19.test.tsx +175 -0
  23. package/tests/fixtures/matcher.ts +17 -15
  24. package/tests/fixtures/preload.ts +1 -0
  25. package/tests/solvers/SchematicTraceSingleLineSolver/SchematicTraceSingleLineSolver_repro01.test.ts +1 -1
  26. package/tests/solvers/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2_01-example17-d1_1-u1_1.test.ts +323 -0
  27. package/tests/solvers/SchematicTraceSingleLineSolver2/__snapshots__/SchematicTraceSingleLineSolver2_01-example17-d1_1-u1_1.snap.svg +160 -0
@@ -0,0 +1,623 @@
1
+ import { PipelineDebugger } from "site/components/PipelineDebugger"
2
+ import type { InputProblem } from "lib/types/InputProblem"
3
+
4
+ const inputProblem: InputProblem = {
5
+ chips: [
6
+ {
7
+ chipId: "schematic_component_0",
8
+ center: {
9
+ x: 0.79,
10
+ y: 0,
11
+ },
12
+ width: 3.8,
13
+ height: 8.400000000000004,
14
+ pins: [
15
+ {
16
+ pinId: "U3.1",
17
+ x: -1.1099999999999999,
18
+ y: 1.2000000000000015,
19
+ },
20
+ {
21
+ pinId: "U3.2",
22
+ x: -1.1099999999999999,
23
+ y: -1.8000000000000007,
24
+ },
25
+ {
26
+ pinId: "U3.3",
27
+ x: -1.1099999999999999,
28
+ y: -2.000000000000001,
29
+ },
30
+ {
31
+ pinId: "U3.4",
32
+ x: -1.1099999999999999,
33
+ y: -2.200000000000001,
34
+ },
35
+ {
36
+ pinId: "U3.5",
37
+ x: -1.1099999999999999,
38
+ y: -2.4000000000000012,
39
+ },
40
+ {
41
+ pinId: "U3.6",
42
+ x: -1.1099999999999999,
43
+ y: -2.6000000000000014,
44
+ },
45
+ {
46
+ pinId: "U3.7",
47
+ x: -1.1099999999999999,
48
+ y: -2.8000000000000016,
49
+ },
50
+ {
51
+ pinId: "U3.8",
52
+ x: -1.1099999999999999,
53
+ y: -3.0000000000000018,
54
+ },
55
+ {
56
+ pinId: "U3.9",
57
+ x: -1.1099999999999999,
58
+ y: -3.200000000000002,
59
+ },
60
+ {
61
+ pinId: "U3.10",
62
+ x: -1.1099999999999999,
63
+ y: 1.0000000000000013,
64
+ },
65
+ {
66
+ pinId: "U3.11",
67
+ x: -1.1099999999999999,
68
+ y: -3.400000000000002,
69
+ },
70
+ {
71
+ pinId: "U3.12",
72
+ x: -1.1099999999999999,
73
+ y: -3.6000000000000023,
74
+ },
75
+ {
76
+ pinId: "U3.13",
77
+ x: -1.1099999999999999,
78
+ y: -3.8000000000000025,
79
+ },
80
+ {
81
+ pinId: "U3.14",
82
+ x: -1.1099999999999999,
83
+ y: -4.000000000000002,
84
+ },
85
+ {
86
+ pinId: "U3.15",
87
+ x: 2.69,
88
+ y: -0.5000000000000009,
89
+ },
90
+ {
91
+ pinId: "U3.16",
92
+ x: 2.69,
93
+ y: -0.7000000000000011,
94
+ },
95
+ {
96
+ pinId: "U3.17",
97
+ x: 2.69,
98
+ y: -0.9000000000000012,
99
+ },
100
+ {
101
+ pinId: "U3.18",
102
+ x: 2.69,
103
+ y: -1.1000000000000014,
104
+ },
105
+ {
106
+ pinId: "U3.19",
107
+ x: 2.69,
108
+ y: -1.3000000000000014,
109
+ },
110
+ {
111
+ pinId: "U3.20",
112
+ x: 2.69,
113
+ y: -1.9000000000000015,
114
+ },
115
+ {
116
+ pinId: "U3.21",
117
+ x: 2.69,
118
+ y: -2.1000000000000014,
119
+ },
120
+ {
121
+ pinId: "U3.22",
122
+ x: -1.1099999999999999,
123
+ y: 0.8000000000000012,
124
+ },
125
+ {
126
+ pinId: "U3.23",
127
+ x: -1.1099999999999999,
128
+ y: 2.8000000000000016,
129
+ },
130
+ {
131
+ pinId: "U3.24",
132
+ x: 2.69,
133
+ y: -2.7000000000000015,
134
+ },
135
+ {
136
+ pinId: "U3.25",
137
+ x: 2.69,
138
+ y: -2.9000000000000012,
139
+ },
140
+ {
141
+ pinId: "U3.26",
142
+ x: 2.69,
143
+ y: -3.1000000000000014,
144
+ },
145
+ {
146
+ pinId: "U3.27",
147
+ x: 2.69,
148
+ y: 0.0999999999999992,
149
+ },
150
+ {
151
+ pinId: "U3.28",
152
+ x: 2.69,
153
+ y: 0.2999999999999994,
154
+ },
155
+ {
156
+ pinId: "U3.29",
157
+ x: 2.69,
158
+ y: 0.49999999999999956,
159
+ },
160
+ {
161
+ pinId: "U3.30",
162
+ x: 2.69,
163
+ y: 0.6999999999999997,
164
+ },
165
+ {
166
+ pinId: "U3.31",
167
+ x: 2.69,
168
+ y: 0.8999999999999995,
169
+ },
170
+ {
171
+ pinId: "U3.32",
172
+ x: 2.69,
173
+ y: 1.0999999999999996,
174
+ },
175
+ {
176
+ pinId: "U3.33",
177
+ x: -1.1099999999999999,
178
+ y: 0.600000000000001,
179
+ },
180
+ {
181
+ pinId: "U3.34",
182
+ x: 2.69,
183
+ y: 1.2999999999999998,
184
+ },
185
+ {
186
+ pinId: "U3.35",
187
+ x: 2.69,
188
+ y: 1.5,
189
+ },
190
+ {
191
+ pinId: "U3.36",
192
+ x: 2.69,
193
+ y: 1.7000000000000002,
194
+ },
195
+ {
196
+ pinId: "U3.37",
197
+ x: 2.69,
198
+ y: 1.9000000000000004,
199
+ },
200
+ {
201
+ pinId: "U3.38",
202
+ x: 2.69,
203
+ y: 2.500000000000001,
204
+ },
205
+ {
206
+ pinId: "U3.39",
207
+ x: 2.69,
208
+ y: 2.700000000000001,
209
+ },
210
+ {
211
+ pinId: "U3.40",
212
+ x: 2.69,
213
+ y: 2.9000000000000012,
214
+ },
215
+ {
216
+ pinId: "U3.41",
217
+ x: 2.69,
218
+ y: 3.1000000000000014,
219
+ },
220
+ {
221
+ pinId: "U3.42",
222
+ x: -1.1099999999999999,
223
+ y: 0.4000000000000008,
224
+ },
225
+ {
226
+ pinId: "U3.43",
227
+ x: -1.1099999999999999,
228
+ y: -1.6000000000000005,
229
+ },
230
+ {
231
+ pinId: "U3.44",
232
+ x: -1.1099999999999999,
233
+ y: 2.0000000000000018,
234
+ },
235
+ {
236
+ pinId: "U3.45",
237
+ x: -1.1099999999999999,
238
+ y: 1.8000000000000016,
239
+ },
240
+ {
241
+ pinId: "U3.46",
242
+ x: -1.1099999999999999,
243
+ y: -1.4000000000000004,
244
+ },
245
+ {
246
+ pinId: "U3.47",
247
+ x: -1.1099999999999999,
248
+ y: -1.2000000000000002,
249
+ },
250
+ {
251
+ pinId: "U3.48",
252
+ x: -1.1099999999999999,
253
+ y: -1,
254
+ },
255
+ {
256
+ pinId: "U3.49",
257
+ x: -1.1099999999999999,
258
+ y: 0.20000000000000062,
259
+ },
260
+ {
261
+ pinId: "U3.50",
262
+ x: -1.1099999999999999,
263
+ y: 2.600000000000002,
264
+ },
265
+ {
266
+ pinId: "U3.51",
267
+ x: -1.1099999999999999,
268
+ y: 3.0000000000000018,
269
+ },
270
+ {
271
+ pinId: "U3.52",
272
+ x: -1.1099999999999999,
273
+ y: 3.200000000000002,
274
+ },
275
+ {
276
+ pinId: "U3.53",
277
+ x: -1.1099999999999999,
278
+ y: 3.4000000000000017,
279
+ },
280
+ {
281
+ pinId: "U3.54",
282
+ x: -1.1099999999999999,
283
+ y: 3.600000000000002,
284
+ },
285
+ {
286
+ pinId: "U3.55",
287
+ x: -1.1099999999999999,
288
+ y: 3.8000000000000016,
289
+ },
290
+ {
291
+ pinId: "U3.56",
292
+ x: -1.1099999999999999,
293
+ y: 4.000000000000002,
294
+ },
295
+ {
296
+ pinId: "U3.57",
297
+ x: -1.1099999999999999,
298
+ y: -0.39999999999999947,
299
+ },
300
+ ],
301
+ },
302
+ {
303
+ chipId: "schematic_component_1",
304
+ center: {
305
+ x: -1.5675,
306
+ y: 5.955000000000002,
307
+ },
308
+ width: 0.53,
309
+ height: 1.0999999999999996,
310
+ pins: [
311
+ {
312
+ pinId: "C12.1",
313
+ x: -1.5675,
314
+ y: 6.505000000000002,
315
+ },
316
+ {
317
+ pinId: "C12.2",
318
+ x: -1.5675,
319
+ y: 5.405000000000002,
320
+ },
321
+ ],
322
+ },
323
+ {
324
+ chipId: "schematic_component_2",
325
+ center: {
326
+ x: -0.6374999999999998,
327
+ y: 5.955000000000002,
328
+ },
329
+ width: 0.53,
330
+ height: 1.0999999999999996,
331
+ pins: [
332
+ {
333
+ pinId: "C14.1",
334
+ x: -0.6374999999999998,
335
+ y: 6.505000000000002,
336
+ },
337
+ {
338
+ pinId: "C14.2",
339
+ x: -0.6374999999999998,
340
+ y: 5.405000000000002,
341
+ },
342
+ ],
343
+ },
344
+ {
345
+ chipId: "schematic_component_3",
346
+ center: {
347
+ x: -2.4975,
348
+ y: 5.955000000000002,
349
+ },
350
+ width: 0.53,
351
+ height: 1.0999999999999996,
352
+ pins: [
353
+ {
354
+ pinId: "C8.1",
355
+ x: -2.4975,
356
+ y: 6.505000000000002,
357
+ },
358
+ {
359
+ pinId: "C8.2",
360
+ x: -2.4975,
361
+ y: 5.405000000000002,
362
+ },
363
+ ],
364
+ },
365
+ {
366
+ chipId: "schematic_component_4",
367
+ center: {
368
+ x: 0.2925000000000004,
369
+ y: 5.955000000000002,
370
+ },
371
+ width: 0.53,
372
+ height: 1.0999999999999996,
373
+ pins: [
374
+ {
375
+ pinId: "C13.1",
376
+ x: 0.29250000000000037,
377
+ y: 6.505000000000002,
378
+ },
379
+ {
380
+ pinId: "C13.2",
381
+ x: 0.2925000000000005,
382
+ y: 5.405000000000002,
383
+ },
384
+ ],
385
+ },
386
+ {
387
+ chipId: "schematic_component_5",
388
+ center: {
389
+ x: 1.2225000000000006,
390
+ y: 5.955000000000002,
391
+ },
392
+ width: 0.53,
393
+ height: 1.0999999999999996,
394
+ pins: [
395
+ {
396
+ pinId: "C15.1",
397
+ x: 1.2225000000000006,
398
+ y: 6.505000000000002,
399
+ },
400
+ {
401
+ pinId: "C15.2",
402
+ x: 1.2225000000000006,
403
+ y: 5.405000000000002,
404
+ },
405
+ ],
406
+ },
407
+ {
408
+ chipId: "schematic_component_6",
409
+ center: {
410
+ x: 2.1525000000000007,
411
+ y: 5.955000000000002,
412
+ },
413
+ width: 0.53,
414
+ height: 1.0999999999999996,
415
+ pins: [
416
+ {
417
+ pinId: "C19.1",
418
+ x: 2.1525000000000007,
419
+ y: 6.505000000000002,
420
+ },
421
+ {
422
+ pinId: "C19.2",
423
+ x: 2.1525000000000007,
424
+ y: 5.405000000000002,
425
+ },
426
+ ],
427
+ },
428
+ {
429
+ chipId: "schematic_component_7",
430
+ center: {
431
+ x: -4.6850000000000005,
432
+ y: 3.218333333333335,
433
+ },
434
+ width: 0.53,
435
+ height: 1.1000000000000005,
436
+ pins: [
437
+ {
438
+ pinId: "C18.1",
439
+ x: -4.6850000000000005,
440
+ y: 3.7683333333333353,
441
+ },
442
+ {
443
+ pinId: "C18.2",
444
+ x: -4.6850000000000005,
445
+ y: 2.668333333333335,
446
+ },
447
+ ],
448
+ },
449
+ {
450
+ chipId: "schematic_component_8",
451
+ center: {
452
+ x: -3.7550000000000003,
453
+ y: 3.218333333333335,
454
+ },
455
+ width: 0.53,
456
+ height: 1.1000000000000005,
457
+ pins: [
458
+ {
459
+ pinId: "C7.1",
460
+ x: -3.7550000000000003,
461
+ y: 3.7683333333333353,
462
+ },
463
+ {
464
+ pinId: "C7.2",
465
+ x: -3.7550000000000003,
466
+ y: 2.668333333333335,
467
+ },
468
+ ],
469
+ },
470
+ {
471
+ chipId: "schematic_component_9",
472
+ center: {
473
+ x: -6.415,
474
+ y: 3.2183333333333355,
475
+ },
476
+ width: 0.53,
477
+ height: 1.0999999999999996,
478
+ pins: [
479
+ {
480
+ pinId: "C9.1",
481
+ x: -6.415,
482
+ y: 3.7683333333333353,
483
+ },
484
+ {
485
+ pinId: "C9.2",
486
+ x: -6.415,
487
+ y: 2.6683333333333357,
488
+ },
489
+ ],
490
+ },
491
+ {
492
+ chipId: "schematic_component_10",
493
+ center: {
494
+ x: -2.025,
495
+ y: 1.450000000000001,
496
+ },
497
+ width: 0.53,
498
+ height: 1.1,
499
+ pins: [
500
+ {
501
+ pinId: "C10.1",
502
+ x: -2.025,
503
+ y: 2.000000000000001,
504
+ },
505
+ {
506
+ pinId: "C10.2",
507
+ x: -2.025,
508
+ y: 0.900000000000001,
509
+ },
510
+ ],
511
+ },
512
+ {
513
+ chipId: "schematic_component_11",
514
+ center: {
515
+ x: -2.025,
516
+ y: -2.1500000000000004,
517
+ },
518
+ width: 0.53,
519
+ height: 1.1,
520
+ pins: [
521
+ {
522
+ pinId: "C11.1",
523
+ x: -2.025,
524
+ y: -1.6000000000000003,
525
+ },
526
+ {
527
+ pinId: "C11.2",
528
+ x: -2.025,
529
+ y: -2.7,
530
+ },
531
+ ],
532
+ },
533
+ ],
534
+ directConnections: [
535
+ {
536
+ pinIds: ["U3.1", "C12.1"],
537
+ netId: "chip.U3 > port.IOVDD1 to C12.pin1",
538
+ },
539
+ {
540
+ pinIds: ["U3.10", "C14.1"],
541
+ netId: "chip.U3 > port.IOVDD2 to C14.pin1",
542
+ },
543
+ {
544
+ pinIds: ["U3.22", "C8.1"],
545
+ netId: "chip.U3 > port.IOVDD3 to C8.pin1",
546
+ },
547
+ {
548
+ pinIds: ["U3.33", "C13.1"],
549
+ netId: "chip.U3 > port.IOVDD4 to C13.pin1",
550
+ },
551
+ {
552
+ pinIds: ["U3.42", "C15.1"],
553
+ netId: "chip.U3 > port.IOVDD5 to C15.pin1",
554
+ },
555
+ {
556
+ pinIds: ["U3.49", "C19.1"],
557
+ netId: "chip.U3 > port.IOVDD6 to C19.pin1",
558
+ },
559
+ {
560
+ pinIds: ["U3.23", "C18.1"],
561
+ netId: "chip.U3 > port.DVDD1 to C18.1",
562
+ },
563
+ {
564
+ pinIds: ["U3.50", "C7.1"],
565
+ netId: "chip.U3 > port.DVDD2 to C7.1",
566
+ },
567
+ {
568
+ pinIds: ["C10.1", "U3.44"],
569
+ netId: "capacitor.C10 > port.pin1 to U3.VREG_VIN",
570
+ },
571
+ {
572
+ pinIds: ["C11.1", "U3.43"],
573
+ netId: "capacitor.C11 > port.pin1 to U3.ADC_AVDD",
574
+ },
575
+ ],
576
+ netConnections: [
577
+ {
578
+ netId: "V3_3",
579
+ pinIds: [
580
+ "U3.1",
581
+ "U3.10",
582
+ "U3.22",
583
+ "U3.33",
584
+ "U3.42",
585
+ "U3.49",
586
+ "C12.1",
587
+ "C14.1",
588
+ "C8.1",
589
+ "C13.1",
590
+ "C15.1",
591
+ "C19.1",
592
+ ],
593
+ },
594
+ {
595
+ netId: "V1_1",
596
+ pinIds: ["U3.23", "U3.50", "C18.1", "C7.1", "C9.1"],
597
+ },
598
+ {
599
+ netId: "GND",
600
+ pinIds: [
601
+ "C12.2",
602
+ "C14.2",
603
+ "C8.2",
604
+ "C13.2",
605
+ "C15.2",
606
+ "C19.2",
607
+ "C18.2",
608
+ "C7.2",
609
+ "C9.2",
610
+ "C10.2",
611
+ "C11.2",
612
+ ],
613
+ },
614
+ ],
615
+ availableNetLabelOrientations: {
616
+ V3_3: ["y+"],
617
+ V1_1: ["y+"],
618
+ GND: ["y-"],
619
+ },
620
+ maxMspPairDistance: 2.4,
621
+ }
622
+
623
+ export default () => <PipelineDebugger inputProblem={inputProblem} />
@@ -0,0 +1,107 @@
1
+ import { PipelineDebugger } from "site/components/PipelineDebugger"
2
+ import type { InputProblem } from "lib/types/InputProblem"
3
+
4
+ const inputProblem: InputProblem = {
5
+ chips: [
6
+ {
7
+ chipId: "schematic_component_0",
8
+ center: {
9
+ x: 0,
10
+ y: 0,
11
+ },
12
+ width: 2.4000000000000004,
13
+ height: 1,
14
+ pins: [
15
+ {
16
+ pinId: "U1.1",
17
+ x: 1.2000000000000002,
18
+ y: -0.30000000000000004,
19
+ },
20
+ {
21
+ pinId: "U1.2",
22
+ x: -1.2000000000000002,
23
+ y: -0.30000000000000004,
24
+ },
25
+ {
26
+ pinId: "U1.3",
27
+ x: 1.2000000000000002,
28
+ y: 0.09999999999999998,
29
+ },
30
+ {
31
+ pinId: "U1.4",
32
+ x: -1.2000000000000002,
33
+ y: 0.30000000000000004,
34
+ },
35
+ {
36
+ pinId: "U1.5",
37
+ x: -1.2000000000000002,
38
+ y: 0.10000000000000003,
39
+ },
40
+ {
41
+ pinId: "U1.6",
42
+ x: -1.2000000000000002,
43
+ y: -0.09999999999999998,
44
+ },
45
+ {
46
+ pinId: "U1.7",
47
+ x: 1.2000000000000002,
48
+ y: -0.10000000000000003,
49
+ },
50
+ {
51
+ pinId: "U1.8",
52
+ x: 1.2000000000000002,
53
+ y: 0.30000000000000004,
54
+ },
55
+ ],
56
+ },
57
+ {
58
+ chipId: "schematic_component_1",
59
+ center: {
60
+ x: 2.7,
61
+ y: 1.9049999999999998,
62
+ },
63
+ width: 2.2,
64
+ height: 0.8,
65
+ pins: [
66
+ {
67
+ pinId: "J1.1",
68
+ x: 1.6,
69
+ y: 2.105,
70
+ },
71
+ {
72
+ pinId: "J1.2",
73
+ x: 1.6,
74
+ y: 1.9049999999999998,
75
+ },
76
+ {
77
+ pinId: "J1.3",
78
+ x: 1.6,
79
+ y: 1.7049999999999998,
80
+ },
81
+ ],
82
+ },
83
+ ],
84
+ directConnections: [],
85
+ netConnections: [
86
+ {
87
+ netId: "GND",
88
+ pinIds: ["U1.1", "J1.3"],
89
+ },
90
+ {
91
+ netId: "OUT",
92
+ pinIds: ["U1.3", "J1.2"],
93
+ },
94
+ {
95
+ netId: "VCC",
96
+ pinIds: ["U1.8", "J1.1"],
97
+ },
98
+ ],
99
+ availableNetLabelOrientations: {
100
+ VCC: ["y+"],
101
+ OUT: ["x-", "x+"],
102
+ GND: ["y-"],
103
+ },
104
+ maxMspPairDistance: 2.4,
105
+ }
106
+
107
+ export default () => <PipelineDebugger inputProblem={inputProblem} />