@tscircuit/schematic-trace-solver 0.0.101 → 0.0.102

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 (32) hide show
  1. package/dist/index.d.ts +13 -6
  2. package/dist/index.js +213 -64
  3. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2.ts +13 -5
  4. package/lib/solvers/TraceOverlapShiftSolver/TraceOverlapIssueSolver/TraceOverlapIssueSolver.ts +168 -24
  5. package/lib/solvers/TraceOverlapShiftSolver/TraceOverlapShiftSolver.ts +128 -48
  6. package/package.json +1 -1
  7. package/site/bug-reports/bug-report-20260716T144856Z.page.tsx +4 -0
  8. package/site/bug-reports/bug-report-20260717T022934Z.page.tsx +4 -0
  9. package/site/bug-reports/bug-report-20260717T031704Z.page.tsx +4 -0
  10. package/tests/bug-reports/bug-report-20260706T213649Z/__snapshots__/bug-report-20260706T213649Z.snap.svg +3 -3
  11. package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +3 -3
  12. package/tests/bug-reports/bug-report-20260707T092615Z/__snapshots__/bug-report-20260707T092615Z.snap.svg +5 -5
  13. package/tests/bug-reports/bug-report-20260707T140410Z/__snapshots__/bug-report-20260707T140410Z.snap.svg +3 -3
  14. package/tests/bug-reports/bug-report-20260716T144856Z/__snapshots__/bug-report-20260716T144856Z.snap.svg +149 -0
  15. package/tests/bug-reports/bug-report-20260716T144856Z/bug-report-20260716T144856Z.json +693 -0
  16. package/tests/bug-reports/bug-report-20260716T144856Z/bug-report-20260716T144856Z.test.ts +12 -0
  17. package/tests/bug-reports/bug-report-20260717T022934Z/__snapshots__/bug-report-20260717T022934Z.snap.svg +130 -0
  18. package/tests/bug-reports/bug-report-20260717T022934Z/bug-report-20260717T022934Z.json +543 -0
  19. package/tests/bug-reports/bug-report-20260717T022934Z/bug-report-20260717T022934Z.test.ts +12 -0
  20. package/tests/bug-reports/bug-report-20260717T031704Z/__snapshots__/bug-report-20260717T031704Z.snap.svg +48 -0
  21. package/tests/bug-reports/bug-report-20260717T031704Z/bug-report-20260717T031704Z.json +77 -0
  22. package/tests/bug-reports/bug-report-20260717T031704Z/bug-report-20260717T031704Z.test.ts +12 -0
  23. package/tests/examples/__snapshots__/example11.snap.svg +19 -19
  24. package/tests/examples/__snapshots__/example19.snap.svg +3 -5
  25. package/tests/examples/__snapshots__/example29.snap.svg +13 -13
  26. package/tests/examples/__snapshots__/example37.snap.svg +4 -2
  27. package/tests/examples/example16.test.ts +22 -0
  28. package/tests/repros/__snapshots__/repro-rp2040-gamepad-trace-alignment.snap.svg +2 -8
  29. package/tests/repros/__snapshots__/repro47-endpoint-obstacle-detour.snap.svg +19 -19
  30. package/tests/repros/__snapshots__/trace-overlap-box-resistor.snap.svg +10 -10
  31. package/tests/repros/repro47-endpoint-obstacle-detour.test.ts +30 -0
  32. package/tests/solvers/TraceOverlapShiftSolver/TraceOverlapShiftSolver.test.ts +174 -0
@@ -0,0 +1,543 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": 0,
7
+ "y": 0
8
+ },
9
+ "width": 2.6,
10
+ "height": 1.6,
11
+ "pins": [
12
+ {
13
+ "pinId": "U1.1",
14
+ "x": -1.3,
15
+ "y": 0.6
16
+ },
17
+ {
18
+ "pinId": "U1.2",
19
+ "x": -1.3,
20
+ "y": 0.19999999999999996
21
+ },
22
+ {
23
+ "pinId": "U1.3",
24
+ "x": -1.3,
25
+ "y": -0.20000000000000007
26
+ },
27
+ {
28
+ "pinId": "U1.4",
29
+ "x": -1.3,
30
+ "y": -0.6
31
+ },
32
+ {
33
+ "pinId": "U1.5",
34
+ "x": 1.3,
35
+ "y": -0.6
36
+ },
37
+ {
38
+ "pinId": "U1.6",
39
+ "x": 1.3,
40
+ "y": -0.19999999999999996
41
+ },
42
+ {
43
+ "pinId": "U1.7",
44
+ "x": 1.3,
45
+ "y": 0.20000000000000007
46
+ },
47
+ {
48
+ "pinId": "U1.8",
49
+ "x": 1.3,
50
+ "y": 0.6
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "chipId": "schematic_component_1",
56
+ "center": {
57
+ "x": 2.455,
58
+ "y": 1.6
59
+ },
60
+ "width": 1.2100000000000002,
61
+ "height": 0.6000000000000001,
62
+ "pins": [
63
+ {
64
+ "pinId": "R1.1",
65
+ "x": 2.3,
66
+ "y": 1.3,
67
+ "_facingDirection": "y-"
68
+ },
69
+ {
70
+ "pinId": "R1.2",
71
+ "x": 2.3,
72
+ "y": 1.9000000000000001,
73
+ "_facingDirection": "y+"
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "chipId": "schematic_component_2",
79
+ "center": {
80
+ "x": 3.1,
81
+ "y": 2.6
82
+ },
83
+ "width": 0.9000000000000004,
84
+ "height": 0.5549999999999997,
85
+ "pins": [
86
+ {
87
+ "pinId": "SJ1.1",
88
+ "x": 3.5500000000000003,
89
+ "y": 2.5,
90
+ "_facingDirection": "x+"
91
+ },
92
+ {
93
+ "pinId": "SJ1.2",
94
+ "x": 3.1,
95
+ "y": 2.8775,
96
+ "_facingDirection": "y+"
97
+ },
98
+ {
99
+ "pinId": "SJ1.3",
100
+ "x": 2.65,
101
+ "y": 2.5,
102
+ "_facingDirection": "x-"
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "chipId": "schematic_component_3",
108
+ "center": {
109
+ "x": 4.055,
110
+ "y": 1.6
111
+ },
112
+ "width": 1.2099999999999995,
113
+ "height": 0.6000000000000001,
114
+ "pins": [
115
+ {
116
+ "pinId": "R2.1",
117
+ "x": 3.9,
118
+ "y": 1.3,
119
+ "_facingDirection": "y-"
120
+ },
121
+ {
122
+ "pinId": "R2.2",
123
+ "x": 3.9,
124
+ "y": 1.9000000000000001,
125
+ "_facingDirection": "y+"
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ "chipId": "schematic_component_4",
131
+ "center": {
132
+ "x": 5.4,
133
+ "y": 2.4
134
+ },
135
+ "width": 0.3041464999999999,
136
+ "height": 0.9000000000000001,
137
+ "pins": [
138
+ {
139
+ "pinId": "SJ2.1",
140
+ "x": 5.3999378,
141
+ "y": 1.9499999999999997,
142
+ "_facingDirection": "y-"
143
+ },
144
+ {
145
+ "pinId": "SJ2.2",
146
+ "x": 5.400062200000001,
147
+ "y": 2.85,
148
+ "_facingDirection": "y+"
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "chipId": "schematic_component_5",
154
+ "center": {
155
+ "x": 5.555,
156
+ "y": 1.2
157
+ },
158
+ "width": 1.21,
159
+ "height": 0.6000000000000001,
160
+ "pins": [
161
+ {
162
+ "pinId": "R3.1",
163
+ "x": 5.4,
164
+ "y": 0.8999999999999999,
165
+ "_facingDirection": "y-"
166
+ },
167
+ {
168
+ "pinId": "R3.2",
169
+ "x": 5.4,
170
+ "y": 1.5,
171
+ "_facingDirection": "y+"
172
+ }
173
+ ]
174
+ },
175
+ {
176
+ "chipId": "schematic_component_6",
177
+ "center": {
178
+ "x": -2.6774999999999998,
179
+ "y": -1.3
180
+ },
181
+ "width": 1.1450000000000005,
182
+ "height": 0.7599999999999998,
183
+ "pins": [
184
+ {
185
+ "pinId": "C2.1",
186
+ "x": -2.8,
187
+ "y": -1.68,
188
+ "_facingDirection": "y-"
189
+ },
190
+ {
191
+ "pinId": "C2.2",
192
+ "x": -2.8,
193
+ "y": -0.9200000000000002,
194
+ "_facingDirection": "y+"
195
+ }
196
+ ]
197
+ },
198
+ {
199
+ "chipId": "schematic_component_7",
200
+ "center": {
201
+ "x": -3.6774999999999998,
202
+ "y": -1.3
203
+ },
204
+ "width": 1.1450000000000005,
205
+ "height": 0.7599999999999998,
206
+ "pins": [
207
+ {
208
+ "pinId": "C1.1",
209
+ "x": -3.8,
210
+ "y": -1.68,
211
+ "_facingDirection": "y-"
212
+ },
213
+ {
214
+ "pinId": "C1.2",
215
+ "x": -3.8,
216
+ "y": -0.9200000000000002,
217
+ "_facingDirection": "y+"
218
+ }
219
+ ]
220
+ },
221
+ {
222
+ "chipId": "schematic_component_8",
223
+ "center": {
224
+ "x": -7,
225
+ "y": 1
226
+ },
227
+ "width": 0.5549999999999997,
228
+ "height": 0.8999999999999999,
229
+ "pins": [
230
+ {
231
+ "pinId": "SJ3.1",
232
+ "x": -7.1,
233
+ "y": 0.55,
234
+ "_facingDirection": "y-"
235
+ },
236
+ {
237
+ "pinId": "SJ3.2",
238
+ "x": -6.7225,
239
+ "y": 1,
240
+ "_facingDirection": "x+"
241
+ },
242
+ {
243
+ "pinId": "SJ3.3",
244
+ "x": -7.1,
245
+ "y": 1.45,
246
+ "_facingDirection": "y+"
247
+ }
248
+ ]
249
+ },
250
+ {
251
+ "chipId": "schematic_component_9",
252
+ "center": {
253
+ "x": -6.945,
254
+ "y": 2.3
255
+ },
256
+ "width": 1.21,
257
+ "height": 0.6000000000000001,
258
+ "pins": [
259
+ {
260
+ "pinId": "R4.1",
261
+ "x": -7.1,
262
+ "y": 1.9999999999999998
263
+ },
264
+ {
265
+ "pinId": "R4.2",
266
+ "x": -7.1,
267
+ "y": 2.5999999999999996
268
+ }
269
+ ]
270
+ },
271
+ {
272
+ "chipId": "schematic_component_10",
273
+ "center": {
274
+ "x": -9,
275
+ "y": -6
276
+ },
277
+ "width": 1.3999999999999986,
278
+ "height": 1,
279
+ "pins": [
280
+ {
281
+ "pinId": "JP1.1",
282
+ "x": -8.3,
283
+ "y": -6.3
284
+ },
285
+ {
286
+ "pinId": "JP1.2",
287
+ "x": -8.3,
288
+ "y": -6.1
289
+ },
290
+ {
291
+ "pinId": "JP1.3",
292
+ "x": -8.3,
293
+ "y": -5.9
294
+ },
295
+ {
296
+ "pinId": "JP1.4",
297
+ "x": -8.3,
298
+ "y": -5.7
299
+ }
300
+ ]
301
+ },
302
+ {
303
+ "chipId": "schematic_component_11",
304
+ "center": {
305
+ "x": -4,
306
+ "y": -6
307
+ },
308
+ "width": 1.4000000000000004,
309
+ "height": 1.4000000000000004,
310
+ "pins": [
311
+ {
312
+ "pinId": "JP2.1",
313
+ "x": -3.3,
314
+ "y": -6.5
315
+ },
316
+ {
317
+ "pinId": "JP2.2",
318
+ "x": -3.3,
319
+ "y": -6.3
320
+ },
321
+ {
322
+ "pinId": "JP2.3",
323
+ "x": -3.3,
324
+ "y": -6.1
325
+ },
326
+ {
327
+ "pinId": "JP2.4",
328
+ "x": -3.3,
329
+ "y": -5.9
330
+ },
331
+ {
332
+ "pinId": "JP2.5",
333
+ "x": -3.3,
334
+ "y": -5.7
335
+ },
336
+ {
337
+ "pinId": "JP2.6",
338
+ "x": -3.3,
339
+ "y": -5.5
340
+ }
341
+ ]
342
+ }
343
+ ],
344
+ "directConnections": [
345
+ {
346
+ "pinIds": [
347
+ "R1.1",
348
+ "U1.6"
349
+ ],
350
+ "netId": ".R1 > .pin1 to .U1 > .pin6"
351
+ },
352
+ {
353
+ "pinIds": [
354
+ "SJ1.1",
355
+ "R2.2"
356
+ ],
357
+ "netId": ".SJ1 > .pin1 to .R2 > .pin2"
358
+ },
359
+ {
360
+ "pinIds": [
361
+ "SJ1.3",
362
+ "R1.2"
363
+ ],
364
+ "netId": ".SJ1 > .pin3 to .R1 > .pin2"
365
+ },
366
+ {
367
+ "pinIds": [
368
+ "R2.1",
369
+ "U1.5"
370
+ ],
371
+ "netId": ".R2 > .pin1 to .U1 > .pin5"
372
+ },
373
+ {
374
+ "pinIds": [
375
+ "SJ2.1",
376
+ "R3.2"
377
+ ],
378
+ "netId": ".SJ2 > .pin1 to .R3 > .pin2"
379
+ },
380
+ {
381
+ "pinIds": [
382
+ "R3.1",
383
+ "U1.7"
384
+ ],
385
+ "netId": ".R3 > .pin1 to .U1 > .pin7"
386
+ },
387
+ {
388
+ "pinIds": [
389
+ "SJ3.3",
390
+ "R4.1"
391
+ ],
392
+ "netId": ".SJ3 > .pin3 to .R4 > .pin1"
393
+ }
394
+ ],
395
+ "netConnections": [
396
+ {
397
+ "netId": "V3_3",
398
+ "pinIds": [
399
+ "U1.1",
400
+ "U1.3",
401
+ "SJ1.2",
402
+ "SJ2.2",
403
+ "C2.2",
404
+ "C1.2",
405
+ "R4.2",
406
+ "JP1.2",
407
+ "JP2.5"
408
+ ],
409
+ "netLabelWidth": 0.42,
410
+ "netLabelHeight": 0.6
411
+ },
412
+ {
413
+ "netId": "GND",
414
+ "pinIds": [
415
+ "U1.2",
416
+ "U1.8",
417
+ "C2.1",
418
+ "C1.1",
419
+ "SJ3.1",
420
+ "JP1.1",
421
+ "JP2.6"
422
+ ],
423
+ "netLabelWidth": 0.42,
424
+ "netLabelHeight": 0.48
425
+ },
426
+ {
427
+ "netId": "SDD_ADR",
428
+ "pinIds": [
429
+ "U1.4",
430
+ "SJ3.2"
431
+ ],
432
+ "netLabelWidth": 0.96
433
+ },
434
+ {
435
+ "netId": "SCK_SCL",
436
+ "pinIds": [
437
+ "U1.5",
438
+ "R2.1",
439
+ "JP1.4",
440
+ "JP2.4"
441
+ ],
442
+ "netLabelWidth": 0.96
443
+ },
444
+ {
445
+ "netId": "SDI_SDA",
446
+ "pinIds": [
447
+ "U1.6",
448
+ "R1.1",
449
+ "JP1.3",
450
+ "JP2.2"
451
+ ],
452
+ "netLabelWidth": 0.96
453
+ },
454
+ {
455
+ "netId": "N_CS",
456
+ "pinIds": [
457
+ "U1.7",
458
+ "R3.1",
459
+ "JP2.1"
460
+ ],
461
+ "netLabelWidth": 0.6
462
+ },
463
+ {
464
+ "netId": "SDO_ADR",
465
+ "pinIds": [
466
+ "JP2.3"
467
+ ],
468
+ "netLabelWidth": 0.96
469
+ }
470
+ ],
471
+ "textBoxes": [
472
+ {
473
+ "chipId": "schematic_component_0",
474
+ "center": {
475
+ "x": -0.54,
476
+ "y": -0.93
477
+ },
478
+ "width": 0.72,
479
+ "height": 0.17999999999999994,
480
+ "text": "BME280"
481
+ },
482
+ {
483
+ "chipId": "schematic_component_0",
484
+ "center": {
485
+ "x": -0.78,
486
+ "y": 0.915
487
+ },
488
+ "width": 0.3599999999999999,
489
+ "height": 0.25,
490
+ "text": "U1"
491
+ },
492
+ {
493
+ "chipId": "schematic_component_10",
494
+ "center": {
495
+ "x": -9.120000000000001,
496
+ "y": -5.385
497
+ },
498
+ "width": 0.4800000000000004,
499
+ "height": 0.2499999999999991,
500
+ "text": "JP1"
501
+ },
502
+ {
503
+ "chipId": "schematic_component_11",
504
+ "center": {
505
+ "x": -4.119999999999999,
506
+ "y": -5.1850000000000005
507
+ },
508
+ "width": 0.47999999999999954,
509
+ "height": 0.2499999999999991,
510
+ "text": "JP2"
511
+ }
512
+ ],
513
+ "availableNetLabelOrientations": {
514
+ "GND": [
515
+ "y-"
516
+ ],
517
+ "N_CS": [
518
+ "x-",
519
+ "x+"
520
+ ],
521
+ "SDI_SDA": [
522
+ "x-",
523
+ "x+"
524
+ ],
525
+ "SCK_SCL": [
526
+ "x-",
527
+ "x+"
528
+ ],
529
+ "V3_3": [
530
+ "y+"
531
+ ],
532
+ "SDD_ADR": [
533
+ "x-",
534
+ "x+"
535
+ ],
536
+ "SDO_ADR": [
537
+ "x-",
538
+ "x+"
539
+ ]
540
+ },
541
+ "maxMspPairDistance": 2.4,
542
+ "_hideRatsNet": false
543
+ }
@@ -0,0 +1,12 @@
1
+ import { expect, test } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import inputProblem from "./bug-report-20260717T022934Z.json"
4
+ import "tests/fixtures/matcher"
5
+
6
+ test("bug-report-20260717T022934Z", () => {
7
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
8
+
9
+ solver.solve()
10
+
11
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
12
+ })
@@ -0,0 +1,48 @@
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="-2.275,-2.5 -2.275,-3.5" data-type="line" data-label="" points="412.47706422018337,222.3853211009175 412.47706422018337,479.26605504587155" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.275,-2.5 -2.0749999999999997,-2.5 -2.0749999999999997,-3.5 -2.275,-3.5" data-type="line" data-label="" points="412.47706422018337,222.3853211009175 463.8532110091743,222.3853211009175 463.8532110091743,479.26605504587155 412.47706422018337,479.26605504587155" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.0749999999999997,-2.5 -1.7849999999999997,-2.5 -1.7849999999999997,-2.501" data-type="line" data-label="" points="463.8532110091743,222.3853211009175 538.3486238532109,222.3853211009175 538.3486238532109,222.64220183486248" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-3" data-y="-2.5" x="40" y="171.0091743119267" width="372.47706422018337" height="102.75229357798162" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.003892857142857144"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="-3" data-y="-3.5" x="40" y="427.88990825688074" width="372.47706422018337" height="102.75229357798162" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.003892857142857144"/></g><g><rect data-type="rect" data-label="J3" data-x="-3.205" data-y="-2.1849999999999996" x="127.3394495412843" y="109.35779816513764" width="92.47706422018348" height="64.22018348623851" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.003892857142857144"/></g><g><rect data-type="rect" data-label="J4" data-x="-3.205" data-y="-3.1849999999999996" x="127.3394495412843" y="366.2385321100917" width="92.47706422018348" height="64.22018348623851" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.003892857142857144"/></g><g><rect data-type="rect" data-label="netId: GND
2
+ globalConnNetId: connectivity_net0" data-x="-1.7849999999999997" data-y="-2.711" x="476.697247706422" y="222.64220183486242" width="123.3027522935779" height="107.88990825688063" fill="#00000066" stroke="#000000" stroke-width="0.003892857142857144"/></g><g><circle data-type="point" data-label="J3.1
3
+ x+" data-x="-2.275" data-y="-2.5" cx="412.47706422018337" cy="222.3853211009175" r="3" fill="hsl(340, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="J4.1
4
+ x+" data-x="-2.275" data-y="-3.5" cx="412.47706422018337" cy="479.26605504587155" r="3" fill="hsl(221, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
5
+ orientation: y-" data-x="-1.7849999999999997" data-y="-2.501" cx="538.3486238532109" cy="222.64220183486248" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g id="crosshair" style="display: none"><line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5"/><line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5"/><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text></g><script><![CDATA[
6
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
7
+ const svg = e.currentTarget;
8
+ const rect = svg.getBoundingClientRect();
9
+ const x = e.clientX - rect.left;
10
+ const y = e.clientY - rect.top;
11
+ const crosshair = svg.getElementById('crosshair');
12
+ const h = svg.getElementById('crosshair-h');
13
+ const v = svg.getElementById('crosshair-v');
14
+ const coords = svg.getElementById('coordinates');
15
+
16
+ crosshair.style.display = 'block';
17
+ h.setAttribute('x1', '0');
18
+ h.setAttribute('x2', '640');
19
+ h.setAttribute('y1', y);
20
+ h.setAttribute('y2', y);
21
+ v.setAttribute('x1', x);
22
+ v.setAttribute('x2', x);
23
+ v.setAttribute('y1', '0');
24
+ v.setAttribute('y2', '640');
25
+
26
+ // Calculate real coordinates using inverse transformation
27
+ const matrix = {"a":256.88073394495405,"c":0,"e":996.8807339449538,"b":0,"d":-256.88073394495405,"f":-419.8165137614676};
28
+ // Manually invert and apply the affine transform
29
+ // Since we only use translate and scale, we can directly compute:
30
+ // x' = (x - tx) / sx
31
+ // y' = (y - ty) / sy
32
+ const sx = matrix.a;
33
+ const sy = matrix.d;
34
+ const tx = matrix.e;
35
+ const ty = matrix.f;
36
+ const realPoint = {
37
+ x: (x - tx) / sx,
38
+ y: (y - ty) / sy // Flip y back since we used negative scale
39
+ }
40
+
41
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
42
+ coords.setAttribute('x', (x + 5).toString());
43
+ coords.setAttribute('y', (y - 5).toString());
44
+ });
45
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
46
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
47
+ });
48
+ ]]></script></svg>
@@ -0,0 +1,77 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": -3,
7
+ "y": -2.5
8
+ },
9
+ "width": 1.4500000000000002,
10
+ "height": 0.40000000000000036,
11
+ "pins": [
12
+ {
13
+ "pinId": "J3.1",
14
+ "x": -2.275,
15
+ "y": -2.5
16
+ }
17
+ ]
18
+ },
19
+ {
20
+ "chipId": "schematic_component_1",
21
+ "center": {
22
+ "x": -3,
23
+ "y": -3.5
24
+ },
25
+ "width": 1.4500000000000002,
26
+ "height": 0.40000000000000036,
27
+ "pins": [
28
+ {
29
+ "pinId": "J4.1",
30
+ "x": -2.275,
31
+ "y": -3.5
32
+ }
33
+ ]
34
+ }
35
+ ],
36
+ "directConnections": [],
37
+ "netConnections": [
38
+ {
39
+ "netId": "GND",
40
+ "pinIds": [
41
+ "J3.1",
42
+ "J4.1"
43
+ ],
44
+ "netLabelWidth": 0.42,
45
+ "netLabelHeight": 0.48
46
+ }
47
+ ],
48
+ "textBoxes": [
49
+ {
50
+ "chipId": "schematic_component_0",
51
+ "center": {
52
+ "x": -3.205,
53
+ "y": -2.1849999999999996
54
+ },
55
+ "width": 0.3600000000000003,
56
+ "height": 0.24999999999999956,
57
+ "text": "J3"
58
+ },
59
+ {
60
+ "chipId": "schematic_component_1",
61
+ "center": {
62
+ "x": -3.205,
63
+ "y": -3.1849999999999996
64
+ },
65
+ "width": 0.3600000000000003,
66
+ "height": 0.24999999999999956,
67
+ "text": "J4"
68
+ }
69
+ ],
70
+ "availableNetLabelOrientations": {
71
+ "GND": [
72
+ "y-"
73
+ ]
74
+ },
75
+ "maxMspPairDistance": 2.4,
76
+ "_hideRatsNet": false
77
+ }
@@ -0,0 +1,12 @@
1
+ import { expect, test } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import inputProblem from "./bug-report-20260717T031704Z.json"
4
+ import "tests/fixtures/matcher"
5
+
6
+ test("bug-report-20260717T031704Z", () => {
7
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
8
+
9
+ solver.solve()
10
+
11
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
12
+ })