@tscircuit/schematic-trace-solver 0.0.90 → 0.0.92
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.
- package/dist/index.js +121 -2
- package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2.ts +20 -14
- package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/calculateDirectShortPath.ts +161 -0
- package/lib/solvers/SchematicTracePipelineSolver/correctPinsInsideChip.ts +19 -0
- package/package.json +1 -1
- package/site/bug-reports/bug-report-20260707T230831Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260708T053736Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260708T055430Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260708T095725Z.page.tsx +4 -0
- package/tests/bug-reports/bug-report-20260707T230831Z/__snapshots__/bug-report-20260707T230831Z.snap.svg +88 -0
- package/tests/bug-reports/bug-report-20260707T230831Z/bug-report-20260707T230831Z.json +347 -0
- package/tests/bug-reports/bug-report-20260707T230831Z/bug-report-20260707T230831Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260708T053736Z/__snapshots__/bug-report-20260708T053736Z.snap.svg +52 -0
- package/tests/bug-reports/bug-report-20260708T053736Z/bug-report-20260708T053736Z.json +59 -0
- package/tests/bug-reports/bug-report-20260708T053736Z/bug-report-20260708T053736Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260708T055430Z/__snapshots__/bug-report-20260708T055430Z.snap.svg +88 -0
- package/tests/bug-reports/bug-report-20260708T055430Z/bug-report-20260708T055430Z.json +263 -0
- package/tests/bug-reports/bug-report-20260708T055430Z/bug-report-20260708T055430Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260708T095725Z/__snapshots__/bug-report-20260708T095725Z.snap.svg +87 -0
- package/tests/bug-reports/bug-report-20260708T095725Z/bug-report-20260708T095725Z.json +277 -0
- package/tests/bug-reports/bug-report-20260708T095725Z/bug-report-20260708T095725Z.test.ts +12 -0
- package/tests/repros/__snapshots__/repro-missing-trace-netlabel.snap.svg +62 -0
- package/tests/repros/__snapshots__/repro-netlabel-overlap-trace.snap.svg +60 -0
- package/tests/repros/__snapshots__/repro-rectifier-trace-overlap.snap.svg +58 -0
- package/tests/repros/__snapshots__/small-variant-resistor-facing-direction.snap.svg +86 -0
- package/tests/repros/assets/repro-missing-trace-netlabel.input.json +155 -0
- package/tests/repros/assets/repro-netlabel-overlap-trace.input.json +115 -0
- package/tests/repros/assets/repro-rectifier-trace-overlap.input.json +137 -0
- package/tests/repros/assets/small-variant-resistor-facing-direction.input.json +297 -0
- package/tests/repros/repro-missing-trace-netlabel.test.ts +14 -0
- package/tests/repros/repro-netlabel-overlap-trace.test.ts +14 -0
- package/tests/repros/repro-rectifier-trace-overlap.test.ts +14 -0
- package/tests/repros/small-variant-resistor-facing-direction.test.ts +35 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
{
|
|
2
|
+
"chips": [
|
|
3
|
+
{
|
|
4
|
+
"chipId": "schematic_component_0",
|
|
5
|
+
"center": {
|
|
6
|
+
"x": 0,
|
|
7
|
+
"y": 0
|
|
8
|
+
},
|
|
9
|
+
"width": 3.5999999999999996,
|
|
10
|
+
"height": 6.2,
|
|
11
|
+
"pins": [
|
|
12
|
+
{
|
|
13
|
+
"pinId": "U1.1",
|
|
14
|
+
"x": -1.7999999999999998,
|
|
15
|
+
"y": 0.32499999999999996
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"pinId": "U1.2",
|
|
19
|
+
"x": -1.7999999999999998,
|
|
20
|
+
"y": -0.32500000000000007
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"pinId": "U1.3",
|
|
24
|
+
"x": 1.7999999999999998,
|
|
25
|
+
"y": -0.975
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"pinId": "U1.4",
|
|
29
|
+
"x": 1.7999999999999998,
|
|
30
|
+
"y": -0.32499999999999996
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"pinId": "U1.5",
|
|
34
|
+
"x": 1.7999999999999998,
|
|
35
|
+
"y": 0.32500000000000007
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"pinId": "U1.6",
|
|
39
|
+
"x": 1.7999999999999998,
|
|
40
|
+
"y": 0.975
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"pinId": "U1.7",
|
|
44
|
+
"x": 0.6,
|
|
45
|
+
"y": 3.1
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"pinId": "U1.8",
|
|
49
|
+
"x": -1.7999999999999998,
|
|
50
|
+
"y": -0.975
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"pinId": "U1.9",
|
|
54
|
+
"x": -0.6,
|
|
55
|
+
"y": 3.1
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"pinId": "U1.10",
|
|
59
|
+
"x": -1.7999999999999998,
|
|
60
|
+
"y": 0.975
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"chipId": "schematic_component_1",
|
|
66
|
+
"center": {
|
|
67
|
+
"x": 0,
|
|
68
|
+
"y": 3.1
|
|
69
|
+
},
|
|
70
|
+
"width": 1.055825,
|
|
71
|
+
"height": 0.8677407000000006,
|
|
72
|
+
"pins": [
|
|
73
|
+
{
|
|
74
|
+
"pinId": "L1.1",
|
|
75
|
+
"x": -0.5279125,
|
|
76
|
+
"y": 3.10262455
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"pinId": "L1.2",
|
|
80
|
+
"x": 0.5279125,
|
|
81
|
+
"y": 3.0973754500000004
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"chipId": "schematic_component_2",
|
|
87
|
+
"center": {
|
|
88
|
+
"x": -4.4275,
|
|
89
|
+
"y": -0.35
|
|
90
|
+
},
|
|
91
|
+
"width": 1.0450000000000004,
|
|
92
|
+
"height": 0.76,
|
|
93
|
+
"pins": [
|
|
94
|
+
{
|
|
95
|
+
"pinId": "C1.1",
|
|
96
|
+
"x": -4.5,
|
|
97
|
+
"y": 0.030000000000000027
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"pinId": "C1.2",
|
|
101
|
+
"x": -4.5,
|
|
102
|
+
"y": -0.73
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"chipId": "schematic_component_3",
|
|
108
|
+
"center": {
|
|
109
|
+
"x": 3.4725,
|
|
110
|
+
"y": -0.35
|
|
111
|
+
},
|
|
112
|
+
"width": 1.0450000000000004,
|
|
113
|
+
"height": 0.76,
|
|
114
|
+
"pins": [
|
|
115
|
+
{
|
|
116
|
+
"pinId": "C2.1",
|
|
117
|
+
"x": 3.4,
|
|
118
|
+
"y": 0.030000000000000027
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"pinId": "C2.2",
|
|
122
|
+
"x": 3.4,
|
|
123
|
+
"y": -0.73
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"chipId": "schematic_component_4",
|
|
129
|
+
"center": {
|
|
130
|
+
"x": 2.4050000000000002,
|
|
131
|
+
"y": -0.35
|
|
132
|
+
},
|
|
133
|
+
"width": 1.2100000000000002,
|
|
134
|
+
"height": 0.6,
|
|
135
|
+
"pins": [
|
|
136
|
+
{
|
|
137
|
+
"pinId": "R1.1",
|
|
138
|
+
"x": 2.25,
|
|
139
|
+
"y": -0.04999999999999999
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"pinId": "R1.2",
|
|
143
|
+
"x": 2.25,
|
|
144
|
+
"y": -0.6499999999999999
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"chipId": "schematic_component_5",
|
|
150
|
+
"center": {
|
|
151
|
+
"x": 2.345,
|
|
152
|
+
"y": -2.1
|
|
153
|
+
},
|
|
154
|
+
"width": 1.09,
|
|
155
|
+
"height": 0.6000000000000001,
|
|
156
|
+
"pins": [
|
|
157
|
+
{
|
|
158
|
+
"pinId": "R2.1",
|
|
159
|
+
"x": 2.25,
|
|
160
|
+
"y": -1.8
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"pinId": "R2.2",
|
|
164
|
+
"x": 2.25,
|
|
165
|
+
"y": -2.4000000000000004
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"chipId": "schematic_component_6",
|
|
171
|
+
"center": {
|
|
172
|
+
"x": 1.705,
|
|
173
|
+
"y": 0.8
|
|
174
|
+
},
|
|
175
|
+
"width": 1.21,
|
|
176
|
+
"height": 0.6000000000000001,
|
|
177
|
+
"pins": [
|
|
178
|
+
{
|
|
179
|
+
"pinId": "R3.1",
|
|
180
|
+
"x": 1.55,
|
|
181
|
+
"y": 1.1
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"pinId": "R3.2",
|
|
185
|
+
"x": 1.55,
|
|
186
|
+
"y": 0.5
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"directConnections": [
|
|
192
|
+
{
|
|
193
|
+
"pinIds": [
|
|
194
|
+
"U1.9",
|
|
195
|
+
"L1.1"
|
|
196
|
+
],
|
|
197
|
+
"netId": "U1.L1 to L1.pin1"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"pinIds": [
|
|
201
|
+
"U1.7",
|
|
202
|
+
"L1.2"
|
|
203
|
+
],
|
|
204
|
+
"netId": "U1.L2 to L1.pin2"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"pinIds": [
|
|
208
|
+
"U1.10",
|
|
209
|
+
"C1.1"
|
|
210
|
+
],
|
|
211
|
+
"netId": "U1.VIN to C1.pin1",
|
|
212
|
+
"netLabelWidth": 1.68
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"pinIds": [
|
|
216
|
+
"U1.10",
|
|
217
|
+
"U1.1"
|
|
218
|
+
],
|
|
219
|
+
"netId": "U1.VIN to U1.EN"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"pinIds": [
|
|
223
|
+
"U1.10",
|
|
224
|
+
"R3.1"
|
|
225
|
+
],
|
|
226
|
+
"netId": "U1.VIN to R3.pin1",
|
|
227
|
+
"netLabelWidth": 1.68
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"pinIds": [
|
|
231
|
+
"U1.6",
|
|
232
|
+
"C2.1"
|
|
233
|
+
],
|
|
234
|
+
"netId": "U1.VOUT to C2.pin1"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"pinIds": [
|
|
238
|
+
"U1.6",
|
|
239
|
+
"R1.1"
|
|
240
|
+
],
|
|
241
|
+
"netId": "U1.VOUT to R1.pin1"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"pinIds": [
|
|
245
|
+
"U1.5",
|
|
246
|
+
"R3.2"
|
|
247
|
+
],
|
|
248
|
+
"netId": "U1.PG to R3.pin2"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"pinIds": [
|
|
252
|
+
"U1.4",
|
|
253
|
+
"R1.2"
|
|
254
|
+
],
|
|
255
|
+
"netId": "U1.FB to R1.pin2"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"pinIds": [
|
|
259
|
+
"U1.4",
|
|
260
|
+
"R2.1"
|
|
261
|
+
],
|
|
262
|
+
"netId": "U1.FB to R2.pin1"
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
"netConnections": [
|
|
266
|
+
{
|
|
267
|
+
"netId": "VIN",
|
|
268
|
+
"pinIds": [
|
|
269
|
+
"U1.1",
|
|
270
|
+
"U1.10",
|
|
271
|
+
"C1.1",
|
|
272
|
+
"R3.1"
|
|
273
|
+
],
|
|
274
|
+
"netLabelWidth": 0.42,
|
|
275
|
+
"netLabelHeight": 0.48
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"netId": "GND",
|
|
279
|
+
"pinIds": [
|
|
280
|
+
"U1.2",
|
|
281
|
+
"U1.3",
|
|
282
|
+
"U1.8",
|
|
283
|
+
"C1.2",
|
|
284
|
+
"C2.2",
|
|
285
|
+
"R2.2"
|
|
286
|
+
],
|
|
287
|
+
"netLabelWidth": 0.42,
|
|
288
|
+
"netLabelHeight": 0.48
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"netId": "PG",
|
|
292
|
+
"pinIds": [
|
|
293
|
+
"U1.5",
|
|
294
|
+
"R3.2"
|
|
295
|
+
],
|
|
296
|
+
"netLabelWidth": 0.36
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"netId": "VOUT",
|
|
300
|
+
"pinIds": [
|
|
301
|
+
"U1.6",
|
|
302
|
+
"C2.1",
|
|
303
|
+
"R1.1"
|
|
304
|
+
],
|
|
305
|
+
"netLabelWidth": 0.42,
|
|
306
|
+
"netLabelHeight": 0.6
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"textBoxes": [
|
|
310
|
+
{
|
|
311
|
+
"chipId": "schematic_component_0",
|
|
312
|
+
"center": {
|
|
313
|
+
"x": 2.2199999999999998,
|
|
314
|
+
"y": 3.0500000000000003
|
|
315
|
+
},
|
|
316
|
+
"width": 1.44,
|
|
317
|
+
"height": 0.17999999999999972,
|
|
318
|
+
"text": "TPS63802DLAR"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"chipId": "schematic_component_0",
|
|
322
|
+
"center": {
|
|
323
|
+
"x": 1.62,
|
|
324
|
+
"y": 2.8150000000000004
|
|
325
|
+
},
|
|
326
|
+
"width": 0.3600000000000001,
|
|
327
|
+
"height": 0.24999999999999956,
|
|
328
|
+
"text": "U1"
|
|
329
|
+
}
|
|
330
|
+
],
|
|
331
|
+
"availableNetLabelOrientations": {
|
|
332
|
+
"VIN": [
|
|
333
|
+
"y+"
|
|
334
|
+
],
|
|
335
|
+
"VOUT": [
|
|
336
|
+
"y+"
|
|
337
|
+
],
|
|
338
|
+
"GND": [
|
|
339
|
+
"y-"
|
|
340
|
+
],
|
|
341
|
+
"PG": [
|
|
342
|
+
"x-",
|
|
343
|
+
"x+"
|
|
344
|
+
]
|
|
345
|
+
},
|
|
346
|
+
"maxMspPairDistance": 2.4
|
|
347
|
+
}
|
|
@@ -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-20260707T230831Z.json"
|
|
4
|
+
import "tests/fixtures/matcher"
|
|
5
|
+
|
|
6
|
+
test("bug-report-20260707T230831Z", () => {
|
|
7
|
+
const solver = new SchematicTracePipelineSolver(inputProblem as any)
|
|
8
|
+
|
|
9
|
+
solver.solve()
|
|
10
|
+
|
|
11
|
+
expect(solver).toMatchSolverSnapshot(import.meta.path)
|
|
12
|
+
})
|
|
@@ -0,0 +1,52 @@
|
|
|
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="0.5279125,3.0973754500000004 0.7,3" data-type="line" data-label="" points="363.46296663543797,319.86511717601365 416.18376153125485,349.6970987396827" fill="none" stroke="hsl(72, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="1" data-y="3" x="416.18376153125485" y="245.5345636073937" width="183.81623846874515" height="208.32507026457802" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0032641294642857146"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="0" data-y="3.1" x="40" y="186.14036612802857" width="323.46296663543797" height="265.8413857337265" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0032641294642857146"/></g><g><rect data-type="rect" data-label="netId: .L1 > .pin2 to .R1 > .pin1
|
|
2
|
+
globalConnNetId: connectivity_net0" data-x="0.7539125" data-y="3.0973754500000004" x="363.7693270328858" y="289.2290774312228" width="137.86217885155884" height="61.272079489581756" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0032641294642857146"/></g><g><rect data-type="rect" data-label="netId: .L1 > .pin2 to .R1 > .pin1
|
|
3
|
+
globalConnNetId: connectivity_net0" data-x="0.474" data-y="3" x="278.01522228224815" y="319.0610589948918" width="137.86217885155884" height="61.272079489581756" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0032641294642857146"/></g><g><circle data-type="point" data-label="R1.1
|
|
4
|
+
x-" data-x="0.7" data-y="3" cx="416.18376153125485" cy="349.6970987396827" r="3" fill="hsl(226, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R1.2
|
|
5
|
+
x+" data-x="1.3" data-y="3" cx="600" cy="349.6970987396827" r="3" fill="hsl(227, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="L1.1
|
|
6
|
+
x-" data-x="-0.5279125" data-y="3.10262455" cx="40.00000000000003" cy="318.25700081377" r="3" fill="hsl(40, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="L1.2
|
|
7
|
+
x+" data-x="0.5279125" data-y="3.0973754500000004" cx="363.46296663543797" cy="319.86511717601365" r="3" fill="hsl(41, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
8
|
+
orientation: x+" data-x="0.5279125" data-y="3.0973754500000004" cx="363.46296663543797" cy="319.86511717601365" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
9
|
+
orientation: x-" data-x="0.7" data-y="3" cx="416.18376153125485" cy="349.6970987396827" 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[
|
|
10
|
+
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
11
|
+
const svg = e.currentTarget;
|
|
12
|
+
const rect = svg.getBoundingClientRect();
|
|
13
|
+
const x = e.clientX - rect.left;
|
|
14
|
+
const y = e.clientY - rect.top;
|
|
15
|
+
const crosshair = svg.getElementById('crosshair');
|
|
16
|
+
const h = svg.getElementById('crosshair-h');
|
|
17
|
+
const v = svg.getElementById('crosshair-v');
|
|
18
|
+
const coords = svg.getElementById('coordinates');
|
|
19
|
+
|
|
20
|
+
crosshair.style.display = 'block';
|
|
21
|
+
h.setAttribute('x1', '0');
|
|
22
|
+
h.setAttribute('x2', '640');
|
|
23
|
+
h.setAttribute('y1', y);
|
|
24
|
+
h.setAttribute('y2', y);
|
|
25
|
+
v.setAttribute('x1', x);
|
|
26
|
+
v.setAttribute('x2', x);
|
|
27
|
+
v.setAttribute('y1', '0');
|
|
28
|
+
v.setAttribute('y2', '640');
|
|
29
|
+
|
|
30
|
+
// Calculate real coordinates using inverse transformation
|
|
31
|
+
const matrix = {"a":306.36039744790844,"c":0,"e":201.73148331771898,"b":0,"d":-306.36039744790844,"f":1268.778291083408};
|
|
32
|
+
// Manually invert and apply the affine transform
|
|
33
|
+
// Since we only use translate and scale, we can directly compute:
|
|
34
|
+
// x' = (x - tx) / sx
|
|
35
|
+
// y' = (y - ty) / sy
|
|
36
|
+
const sx = matrix.a;
|
|
37
|
+
const sy = matrix.d;
|
|
38
|
+
const tx = matrix.e;
|
|
39
|
+
const ty = matrix.f;
|
|
40
|
+
const realPoint = {
|
|
41
|
+
x: (x - tx) / sx,
|
|
42
|
+
y: (y - ty) / sy // Flip y back since we used negative scale
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
|
|
46
|
+
coords.setAttribute('x', (x + 5).toString());
|
|
47
|
+
coords.setAttribute('y', (y - 5).toString());
|
|
48
|
+
});
|
|
49
|
+
document.currentScript.parentElement.addEventListener('mouseleave', () => {
|
|
50
|
+
document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
|
|
51
|
+
});
|
|
52
|
+
]]></script></svg>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"chips": [
|
|
3
|
+
{
|
|
4
|
+
"chipId": "schematic_component_0",
|
|
5
|
+
"center": {
|
|
6
|
+
"x": 1,
|
|
7
|
+
"y": 3
|
|
8
|
+
},
|
|
9
|
+
"width": 0.6000000000000001,
|
|
10
|
+
"height": 0.6800000000000006,
|
|
11
|
+
"pins": [
|
|
12
|
+
{
|
|
13
|
+
"pinId": "R1.1",
|
|
14
|
+
"x": 0.7,
|
|
15
|
+
"y": 3
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"pinId": "R1.2",
|
|
19
|
+
"x": 1.3,
|
|
20
|
+
"y": 3
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"chipId": "schematic_component_1",
|
|
26
|
+
"center": {
|
|
27
|
+
"x": 0,
|
|
28
|
+
"y": 3.1
|
|
29
|
+
},
|
|
30
|
+
"width": 1.055825,
|
|
31
|
+
"height": 0.8677407000000006,
|
|
32
|
+
"pins": [
|
|
33
|
+
{
|
|
34
|
+
"pinId": "L1.1",
|
|
35
|
+
"x": -0.5279125,
|
|
36
|
+
"y": 3.10262455
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"pinId": "L1.2",
|
|
40
|
+
"x": 0.5279125,
|
|
41
|
+
"y": 3.0973754500000004
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"directConnections": [
|
|
47
|
+
{
|
|
48
|
+
"pinIds": [
|
|
49
|
+
"L1.2",
|
|
50
|
+
"R1.1"
|
|
51
|
+
],
|
|
52
|
+
"netId": ".L1 > .pin2 to .R1 > .pin1"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"netConnections": [],
|
|
56
|
+
"textBoxes": [],
|
|
57
|
+
"availableNetLabelOrientations": {},
|
|
58
|
+
"maxMspPairDistance": 2.4
|
|
59
|
+
}
|
|
@@ -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-20260708T053736Z.json"
|
|
4
|
+
import "tests/fixtures/matcher"
|
|
5
|
+
|
|
6
|
+
test("bug-report-20260708T053736Z", () => {
|
|
7
|
+
const solver = new SchematicTracePipelineSolver(inputProblem as any)
|
|
8
|
+
|
|
9
|
+
solver.solve()
|
|
10
|
+
|
|
11
|
+
expect(solver).toMatchSolverSnapshot(import.meta.path)
|
|
12
|
+
})
|
|
@@ -0,0 +1,88 @@
|
|
|
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="8.9,15.1 8.9,14.7" data-type="line" data-label="" points="108.65583456425406,117.2998522895125 108.65583456425406,150.38700147710483" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="8.9,15.1 11.1,13.3" data-type="line" data-label="" points="108.65583456425406,117.2998522895125 290.6351550960118,266.19202363367776" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="8.9,14.7 11.1,13.3" data-type="line" data-label="" points="108.65583456425406,150.38700147710483 290.6351550960118,266.19202363367776" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="8.9,14.9 8.9,14.5" data-type="line" data-label="" points="108.65583456425406,133.84342688330867 108.65583456425406,166.930576070901" fill="none" stroke="hsl(23, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="8.9,14.9 11.1,12.7" data-type="line" data-label="" points="108.65583456425406,133.84342688330867 290.6351550960118,315.8227474150665" fill="none" stroke="hsl(23, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="8.9,14.9 13.7,9.66" data-type="line" data-label="" points="108.65583456425406,133.84342688330867 505.7016248153618,567.285081240768" fill="none" stroke="hsl(23, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="8.9,14.5 11.1,12.7" data-type="line" data-label="" points="108.65583456425406,166.930576070901 290.6351550960118,315.8227474150665" fill="none" stroke="hsl(23, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="8.9,14.5 13.7,9.66" data-type="line" data-label="" points="108.65583456425406,166.930576070901 505.7016248153618,567.285081240768" fill="none" stroke="hsl(23, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="11.1,12.7 13.7,9.66" data-type="line" data-label="" points="290.6351550960118,315.8227474150665 505.7016248153618,567.285081240768" fill="none" stroke="hsl(23, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="11.1,15.5 14.3,9.66" data-type="line" data-label="" points="290.6351550960118,84.21270310192017 555.3323485967503,567.285081240768" fill="none" stroke="hsl(50, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="8.9,14.7 8.600000000000001,14.7 8.600000000000001,15.1 8.9,15.1" data-type="line" data-label="" points="108.65583456425406,150.38700147710483 83.84047267355993,150.38700147710483 83.84047267355993,117.2998522895125 108.65583456425406,117.2998522895125" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="8.9,14.5 8.8,14.5 8.8,14.9 8.9,14.9" data-type="line" data-label="" points="108.65583456425406,166.930576070901 100.38404726735598,166.930576070901 100.38404726735598,133.84342688330867 108.65583456425406,133.84342688330867" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="11.1,12.7 12.399999999999999,12.7 12.399999999999999,9.46 12.329000000000002,9.46 12.329000000000002,9.359000000000002 13.249,9.359000000000002 13.249,9.46 13.7,9.46 13.7,9.66" data-type="line" data-label="" points="290.6351550960118,315.8227474150665 398.16838995568673,315.8227474150665 398.16838995568673,583.8286558345641 392.29542097488945,583.8286558345641 392.29542097488945,592.1831610044311 468.3958641063516,592.1831610044311 468.3958641063516,583.8286558345641 505.7016248153618,583.8286558345641 505.7016248153618,567.285081240768" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="8.600000000000001,14.7 8.31,14.7 8.31,14.699" data-type="line" data-label="" points="83.84047267355993,150.38700147710483 59.852289512555444,150.38700147710483 59.852289512555444,150.46971935007377" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="11.1,13.3 12.491,13.3 12.491,13.249" data-type="line" data-label="" points="290.6351550960118,266.19202363367776 405.6957163958641,266.19202363367776 405.6957163958641,270.41063515509586" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="14.3,9.66 14.3,9.559000000000001 13.149000000000001,9.559000000000001" data-type="line" data-label="" points="555.3323485967503,567.285081240768 555.3323485967503,575.639586410635 460.1240768094535,575.639586410635" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="10" data-y="14" x="108.65583456425412" y="67.66912850812406" width="181.9793205317577" height="281.2407680945347" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.012089285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="14" data-y="10" x="461.03397341211223" y="511.036927621861" width="138.96602658788765" height="56.24815361890694" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.012089285714285714"/></g><g><rect data-type="rect" data-label="ATMEGA328P_AU" data-x="10.080000000000002" data-y="12.17" x="141.7429837518464" y="352.2186115214179" width="129.03988183161027" height="14.889217134416526" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.012089285714285714"/></g><g><rect data-type="rect" data-label="U_MCU" data-x="9.600000000000001" data-y="15.815" x="136.7799113737077" y="47.81683899556867" width="59.556868537666105" height="20.67946824224532" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.012089285714285714"/></g><g><rect data-type="rect" data-label="netId: GND
|
|
2
|
+
globalConnNetId: connectivity_net0" data-x="8.31" data-y="14.488999999999999" x="40.00000000000006" y="150.46971935007377" width="39.704579025110775" height="34.741506646972084" fill="#00000066" stroke="#000000" stroke-width="0.012089285714285714"/></g><g><rect data-type="rect" data-label="netId: GND
|
|
3
|
+
globalConnNetId: connectivity_net0" data-x="12.491" data-y="13.039" x="385.84342688330867" y="270.41063515509586" width="39.70457902511089" height="34.741506646972084" fill="#00000066" stroke="#000000" stroke-width="0.012089285714285714"/></g><g><rect data-type="rect" data-label="netId: VCC_3V3
|
|
4
|
+
globalConnNetId: connectivity_net1" data-x="11.75" data-y="12.91" x="304.69719350073854" y="281.0812407680944" width="79.40915805022155" height="34.741506646972084" fill="#ef444466" stroke="#ef4444" stroke-width="0.012089285714285714"/></g><g><rect data-type="rect" data-label="netId: FAULT
|
|
5
|
+
globalConnNetId: connectivity_net2" data-x="11.460999999999999" data-y="15.5" x="290.7178729689807" y="75.94091580502209" width="59.556868537666105" height="16.543574593796166" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.012089285714285714"/></g><g><rect data-type="rect" data-label="netId: FAULT
|
|
6
|
+
globalConnNetId: connectivity_net2" data-x="12.789000000000001" data-y="9.559000000000001" x="400.5672082717874" y="567.367799113737" width="59.556868537666105" height="16.543574593796052" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.012089285714285714"/></g><g><circle data-type="point" data-label="U_MCU.1
|
|
7
|
+
x-" data-x="8.9" data-y="15.5" cx="108.65583456425406" cy="84.21270310192017" r="3" fill="hsl(144, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.2
|
|
8
|
+
x-" data-x="8.9" data-y="15.3" cx="108.65583456425406" cy="100.75627769571634" r="3" fill="hsl(145, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.3
|
|
9
|
+
x-" data-x="8.9" data-y="15.1" cx="108.65583456425406" cy="117.2998522895125" r="3" fill="hsl(146, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.4
|
|
10
|
+
x-" data-x="8.9" data-y="14.9" cx="108.65583456425406" cy="133.84342688330867" r="3" fill="hsl(147, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.5
|
|
11
|
+
x-" data-x="8.9" data-y="14.7" cx="108.65583456425406" cy="150.38700147710483" r="3" fill="hsl(148, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.6
|
|
12
|
+
x-" data-x="8.9" data-y="14.5" cx="108.65583456425406" cy="166.930576070901" r="3" fill="hsl(149, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.7
|
|
13
|
+
x-" data-x="8.9" data-y="14.3" cx="108.65583456425406" cy="183.47415066469716" r="3" fill="hsl(150, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.8
|
|
14
|
+
x-" data-x="8.9" data-y="14.1" cx="108.65583456425406" cy="200.01772525849333" r="3" fill="hsl(151, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.9
|
|
15
|
+
x-" data-x="8.9" data-y="13.9" cx="108.65583456425406" cy="216.5612998522895" r="3" fill="hsl(152, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.10
|
|
16
|
+
x-" data-x="8.9" data-y="13.700000000000001" cx="108.65583456425406" cy="233.10487444608543" r="3" fill="hsl(192, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.11
|
|
17
|
+
x-" data-x="8.9" data-y="13.5" cx="108.65583456425406" cy="249.64844903988183" r="3" fill="hsl(193, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.12
|
|
18
|
+
x-" data-x="8.9" data-y="13.3" cx="108.65583456425406" cy="266.19202363367776" r="3" fill="hsl(194, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.13
|
|
19
|
+
x-" data-x="8.9" data-y="13.1" cx="108.65583456425406" cy="282.73559822747416" r="3" fill="hsl(195, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.14
|
|
20
|
+
x-" data-x="8.9" data-y="12.9" cx="108.65583456425406" cy="299.2791728212701" r="3" fill="hsl(196, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.15
|
|
21
|
+
x-" data-x="8.9" data-y="12.7" cx="108.65583456425406" cy="315.8227474150665" r="3" fill="hsl(197, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.16
|
|
22
|
+
x-" data-x="8.9" data-y="12.5" cx="108.65583456425406" cy="332.36632200886265" r="3" fill="hsl(198, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.17
|
|
23
|
+
x+" data-x="11.1" data-y="12.5" cx="290.6351550960118" cy="332.36632200886265" r="3" fill="hsl(199, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.18
|
|
24
|
+
x+" data-x="11.1" data-y="12.7" cx="290.6351550960118" cy="315.8227474150665" r="3" fill="hsl(200, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.19
|
|
25
|
+
x+" data-x="11.1" data-y="12.9" cx="290.6351550960118" cy="299.2791728212701" r="3" fill="hsl(201, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.20
|
|
26
|
+
x+" data-x="11.1" data-y="13.1" cx="290.6351550960118" cy="282.73559822747416" r="3" fill="hsl(223, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.21
|
|
27
|
+
x+" data-x="11.1" data-y="13.3" cx="290.6351550960118" cy="266.19202363367776" r="3" fill="hsl(224, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.22
|
|
28
|
+
x+" data-x="11.1" data-y="13.5" cx="290.6351550960118" cy="249.64844903988183" r="3" fill="hsl(225, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.23
|
|
29
|
+
x+" data-x="11.1" data-y="13.7" cx="290.6351550960118" cy="233.10487444608566" r="3" fill="hsl(226, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.24
|
|
30
|
+
x+" data-x="11.1" data-y="13.9" cx="290.6351550960118" cy="216.5612998522895" r="3" fill="hsl(227, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.25
|
|
31
|
+
x+" data-x="11.1" data-y="14.1" cx="290.6351550960118" cy="200.01772525849333" r="3" fill="hsl(228, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.26
|
|
32
|
+
x+" data-x="11.1" data-y="14.299999999999999" cx="290.6351550960118" cy="183.47415066469716" r="3" fill="hsl(229, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.27
|
|
33
|
+
x+" data-x="11.1" data-y="14.5" cx="290.6351550960118" cy="166.930576070901" r="3" fill="hsl(230, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.28
|
|
34
|
+
x+" data-x="11.1" data-y="14.7" cx="290.6351550960118" cy="150.38700147710483" r="3" fill="hsl(231, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.29
|
|
35
|
+
x+" data-x="11.1" data-y="14.9" cx="290.6351550960118" cy="133.84342688330867" r="3" fill="hsl(232, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.30
|
|
36
|
+
x+" data-x="11.1" data-y="15.1" cx="290.6351550960118" cy="117.2998522895125" r="3" fill="hsl(254, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.31
|
|
37
|
+
x+" data-x="11.1" data-y="15.3" cx="290.6351550960118" cy="100.75627769571634" r="3" fill="hsl(255, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U_MCU.32
|
|
38
|
+
x+" data-x="11.1" data-y="15.5" cx="290.6351550960118" cy="84.21270310192017" r="3" fill="hsl(256, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R_FAULT_PULLUP.1
|
|
39
|
+
y-" data-x="13.7" data-y="9.66" cx="505.7016248153618" cy="567.285081240768" r="3" fill="hsl(344, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R_FAULT_PULLUP.2
|
|
40
|
+
y-" data-x="14.3" data-y="9.66" cx="555.3323485967503" cy="567.285081240768" r="3" fill="hsl(344, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
41
|
+
orientation: y-" data-x="8.31" data-y="14.699" cx="59.852289512555444" cy="150.46971935007377" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
42
|
+
orientation: y-" data-x="12.491" data-y="13.249" cx="405.6957163958641" cy="270.41063515509586" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
43
|
+
orientation: y+" data-x="11.75" data-y="12.7" cx="344.4017725258493" cy="315.8227474150665" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
44
|
+
orientation: x+" data-x="11.1" data-y="15.5" cx="290.6351550960118" cy="84.21270310192017" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
45
|
+
orientation: x-" data-x="13.149000000000001" data-y="9.559000000000001" cx="460.1240768094535" cy="575.639586410635" 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[
|
|
46
|
+
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
47
|
+
const svg = e.currentTarget;
|
|
48
|
+
const rect = svg.getBoundingClientRect();
|
|
49
|
+
const x = e.clientX - rect.left;
|
|
50
|
+
const y = e.clientY - rect.top;
|
|
51
|
+
const crosshair = svg.getElementById('crosshair');
|
|
52
|
+
const h = svg.getElementById('crosshair-h');
|
|
53
|
+
const v = svg.getElementById('crosshair-v');
|
|
54
|
+
const coords = svg.getElementById('coordinates');
|
|
55
|
+
|
|
56
|
+
crosshair.style.display = 'block';
|
|
57
|
+
h.setAttribute('x1', '0');
|
|
58
|
+
h.setAttribute('x2', '640');
|
|
59
|
+
h.setAttribute('y1', y);
|
|
60
|
+
h.setAttribute('y2', y);
|
|
61
|
+
v.setAttribute('x1', x);
|
|
62
|
+
v.setAttribute('x2', x);
|
|
63
|
+
v.setAttribute('y1', '0');
|
|
64
|
+
v.setAttribute('y2', '640');
|
|
65
|
+
|
|
66
|
+
// Calculate real coordinates using inverse transformation
|
|
67
|
+
const matrix = {"a":82.7178729689808,"c":0,"e":-627.5332348596751,"b":0,"d":-82.7178729689808,"f":1366.3397341211225};
|
|
68
|
+
// Manually invert and apply the affine transform
|
|
69
|
+
// Since we only use translate and scale, we can directly compute:
|
|
70
|
+
// x' = (x - tx) / sx
|
|
71
|
+
// y' = (y - ty) / sy
|
|
72
|
+
const sx = matrix.a;
|
|
73
|
+
const sy = matrix.d;
|
|
74
|
+
const tx = matrix.e;
|
|
75
|
+
const ty = matrix.f;
|
|
76
|
+
const realPoint = {
|
|
77
|
+
x: (x - tx) / sx,
|
|
78
|
+
y: (y - ty) / sy // Flip y back since we used negative scale
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
|
|
82
|
+
coords.setAttribute('x', (x + 5).toString());
|
|
83
|
+
coords.setAttribute('y', (y - 5).toString());
|
|
84
|
+
});
|
|
85
|
+
document.currentScript.parentElement.addEventListener('mouseleave', () => {
|
|
86
|
+
document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
|
|
87
|
+
});
|
|
88
|
+
]]></script></svg>
|