@tscircuit/rectdiff 0.0.20 → 0.0.21

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 (107) hide show
  1. package/.github/workflows/bun-test.yml +1 -1
  2. package/package.json +1 -1
  3. package/tests/solver/both-points-equivalent/__snapshots__/both-points-equivalent.snap.svg +44 -0
  4. package/tests/solver/both-points-equivalent/both-points-equivalent.srj.json +64 -0
  5. package/tests/solver/both-points-equivalent/both-points-equivalent.test.ts +92 -0
  6. package/tests/solver/bugreport01-be84eb/__snapshots__/bugreport01-be84eb.snap.svg +44 -0
  7. package/tests/solver/bugreport01-be84eb/bugreport01-be84eb.json +929 -0
  8. package/tests/solver/bugreport01-be84eb/bugreport01-be84eb.test.ts +93 -0
  9. package/tests/solver/bugreport02-bc4361/__snapshots__/bugreport02-bc4361.snap.svg +44 -0
  10. package/tests/solver/bugreport02-bc4361/bugreport02-bc4361.json +1276 -0
  11. package/tests/solver/bugreport02-bc4361/bugreport02-bc4361.test.ts +93 -0
  12. package/tests/solver/bugreport03-fe4a17/__snapshots__/bugreport03-fe4a17.snap.svg +44 -0
  13. package/tests/solver/bugreport03-fe4a17/bugreport03-fe4a17.json +986 -0
  14. package/tests/solver/bugreport03-fe4a17/bugreport03-fe4a17.test.ts +93 -0
  15. package/tests/solver/bugreport07-d3f3be/__snapshots__/bugreport07-d3f3be.snap.svg +44 -0
  16. package/tests/solver/bugreport07-d3f3be/bugreport07-d3f3be.json +1211 -0
  17. package/tests/solver/bugreport07-d3f3be/bugreport07-d3f3be.test.ts +93 -0
  18. package/tests/solver/bugreport08-e3ec95/__snapshots__/bugreport08-e3ec95.snap.svg +44 -0
  19. package/tests/solver/bugreport08-e3ec95/bugreport08-e3ec95.json +1511 -0
  20. package/tests/solver/bugreport08-e3ec95/bugreport08-e3ec95.test.ts +93 -0
  21. package/tests/solver/bugreport09-618e09/__snapshots__/bugreport09-618e09.snap.svg +44 -0
  22. package/tests/solver/bugreport09-618e09/bugreport09-618e09.json +2827 -0
  23. package/tests/solver/bugreport09-618e09/bugreport09-618e09.test.ts +93 -0
  24. package/tests/solver/bugreport10-71239a/__snapshots__/bugreport10-71239a.snap.svg +44 -0
  25. package/tests/solver/bugreport10-71239a/bugreport10-71239a.json +890 -0
  26. package/tests/solver/bugreport10-71239a/bugreport10-71239a.test.ts +93 -0
  27. package/tests/solver/bugreport11-b2de3c/__snapshots__/bugreport11-b2de3c.snap.svg +44 -0
  28. package/tests/solver/bugreport11-b2de3c/bugreport11-b2de3c.json +4315 -0
  29. package/tests/solver/bugreport11-b2de3c/bugreport11-b2de3c.test.ts +93 -0
  30. package/tests/solver/bugreport12-35ce1c/__snapshots__/bugreport12-35ce1c.snap.svg +44 -0
  31. package/tests/solver/bugreport12-35ce1c/bugreport12-35ce1c.json +475 -0
  32. package/tests/solver/bugreport12-35ce1c/bugreport12-35ce1c.test.ts +93 -0
  33. package/tests/solver/bugreport13-b9a758/__snapshots__/bugreport13-b9a758.snap.svg +44 -0
  34. package/tests/solver/bugreport13-b9a758/bugreport13-b9a758.json +15815 -0
  35. package/tests/solver/bugreport13-b9a758/bugreport13-b9a758.test.ts +93 -0
  36. package/tests/solver/bugreport16-d95f38/__snapshots__/bugreport16-d95f38.snap.svg +44 -0
  37. package/tests/solver/bugreport16-d95f38/bugreport16-d95f38.json +623 -0
  38. package/tests/solver/bugreport16-d95f38/bugreport16-d95f38.test.ts +93 -0
  39. package/tests/solver/bugreport18-1b2d06/__snapshots__/bugreport18-1b2d06.snap.svg +44 -0
  40. package/tests/solver/bugreport18-1b2d06/bugreport18-1b2d06.json +543 -0
  41. package/tests/solver/bugreport18-1b2d06/bugreport18-1b2d06.test.ts +93 -0
  42. package/tests/solver/bugreport19/__snapshots__/bugreport19.snap.svg +44 -0
  43. package/tests/solver/bugreport19/bugreport19.json +678 -0
  44. package/tests/solver/bugreport19/bugreport19.test.ts +93 -0
  45. package/tests/solver/bugreport20-obstacle-clipping/__snapshots__/bugreport20-obstacle-clipping.snap.svg +44 -0
  46. package/tests/solver/bugreport20-obstacle-clipping/bugreport20-obstacle-clipping.json +109 -0
  47. package/tests/solver/bugreport20-obstacle-clipping/bugreport20-obstacle-clipping.test.ts +93 -0
  48. package/tests/solver/bugreport21-board-outline/__snapshots__/bugreport21-board-outline.snap.svg +44 -0
  49. package/tests/solver/bugreport21-board-outline/bugreport21-board-outline.json +148 -0
  50. package/tests/solver/bugreport21-board-outline/bugreport21-board-outline.test.ts +93 -0
  51. package/tests/solver/bugreport22-2a75ce/__snapshots__/bugreport22-2a75ce.snap.svg +44 -0
  52. package/tests/solver/bugreport22-2a75ce/bugreport22-2a75ce.json +1550 -0
  53. package/tests/solver/bugreport22-2a75ce/bugreport22-2a75ce.test.ts +93 -0
  54. package/tests/solver/bugreport23-LGA15x4/__snapshots__/bugreport23-LGA15x4.snap.svg +44 -0
  55. package/tests/solver/bugreport23-LGA15x4/bugreport23-LGA15x4.srj.json +2401 -0
  56. package/tests/solver/bugreport23-LGA15x4/bugreport23-LGA15x4.test.ts +92 -0
  57. package/tests/solver/bugreport24-05597c/__snapshots__/bugreport24-05597c.snap.svg +44 -0
  58. package/tests/solver/bugreport24-05597c/bugreport24-05597c.json +8427 -0
  59. package/tests/solver/bugreport24-05597c/bugreport24-05597c.test.ts +93 -0
  60. package/tests/solver/bugreport25-4b1d55/__snapshots__/bugreport25-4b1d55.snap.svg +44 -0
  61. package/tests/solver/bugreport25-4b1d55/bugreport25-4b1d55.json +119 -0
  62. package/tests/solver/bugreport25-4b1d55/bugreport25-4b1d55.test.ts +93 -0
  63. package/tests/solver/bugreport26-66b0b2/__snapshots__/bugreport26-66b0b2.snap.svg +44 -0
  64. package/tests/solver/bugreport26-66b0b2/bugreport26-66b0b2.json +1651 -0
  65. package/tests/solver/bugreport26-66b0b2/bugreport26-66b0b2.test.ts +93 -0
  66. package/tests/solver/bugreport27-dd3734/__snapshots__/bugreport27-dd3734.snap.svg +44 -0
  67. package/tests/solver/bugreport27-dd3734/bugreport27-dd3734.json +4116 -0
  68. package/tests/solver/bugreport27-dd3734/bugreport27-dd3734.test.ts +93 -0
  69. package/tests/solver/bugreport28-18a9ef/__snapshots__/bugreport28-18a9ef.snap.svg +44 -0
  70. package/tests/solver/bugreport28-18a9ef/bugreport28-18a9ef.json +4116 -0
  71. package/tests/solver/bugreport28-18a9ef/bugreport28-18a9ef.test.ts +93 -0
  72. package/tests/solver/bugreport29-7deae8/__snapshots__/bugreport29-7deae8.snap.svg +44 -0
  73. package/tests/solver/bugreport29-7deae8/bugreport29-7deae8.json +4118 -0
  74. package/tests/solver/bugreport29-7deae8/bugreport29-7deae8.test.ts +93 -0
  75. package/tests/solver/bugreport30-2174c8/__snapshots__/bugreport30-2174c8.snap.svg +44 -0
  76. package/tests/solver/bugreport30-2174c8/bugreport30-2174c8.json +4007 -0
  77. package/tests/solver/bugreport30-2174c8/bugreport30-2174c8.test.ts +93 -0
  78. package/tests/solver/bugreport33-213d45/__snapshots__/bugreport33-213d45.snap.svg +44 -0
  79. package/tests/solver/bugreport33-213d45/bugreport33-213d45.json +5089 -0
  80. package/tests/solver/bugreport33-213d45/bugreport33-213d45.test.ts +93 -0
  81. package/tests/solver/bugreport34-e9dea2/__snapshots__/bugreport34-e9dea2.snap.svg +44 -0
  82. package/tests/solver/bugreport34-e9dea2/bugreport34-e9dea2.json +3924 -0
  83. package/tests/solver/bugreport34-e9dea2/bugreport34-e9dea2.test.ts +93 -0
  84. package/tests/solver/bugreport35-191db9/__snapshots__/bugreport35-191db9.snap.svg +44 -0
  85. package/tests/solver/bugreport35-191db9/bugreport35-191db9.json +4237 -0
  86. package/tests/solver/bugreport35-191db9/bugreport35-191db9.test.ts +93 -0
  87. package/tests/solver/bugreport36-bf8303/__snapshots__/bugreport36-bf8303.snap.svg +44 -0
  88. package/tests/solver/bugreport36-bf8303/bugreport36-bf8303.json +29660 -0
  89. package/tests/solver/bugreport36-bf8303/bugreport36-bf8303.test.ts +93 -0
  90. package/tests/solver/interaction/__snapshots__/interaction.snap.svg +44 -0
  91. package/tests/solver/interaction/interaction.srj.json +58 -0
  92. package/tests/solver/interaction/interaction.test.ts +92 -0
  93. package/tests/solver/multi-point/__snapshots__/multi-point.snap.svg +44 -0
  94. package/tests/solver/multi-point/multi-point.srj.json +57 -0
  95. package/tests/solver/multi-point/multi-point.test.ts +92 -0
  96. package/tests/solver/no-better-path/__snapshots__/no-better-path.snap.svg +44 -0
  97. package/tests/solver/no-better-path/no-better-path.srj.json +48 -0
  98. package/tests/solver/no-better-path/no-better-path.test.ts +92 -0
  99. package/tests/solver/offboardconnects01/__snapshots__/offboardconnects01.snap.svg +44 -0
  100. package/tests/solver/offboardconnects01/offboardconnects01.srj.json +53 -0
  101. package/tests/solver/offboardconnects01/offboardconnects01.test.ts +92 -0
  102. package/tests/solver/pcb_trace_id-should-return-root-connection-name/__snapshots__/pcb_trace_id-should-return-root-connection-name.snap.svg +44 -0
  103. package/tests/solver/pcb_trace_id-should-return-root-connection-name/pcb_trace_id-should-return-root-connection-name.srj.json +129 -0
  104. package/tests/solver/pcb_trace_id-should-return-root-connection-name/pcb_trace_id-should-return-root-connection-name.test.ts +92 -0
  105. package/tests/solver/transitivity/__snapshots__/transitivity.snap.svg +44 -0
  106. package/tests/solver/transitivity/transitivity.srj.json +64 -0
  107. package/tests/solver/transitivity/transitivity.test.ts +92 -0
@@ -0,0 +1,543 @@
1
+ {
2
+ "autorouting_bug_report_id": "1b2d06c6-2714-4a78-bc86-32618e70a873",
3
+ "reporter_account_id": "9f398687-69d0-4ef4-a48c-bb6dc990e7df",
4
+ "package_id": null,
5
+ "title": "<board#13383 />",
6
+ "simple_route_json": {
7
+ "bounds": {
8
+ "maxX": 5.8100000000000005,
9
+ "maxY": 5.8100000000000005,
10
+ "minX": -5.8100000000000005,
11
+ "minY": -5.8100000000000005
12
+ },
13
+ "obstacles": [
14
+ {
15
+ "type": "oval",
16
+ "width": 1.6,
17
+ "center": {
18
+ "x": -3.81,
19
+ "y": 3.81
20
+ },
21
+ "height": 1.6,
22
+ "layers": ["top", "inner1", "inner2", "bottom"],
23
+ "connectedTo": [
24
+ "pcb_plated_hole_0",
25
+ "connectivity_net30",
26
+ "source_trace_11",
27
+ "source_port_11",
28
+ "source_trace_0",
29
+ "source_port_0",
30
+ "source_net_0",
31
+ "pcb_plated_hole_0",
32
+ "pcb_port_0",
33
+ "pcb_plated_hole_11",
34
+ "pcb_port_11"
35
+ ]
36
+ },
37
+ {
38
+ "type": "oval",
39
+ "width": 1.6,
40
+ "center": {
41
+ "x": -1.27,
42
+ "y": 3.81
43
+ },
44
+ "height": 1.6,
45
+ "layers": ["top", "inner1", "inner2", "bottom"],
46
+ "connectedTo": [
47
+ "pcb_plated_hole_1",
48
+ "connectivity_net28",
49
+ "source_trace_10",
50
+ "source_port_10",
51
+ "source_trace_1",
52
+ "source_port_1",
53
+ "source_net_1",
54
+ "pcb_plated_hole_1",
55
+ "pcb_port_1",
56
+ "pcb_plated_hole_10",
57
+ "pcb_port_10"
58
+ ]
59
+ },
60
+ {
61
+ "type": "oval",
62
+ "width": 1.6,
63
+ "center": {
64
+ "x": 1.27,
65
+ "y": 3.81
66
+ },
67
+ "height": 1.6,
68
+ "layers": ["top", "inner1", "inner2", "bottom"],
69
+ "connectedTo": [
70
+ "pcb_plated_hole_2",
71
+ "connectivity_net12",
72
+ "source_trace_4",
73
+ "source_port_4",
74
+ "source_trace_2",
75
+ "source_port_2",
76
+ "source_net_2",
77
+ "pcb_plated_hole_2",
78
+ "pcb_port_2",
79
+ "pcb_plated_hole_4",
80
+ "pcb_port_4"
81
+ ]
82
+ },
83
+ {
84
+ "type": "oval",
85
+ "width": 1.6,
86
+ "center": {
87
+ "x": 3.81,
88
+ "y": 3.81
89
+ },
90
+ "height": 1.6,
91
+ "layers": ["top", "inner1", "inner2", "bottom"],
92
+ "connectedTo": [
93
+ "pcb_plated_hole_3",
94
+ "connectivity_net14",
95
+ "source_trace_5",
96
+ "source_port_5",
97
+ "source_trace_3",
98
+ "source_port_3",
99
+ "source_net_3",
100
+ "pcb_plated_hole_3",
101
+ "pcb_port_3",
102
+ "pcb_plated_hole_5",
103
+ "pcb_port_5"
104
+ ]
105
+ },
106
+ {
107
+ "type": "oval",
108
+ "width": 1.6,
109
+ "center": {
110
+ "x": -3.81,
111
+ "y": 1.27
112
+ },
113
+ "height": 1.6,
114
+ "layers": ["top", "inner1", "inner2", "bottom"],
115
+ "connectedTo": [
116
+ "pcb_plated_hole_4",
117
+ "connectivity_net12",
118
+ "source_trace_4",
119
+ "source_port_4",
120
+ "source_trace_2",
121
+ "source_port_2",
122
+ "source_net_2",
123
+ "pcb_plated_hole_2",
124
+ "pcb_port_2",
125
+ "pcb_plated_hole_4",
126
+ "pcb_port_4"
127
+ ]
128
+ },
129
+ {
130
+ "type": "oval",
131
+ "width": 1.6,
132
+ "center": {
133
+ "x": -1.27,
134
+ "y": 1.27
135
+ },
136
+ "height": 1.6,
137
+ "layers": ["top", "inner1", "inner2", "bottom"],
138
+ "connectedTo": [
139
+ "pcb_plated_hole_5",
140
+ "connectivity_net14",
141
+ "source_trace_5",
142
+ "source_port_5",
143
+ "source_trace_3",
144
+ "source_port_3",
145
+ "source_net_3",
146
+ "pcb_plated_hole_3",
147
+ "pcb_port_3",
148
+ "pcb_plated_hole_5",
149
+ "pcb_port_5"
150
+ ]
151
+ },
152
+ {
153
+ "type": "oval",
154
+ "width": 1.6,
155
+ "center": {
156
+ "x": 1.27,
157
+ "y": 1.27
158
+ },
159
+ "height": 1.6,
160
+ "layers": ["top", "inner1", "inner2", "bottom"],
161
+ "connectedTo": [
162
+ "pcb_plated_hole_6",
163
+ "connectivity_net38",
164
+ "source_trace_15",
165
+ "source_port_15",
166
+ "source_trace_6",
167
+ "source_port_6",
168
+ "source_net_4",
169
+ "pcb_plated_hole_6",
170
+ "pcb_port_6",
171
+ "pcb_plated_hole_15",
172
+ "pcb_port_15"
173
+ ]
174
+ },
175
+ {
176
+ "type": "oval",
177
+ "width": 1.6,
178
+ "center": {
179
+ "x": 3.81,
180
+ "y": 1.27
181
+ },
182
+ "height": 1.6,
183
+ "layers": ["top", "inner1", "inner2", "bottom"],
184
+ "connectedTo": [
185
+ "pcb_plated_hole_7",
186
+ "connectivity_net34",
187
+ "source_trace_13",
188
+ "source_port_13",
189
+ "source_trace_7",
190
+ "source_port_7",
191
+ "source_net_5",
192
+ "pcb_plated_hole_7",
193
+ "pcb_port_7",
194
+ "pcb_plated_hole_13",
195
+ "pcb_port_13"
196
+ ]
197
+ },
198
+ {
199
+ "type": "oval",
200
+ "width": 1.6,
201
+ "center": {
202
+ "x": -3.81,
203
+ "y": -1.27
204
+ },
205
+ "height": 1.6,
206
+ "layers": ["top", "inner1", "inner2", "bottom"],
207
+ "connectedTo": [
208
+ "pcb_plated_hole_8",
209
+ "connectivity_net36",
210
+ "source_trace_14",
211
+ "source_port_14",
212
+ "source_trace_8",
213
+ "source_port_8",
214
+ "source_net_6",
215
+ "pcb_plated_hole_8",
216
+ "pcb_port_8",
217
+ "pcb_plated_hole_14",
218
+ "pcb_port_14"
219
+ ]
220
+ },
221
+ {
222
+ "type": "oval",
223
+ "width": 1.6,
224
+ "center": {
225
+ "x": -1.27,
226
+ "y": -1.27
227
+ },
228
+ "height": 1.6,
229
+ "layers": ["top", "inner1", "inner2", "bottom"],
230
+ "connectedTo": [
231
+ "pcb_plated_hole_9",
232
+ "connectivity_net32",
233
+ "source_trace_12",
234
+ "source_port_12",
235
+ "source_trace_9",
236
+ "source_port_9",
237
+ "source_net_7",
238
+ "pcb_plated_hole_9",
239
+ "pcb_port_9",
240
+ "pcb_plated_hole_12",
241
+ "pcb_port_12"
242
+ ]
243
+ },
244
+ {
245
+ "type": "oval",
246
+ "width": 1.6,
247
+ "center": {
248
+ "x": 1.27,
249
+ "y": -1.27
250
+ },
251
+ "height": 1.6,
252
+ "layers": ["top", "inner1", "inner2", "bottom"],
253
+ "connectedTo": [
254
+ "pcb_plated_hole_10",
255
+ "connectivity_net28",
256
+ "source_trace_10",
257
+ "source_port_10",
258
+ "source_trace_1",
259
+ "source_port_1",
260
+ "source_net_1",
261
+ "pcb_plated_hole_1",
262
+ "pcb_port_1",
263
+ "pcb_plated_hole_10",
264
+ "pcb_port_10"
265
+ ]
266
+ },
267
+ {
268
+ "type": "oval",
269
+ "width": 1.6,
270
+ "center": {
271
+ "x": 3.81,
272
+ "y": -1.27
273
+ },
274
+ "height": 1.6,
275
+ "layers": ["top", "inner1", "inner2", "bottom"],
276
+ "connectedTo": [
277
+ "pcb_plated_hole_11",
278
+ "connectivity_net30",
279
+ "source_trace_11",
280
+ "source_port_11",
281
+ "source_trace_0",
282
+ "source_port_0",
283
+ "source_net_0",
284
+ "pcb_plated_hole_0",
285
+ "pcb_port_0",
286
+ "pcb_plated_hole_11",
287
+ "pcb_port_11"
288
+ ]
289
+ },
290
+ {
291
+ "type": "oval",
292
+ "width": 1.6,
293
+ "center": {
294
+ "x": -3.81,
295
+ "y": -3.81
296
+ },
297
+ "height": 1.6,
298
+ "layers": ["top", "inner1", "inner2", "bottom"],
299
+ "connectedTo": [
300
+ "pcb_plated_hole_12",
301
+ "connectivity_net32",
302
+ "source_trace_12",
303
+ "source_port_12",
304
+ "source_trace_9",
305
+ "source_port_9",
306
+ "source_net_7",
307
+ "pcb_plated_hole_9",
308
+ "pcb_port_9",
309
+ "pcb_plated_hole_12",
310
+ "pcb_port_12"
311
+ ]
312
+ },
313
+ {
314
+ "type": "oval",
315
+ "width": 1.6,
316
+ "center": {
317
+ "x": -1.27,
318
+ "y": -3.81
319
+ },
320
+ "height": 1.6,
321
+ "layers": ["top", "inner1", "inner2", "bottom"],
322
+ "connectedTo": [
323
+ "pcb_plated_hole_13",
324
+ "connectivity_net34",
325
+ "source_trace_13",
326
+ "source_port_13",
327
+ "source_trace_7",
328
+ "source_port_7",
329
+ "source_net_5",
330
+ "pcb_plated_hole_7",
331
+ "pcb_port_7",
332
+ "pcb_plated_hole_13",
333
+ "pcb_port_13"
334
+ ]
335
+ },
336
+ {
337
+ "type": "oval",
338
+ "width": 1.6,
339
+ "center": {
340
+ "x": 1.27,
341
+ "y": -3.81
342
+ },
343
+ "height": 1.6,
344
+ "layers": ["top", "inner1", "inner2", "bottom"],
345
+ "connectedTo": [
346
+ "pcb_plated_hole_14",
347
+ "connectivity_net36",
348
+ "source_trace_14",
349
+ "source_port_14",
350
+ "source_trace_8",
351
+ "source_port_8",
352
+ "source_net_6",
353
+ "pcb_plated_hole_8",
354
+ "pcb_port_8",
355
+ "pcb_plated_hole_14",
356
+ "pcb_port_14"
357
+ ]
358
+ },
359
+ {
360
+ "type": "oval",
361
+ "width": 1.6,
362
+ "center": {
363
+ "x": 3.81,
364
+ "y": -3.81
365
+ },
366
+ "height": 1.6,
367
+ "layers": ["top", "inner1", "inner2", "bottom"],
368
+ "connectedTo": [
369
+ "pcb_plated_hole_15",
370
+ "connectivity_net38",
371
+ "source_trace_15",
372
+ "source_port_15",
373
+ "source_trace_6",
374
+ "source_port_6",
375
+ "source_net_4",
376
+ "pcb_plated_hole_6",
377
+ "pcb_port_6",
378
+ "pcb_plated_hole_15",
379
+ "pcb_port_15"
380
+ ]
381
+ }
382
+ ],
383
+ "layerCount": 4,
384
+ "connections": [
385
+ {
386
+ "name": "source_net_0",
387
+ "pointsToConnect": [
388
+ {
389
+ "x": -3.81,
390
+ "y": 3.81,
391
+ "layers": ["top", "inner1", "inner2", "bottom"],
392
+ "pointId": "pcb_port_0",
393
+ "pcb_port_id": "pcb_port_0"
394
+ },
395
+ {
396
+ "x": 3.81,
397
+ "y": -1.27,
398
+ "layers": ["top", "inner1", "inner2", "bottom"],
399
+ "pointId": "pcb_port_11",
400
+ "pcb_port_id": "pcb_port_11"
401
+ }
402
+ ]
403
+ },
404
+ {
405
+ "name": "source_net_1",
406
+ "pointsToConnect": [
407
+ {
408
+ "x": -1.27,
409
+ "y": 3.81,
410
+ "layers": ["top", "inner1", "inner2", "bottom"],
411
+ "pointId": "pcb_port_1",
412
+ "pcb_port_id": "pcb_port_1"
413
+ },
414
+ {
415
+ "x": 1.27,
416
+ "y": -1.27,
417
+ "layers": ["top", "inner1", "inner2", "bottom"],
418
+ "pointId": "pcb_port_10",
419
+ "pcb_port_id": "pcb_port_10"
420
+ }
421
+ ]
422
+ },
423
+ {
424
+ "name": "source_net_2",
425
+ "pointsToConnect": [
426
+ {
427
+ "x": 1.27,
428
+ "y": 3.81,
429
+ "layers": ["top", "inner1", "inner2", "bottom"],
430
+ "pointId": "pcb_port_2",
431
+ "pcb_port_id": "pcb_port_2"
432
+ },
433
+ {
434
+ "x": -3.81,
435
+ "y": 1.27,
436
+ "layers": ["top", "inner1", "inner2", "bottom"],
437
+ "pointId": "pcb_port_4",
438
+ "pcb_port_id": "pcb_port_4"
439
+ }
440
+ ]
441
+ },
442
+ {
443
+ "name": "source_net_3",
444
+ "pointsToConnect": [
445
+ {
446
+ "x": 3.81,
447
+ "y": 3.81,
448
+ "layers": ["top", "inner1", "inner2", "bottom"],
449
+ "pointId": "pcb_port_3",
450
+ "pcb_port_id": "pcb_port_3"
451
+ },
452
+ {
453
+ "x": -1.27,
454
+ "y": 1.27,
455
+ "layers": ["top", "inner1", "inner2", "bottom"],
456
+ "pointId": "pcb_port_5",
457
+ "pcb_port_id": "pcb_port_5"
458
+ }
459
+ ]
460
+ },
461
+ {
462
+ "name": "source_net_4",
463
+ "pointsToConnect": [
464
+ {
465
+ "x": 1.27,
466
+ "y": 1.27,
467
+ "layers": ["top", "inner1", "inner2", "bottom"],
468
+ "pointId": "pcb_port_6",
469
+ "pcb_port_id": "pcb_port_6"
470
+ },
471
+ {
472
+ "x": 3.81,
473
+ "y": -3.81,
474
+ "layers": ["top", "inner1", "inner2", "bottom"],
475
+ "pointId": "pcb_port_15",
476
+ "pcb_port_id": "pcb_port_15"
477
+ }
478
+ ]
479
+ },
480
+ {
481
+ "name": "source_net_5",
482
+ "pointsToConnect": [
483
+ {
484
+ "x": 3.81,
485
+ "y": 1.27,
486
+ "layers": ["top", "inner1", "inner2", "bottom"],
487
+ "pointId": "pcb_port_7",
488
+ "pcb_port_id": "pcb_port_7"
489
+ },
490
+ {
491
+ "x": -1.27,
492
+ "y": -3.81,
493
+ "layers": ["top", "inner1", "inner2", "bottom"],
494
+ "pointId": "pcb_port_13",
495
+ "pcb_port_id": "pcb_port_13"
496
+ }
497
+ ]
498
+ },
499
+ {
500
+ "name": "source_net_6",
501
+ "pointsToConnect": [
502
+ {
503
+ "x": -3.81,
504
+ "y": -1.27,
505
+ "layers": ["top", "inner1", "inner2", "bottom"],
506
+ "pointId": "pcb_port_8",
507
+ "pcb_port_id": "pcb_port_8"
508
+ },
509
+ {
510
+ "x": 1.27,
511
+ "y": -3.81,
512
+ "layers": ["top", "inner1", "inner2", "bottom"],
513
+ "pointId": "pcb_port_14",
514
+ "pcb_port_id": "pcb_port_14"
515
+ }
516
+ ]
517
+ },
518
+ {
519
+ "name": "source_net_7",
520
+ "pointsToConnect": [
521
+ {
522
+ "x": -1.27,
523
+ "y": -1.27,
524
+ "layers": ["top", "inner1", "inner2", "bottom"],
525
+ "pointId": "pcb_port_9",
526
+ "pcb_port_id": "pcb_port_9"
527
+ },
528
+ {
529
+ "x": -3.81,
530
+ "y": -3.81,
531
+ "layers": ["top", "inner1", "inner2", "bottom"],
532
+ "pointId": "pcb_port_12",
533
+ "pcb_port_id": "pcb_port_12"
534
+ }
535
+ ]
536
+ }
537
+ ],
538
+ "minTraceWidth": 0.15
539
+ },
540
+ "circuit_json": null,
541
+ "subcircuit_id": null,
542
+ "created_at": "2025-11-27T07:23:27.644Z"
543
+ }
@@ -0,0 +1,93 @@
1
+ import { expect, test } from "bun:test"
2
+ import srj_json from "./bugreport18-1b2d06.json"
3
+ import {
4
+ getBounds,
5
+ getSvgFromGraphicsObject,
6
+ mergeGraphics,
7
+ stackGraphicsVertically,
8
+ type GraphicsObject,
9
+ type Rect,
10
+ } from "graphics-debug"
11
+ import { RectDiffPipeline } from "lib/RectDiffPipeline"
12
+ import { makeCapacityMeshNodeWithLayerInfo } from "tests/fixtures/makeCapacityMeshNodeWithLayerInfo"
13
+ import { makeSimpleRouteOutlineGraphics } from "tests/fixtures/makeSimpleRouteOutlineGraphics"
14
+
15
+ const srj = srj_json.simple_route_json ?? srj_json.simpleRouteJson ?? srj_json
16
+
17
+ test("bugreport18-1b2d06", async () => {
18
+ const solver = new RectDiffPipeline({
19
+ simpleRouteJson: srj,
20
+ })
21
+
22
+ const outline = makeSimpleRouteOutlineGraphics(srj)
23
+
24
+ solver.solve()
25
+
26
+ const { meshNodes } = solver.getOutput()
27
+ const rectsByCombo = makeCapacityMeshNodeWithLayerInfo(meshNodes)
28
+ const allGraphicsObjects: GraphicsObject[] = []
29
+
30
+ for (const z of Array.from({ length: srj.layerCount }, (_, index) => index)) {
31
+ const layerRects: Rect[] = []
32
+
33
+ for (const [key, rects] of rectsByCombo) {
34
+ const layers = key
35
+ .split(",")
36
+ .map((value) => Number.parseInt(value, 10))
37
+ .filter((value) => !Number.isNaN(value))
38
+
39
+ if (layers.includes(z)) {
40
+ layerRects.push(...rects)
41
+ }
42
+ }
43
+
44
+ let labelY = 0
45
+
46
+ if (layerRects.length > 0) {
47
+ let maxY = -Infinity
48
+
49
+ for (const rect of layerRects) {
50
+ const top = rect.center.y + rect.height * (2 / 3)
51
+
52
+ if (top > maxY) maxY = top
53
+ }
54
+
55
+ labelY = maxY
56
+ }
57
+
58
+ const graphics: GraphicsObject = {
59
+ title: `RectDiffPipeline - z${z}`,
60
+ texts: [
61
+ {
62
+ anchorSide: "top_right",
63
+ text: `Layer z=${z}`,
64
+ x: 0,
65
+ y: labelY,
66
+ fontSize: 0.5,
67
+ },
68
+ ],
69
+ coordinateSystem: "cartesian",
70
+ rects: layerRects,
71
+ points: [],
72
+ lines: [],
73
+ }
74
+
75
+ allGraphicsObjects.push(mergeGraphics(graphics, outline))
76
+ }
77
+
78
+ const stackedGraphics = stackGraphicsVertically(allGraphicsObjects)
79
+ const bounds = getBounds(stackedGraphics)
80
+ const boundsWidth = Math.max(1, bounds.maxX - bounds.minX)
81
+ const boundsHeight = Math.max(1, bounds.maxY - bounds.minY)
82
+ const svgWidth = 640
83
+ const svgHeight = Math.max(
84
+ svgWidth,
85
+ Math.ceil((boundsHeight / boundsWidth) * svgWidth),
86
+ )
87
+
88
+ const svg = getSvgFromGraphicsObject(stackedGraphics, {
89
+ svgWidth,
90
+ svgHeight,
91
+ })
92
+ await expect(svg).toMatchSvgSnapshot(import.meta.path)
93
+ })