@tscircuit/schematic-trace-solver 0.0.47 → 0.0.49

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