@tscircuit/schematic-trace-solver 0.0.82 → 0.0.83

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.
@@ -114,7 +114,7 @@ orientation: x-" data-x="-2.38" data-y="3" cx="179.89010989010987" cy="149.67032
114
114
  </g>
115
115
  <g>
116
116
  <circle data-type="point" data-label="anchorPoint
117
- orientation: y-" data-x="-2.9699999999999998" data-y="3.101" cx="147.47252747252747" cy="144.12087912087912" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
117
+ orientation: y-" data-x="-2.9699999999999998" data-y="2.8" cx="147.47252747252747" cy="160.65934065934067" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
118
118
  </g>
119
119
  <g>
120
120
  <circle data-type="point" data-label="anchorPoint
@@ -223,7 +223,7 @@ orientation: y+" data-x="3.4924999999999997" data-y="-1.5" cx="502.5549450549450
223
223
  <polyline data-points="0.2999999999999998,2.8 0.09999999999999981,2.8 0.09999999999999981,3.2 2.9000000000000004,3.2 2.9000000000000004,2.8 2.7,2.8" data-type="line" data-label="" points="327.14285714285717,160.65934065934067 316.15384615384613,160.65934065934067 316.15384615384613,138.68131868131866 470.00000000000006,138.68131868131866 470.00000000000006,160.65934065934067 459.0109890109891,160.65934065934067" fill="none" stroke="purple" stroke-width="1" />
224
224
  </g>
225
225
  <g>
226
- <polyline data-points="-3.525,2.9699999999999998 -3.525,3.101 -2.931,3.101 -2.931,2.899 -2.45,2.899 -2.45,1.5" data-type="line" data-label="" points="116.97802197802196,151.31868131868134 116.97802197802196,144.12087912087912 149.61538461538458,144.12087912087912 149.61538461538458,155.21978021978023 176.04395604395603,155.21978021978023 176.04395604395603,232.08791208791212" fill="none" stroke="purple" stroke-width="1" />
226
+ <polyline data-points="-3.525,2.9699999999999998 -3.525,2.8 -2.415,2.8 -2.415,1.5 -2.45,1.5" data-type="line" data-label="" points="116.97802197802196,151.31868131868134 116.97802197802196,160.65934065934067 177.96703296703296,160.65934065934067 177.96703296703296,232.08791208791212 176.04395604395603,232.08791208791212" fill="none" stroke="purple" stroke-width="1" />
227
227
  </g>
228
228
  <g>
229
229
  <polyline data-points="-2.45,-3 -2.349,-3 -2.349,-3.4509999999999996" data-type="line" data-label="" points="176.04395604395603,479.3406593406594 181.59340659340657,479.3406593406594 181.59340659340657,504.1208791208792" fill="none" stroke="purple" stroke-width="1" />
@@ -280,7 +280,7 @@ globalConnNetId: connectivity_net0" data-x="-2.606" data-y="3" x="155.1098901098
280
280
  </g>
281
281
  <g>
282
282
  <rect data-type="rect" data-label="netId: GND
283
- globalConnNetId: connectivity_net6" data-x="-2.9699999999999998" data-y="2.951" x="141.97802197802196" y="144.12087912087912" width="10.989010989011007" height="16.483516483516468" fill="#00000066" stroke="#000000" stroke-width="0.018199999999999997" />
283
+ globalConnNetId: connectivity_net6" data-x="-2.9699999999999998" data-y="2.65" x="141.97802197802196" y="160.65934065934067" width="10.989010989011007" height="16.483516483516468" fill="#00000066" stroke="#000000" stroke-width="0.018199999999999997" />
284
284
  </g>
285
285
  <g>
286
286
  <rect data-type="rect" data-label="netId: GND
@@ -2,111 +2,111 @@
2
2
  <rect width="100%" height="100%" fill="white" />
3
3
  <g>
4
4
  <circle data-type="point" data-label="U1.1
5
- x+" data-x="1.2000000000000002" data-y="-0.30000000000000004" cx="308.80000000000007" cy="504.016" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
5
+ x+" data-x="1.2000000000000002" data-y="-0.30000000000000004" cx="308.80000000000007" cy="488.336" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
6
6
  </g>
7
7
  <g>
8
8
  <circle data-type="point" data-label="U1.2
9
- x-" data-x="-1.2000000000000002" data-y="-0.30000000000000004" cx="40" cy="504.016" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
9
+ x-" data-x="-1.2000000000000002" data-y="-0.30000000000000004" cx="40" cy="488.336" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
10
10
  </g>
11
11
  <g>
12
12
  <circle data-type="point" data-label="U1.3
13
- x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="308.80000000000007" cy="459.216" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
13
+ x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="308.80000000000007" cy="443.536" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
14
14
  </g>
15
15
  <g>
16
16
  <circle data-type="point" data-label="U1.4
17
- x-" data-x="-1.2000000000000002" data-y="0.30000000000000004" cx="40" cy="436.816" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
17
+ x-" data-x="-1.2000000000000002" data-y="0.30000000000000004" cx="40" cy="421.13599999999997" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
18
18
  </g>
19
19
  <g>
20
20
  <circle data-type="point" data-label="U1.5
21
- x-" data-x="-1.2000000000000002" data-y="0.10000000000000003" cx="40" cy="459.216" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
21
+ x-" data-x="-1.2000000000000002" data-y="0.10000000000000003" cx="40" cy="443.536" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
22
22
  </g>
23
23
  <g>
24
24
  <circle data-type="point" data-label="U1.6
25
- x-" data-x="-1.2000000000000002" data-y="-0.09999999999999998" cx="40" cy="481.616" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
25
+ x-" data-x="-1.2000000000000002" data-y="-0.09999999999999998" cx="40" cy="465.936" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
26
26
  </g>
27
27
  <g>
28
28
  <circle data-type="point" data-label="U1.7
29
- x+" data-x="1.2000000000000002" data-y="-0.10000000000000003" cx="308.80000000000007" cy="481.616" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
29
+ x+" data-x="1.2000000000000002" data-y="-0.10000000000000003" cx="308.80000000000007" cy="465.936" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
30
30
  </g>
31
31
  <g>
32
32
  <circle data-type="point" data-label="U1.8
33
- x+" data-x="1.2000000000000002" data-y="0.30000000000000004" cx="308.80000000000007" cy="436.816" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
33
+ x+" data-x="1.2000000000000002" data-y="0.30000000000000004" cx="308.80000000000007" cy="421.13599999999997" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
34
34
  </g>
35
35
  <g>
36
36
  <circle data-type="point" data-label="J1.1
37
- x-" data-x="1.6" data-y="2.505" cx="353.6" cy="189.856" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
37
+ x-" data-x="1.6" data-y="2.505" cx="353.6" cy="174.176" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
38
38
  </g>
39
39
  <g>
40
40
  <circle data-type="point" data-label="J1.2
41
- x-" data-x="1.6" data-y="2.3049999999999997" cx="353.6" cy="212.25600000000003" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
41
+ x-" data-x="1.6" data-y="2.3049999999999997" cx="353.6" cy="196.57600000000002" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
42
42
  </g>
43
43
  <g>
44
44
  <circle data-type="point" data-label="J1.3
45
- x-" data-x="1.6" data-y="2.1049999999999995" cx="353.6" cy="234.65600000000006" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
45
+ x-" data-x="1.6" data-y="2.1049999999999995" cx="353.6" cy="218.97600000000006" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
46
46
  </g>
47
47
  <g>
48
48
  <circle data-type="point" data-label="anchorPoint
49
- orientation: y-" data-x="1.4000000000000001" data-y="-0.0010000000000000278" cx="331.20000000000005" cy="470.528" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
49
+ orientation: y-" data-x="1.4000000000000001" data-y="-0.30000000000000004" cx="331.20000000000005" cy="488.336" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
50
50
  </g>
51
51
  <g>
52
52
  <circle data-type="point" data-label="anchorPoint
53
- orientation: x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="308.80000000000007" cy="459.216" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
53
+ orientation: x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="308.80000000000007" cy="443.536" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
54
54
  </g>
55
55
  <g>
56
56
  <circle data-type="point" data-label="anchorPoint
57
- orientation: x-" data-x="1.6" data-y="2.3049999999999997" cx="353.6" cy="212.25600000000003" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
57
+ orientation: x-" data-x="1.6" data-y="2.3049999999999997" cx="353.6" cy="196.57600000000002" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
58
58
  </g>
59
59
  <g>
60
60
  <circle data-type="point" data-label="anchorPoint
61
- orientation: y+" data-x="1.3010000000000002" data-y="0.5010000000000001" cx="320.1120000000001" cy="414.304" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
61
+ orientation: y+" data-x="1.3010000000000002" data-y="0.5010000000000001" cx="320.1120000000001" cy="398.62399999999997" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
62
62
  </g>
63
63
  <g>
64
64
  <circle data-type="point" data-label="anchorPoint
65
- orientation: y+" data-x="1.499" data-y="2.706" cx="342.288" cy="167.344" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
65
+ orientation: y+" data-x="1.499" data-y="2.706" cx="342.288" cy="151.664" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
66
66
  </g>
67
67
  <g>
68
- <polyline data-points="1.2000000000000002,-0.30000000000000004 1.6,2.1049999999999995" data-type="line" data-label="" points="308.80000000000007,504.016 353.6,234.65600000000006" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
68
+ <polyline data-points="1.2000000000000002,-0.30000000000000004 1.6,2.1049999999999995" data-type="line" data-label="" points="308.80000000000007,488.336 353.6,218.97600000000006" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
69
69
  </g>
70
70
  <g>
71
- <polyline data-points="1.2000000000000002,0.09999999999999998 1.6,2.3049999999999997" data-type="line" data-label="" points="308.80000000000007,459.216 353.6,212.25600000000003" fill="none" stroke="hsl(158, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
71
+ <polyline data-points="1.2000000000000002,0.09999999999999998 1.6,2.3049999999999997" data-type="line" data-label="" points="308.80000000000007,443.536 353.6,196.57600000000002" fill="none" stroke="hsl(158, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
72
72
  </g>
73
73
  <g>
74
- <polyline data-points="1.2000000000000002,0.30000000000000004 1.6,2.505" data-type="line" data-label="" points="308.80000000000007,436.816 353.6,189.856" fill="none" stroke="hsl(190, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
74
+ <polyline data-points="1.2000000000000002,0.30000000000000004 1.6,2.505" data-type="line" data-label="" points="308.80000000000007,421.13599999999997 353.6,174.176" fill="none" stroke="hsl(190, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
75
75
  </g>
76
76
  <g>
77
- <polyline data-points="1.2000000000000002,-0.30000000000000004 1.2000000000000002,-0.0010000000000000278 1.7810000000000001,-0.0010000000000000278 1.7810000000000001,0.20099999999999998 1.6,0.20099999999999998 1.6,2.1049999999999995" data-type="line" data-label="" points="308.80000000000007,504.016 308.80000000000007,470.528 373.87200000000007,470.528 373.87200000000007,447.904 353.6,447.904 353.6,234.65600000000006" fill="none" stroke="purple" stroke-width="1" />
77
+ <polyline data-points="1.2000000000000002,-0.30000000000000004 1.4000000000000001,-0.30000000000000004 1.4000000000000001,-0.10000000000000003 1.7810000000000001,-0.10000000000000003 1.7810000000000001,0.3 1.4000000000000001,0.3 1.4000000000000001,0.40100000000000013 1.5010000000000003,0.40100000000000013 1.5010000000000003,1.0810000000000002 1.4000000000000001,1.0810000000000002 1.4000000000000001,2.1049999999999995 1.6,2.1049999999999995" data-type="line" data-label="" points="308.80000000000007,488.336 331.20000000000005,488.336 331.20000000000005,465.936 373.87200000000007,465.936 373.87200000000007,421.13599999999997 331.20000000000005,421.13599999999997 331.20000000000005,409.82399999999996 342.51200000000006,409.82399999999996 342.51200000000006,333.664 331.20000000000005,333.664 331.20000000000005,218.97600000000006 353.6,218.97600000000006" fill="none" stroke="purple" stroke-width="1" />
78
78
  </g>
79
79
  <g>
80
- <polyline data-points="1.2000000000000002,0.30000000000000004 1.3010000000000002,0.30000000000000004 1.3010000000000002,0.5010000000000001" data-type="line" data-label="" points="308.80000000000007,436.816 320.1120000000001,436.816 320.1120000000001,414.304" fill="none" stroke="purple" stroke-width="1" />
80
+ <polyline data-points="1.2000000000000002,0.30000000000000004 1.3010000000000002,0.30000000000000004 1.3010000000000002,0.5010000000000001" data-type="line" data-label="" points="308.80000000000007,421.13599999999997 320.1120000000001,421.13599999999997 320.1120000000001,398.62399999999997" fill="none" stroke="purple" stroke-width="1" />
81
81
  </g>
82
82
  <g>
83
- <polyline data-points="1.6,2.505 1.499,2.505 1.499,2.706" data-type="line" data-label="" points="353.6,189.856 342.288,189.856 342.288,167.344" fill="none" stroke="purple" stroke-width="1" />
83
+ <polyline data-points="1.6,2.505 1.499,2.505 1.499,2.706" data-type="line" data-label="" points="353.6,174.176 342.288,174.176 342.288,151.664" fill="none" stroke="purple" stroke-width="1" />
84
84
  </g>
85
85
  <g>
86
- <rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="40" y="414.416" width="268.80000000000007" height="111.99999999999994" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008928571428571428" />
86
+ <rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="40" y="398.736" width="268.80000000000007" height="112" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008928571428571428" />
87
87
  </g>
88
88
  <g>
89
- <rect data-type="rect" data-label="schematic_component_1" data-x="2.7" data-y="2.3049999999999997" x="353.6" y="167.45600000000002" width="246.39999999999998" height="89.60000000000002" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008928571428571428" />
89
+ <rect data-type="rect" data-label="schematic_component_1" data-x="2.7" data-y="2.3049999999999997" x="353.6" y="151.776" width="246.39999999999998" height="89.6" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008928571428571428" />
90
90
  </g>
91
91
  <g>
92
92
  <rect data-type="rect" data-label="netId: GND
93
- globalConnNetId: connectivity_net0" data-x="1.4000000000000001" data-y="-0.241" x="320" y="470.528" width="22.40000000000009" height="53.75999999999999" fill="#00000066" stroke="#000000" stroke-width="0.008928571428571428" />
93
+ globalConnNetId: connectivity_net0" data-x="1.4000000000000001" data-y="-0.54" x="320" y="488.336" width="22.40000000000009" height="53.75999999999999" fill="#00000066" stroke="#000000" stroke-width="0.008928571428571428" />
94
94
  </g>
95
95
  <g>
96
96
  <rect data-type="rect" data-label="netId: OUT
97
- globalConnNetId: connectivity_net1" data-x="1.441" data-y="0.09999999999999998" x="308.91200000000003" y="448.016" width="53.75999999999999" height="22.399999999999977" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008928571428571428" />
97
+ globalConnNetId: connectivity_net1" data-x="1.441" data-y="0.09999999999999998" x="308.91200000000003" y="432.336" width="53.75999999999999" height="22.399999999999977" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008928571428571428" />
98
98
  </g>
99
99
  <g>
100
100
  <rect data-type="rect" data-label="netId: OUT
101
- globalConnNetId: connectivity_net1" data-x="1.3590000000000002" data-y="2.3049999999999997" x="299.72800000000007" y="201.05600000000004" width="53.75999999999999" height="22.400000000000006" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008928571428571428" />
101
+ globalConnNetId: connectivity_net1" data-x="1.3590000000000002" data-y="2.3049999999999997" x="299.72800000000007" y="185.37600000000003" width="53.75999999999999" height="22.400000000000006" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008928571428571428" />
102
102
  </g>
103
103
  <g>
104
104
  <rect data-type="rect" data-label="netId: VCC
105
- globalConnNetId: connectivity_net2" data-x="1.3010000000000002" data-y="0.7410000000000001" x="308.91200000000003" y="360.544" width="22.400000000000034" height="53.75999999999999" fill="#ef444466" stroke="#ef4444" stroke-width="0.008928571428571428" />
105
+ globalConnNetId: connectivity_net2" data-x="1.3010000000000002" data-y="0.7410000000000001" x="308.91200000000003" y="344.864" width="22.400000000000034" height="53.75999999999999" fill="#ef444466" stroke="#ef4444" stroke-width="0.008928571428571428" />
106
106
  </g>
107
107
  <g>
108
108
  <rect data-type="rect" data-label="netId: VCC
109
- globalConnNetId: connectivity_net2" data-x="1.499" data-y="2.9459999999999997" x="331.088" y="113.584" width="22.400000000000034" height="53.76000000000005" fill="#ef444466" stroke="#ef4444" stroke-width="0.008928571428571428" />
109
+ globalConnNetId: connectivity_net2" data-x="1.499" data-y="2.9459999999999997" x="331.088" y="97.904" width="22.400000000000034" height="53.76000000000005" fill="#ef444466" stroke="#ef4444" stroke-width="0.008928571428571428" />
110
110
  </g>
111
111
  <g id="crosshair" style="display: none">
112
112
  <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
@@ -141,7 +141,7 @@ globalConnNetId: connectivity_net2" data-x="1.499" data-y="2.9459999999999997" x
141
141
  "e": 174.40000000000003,
142
142
  "b": 0,
143
143
  "d": -112,
144
- "f": 470.416
144
+ "f": 454.736
145
145
  };
146
146
  // Manually invert and apply the affine transform
147
147
  // Since we only use translate and scale, we can directly compute:
@@ -0,0 +1,177 @@
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="100%" height="100%" fill="white" />
3
+ <g>
4
+ <circle data-type="point" data-label="U1.1
5
+ x+" data-x="1.2000000000000002" data-y="-0.30000000000000004" cx="308.80000000000007" cy="488.28000000000003" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
6
+ </g>
7
+ <g>
8
+ <circle data-type="point" data-label="U1.2
9
+ x-" data-x="-1.2000000000000002" data-y="-0.30000000000000004" cx="40" cy="488.28000000000003" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
10
+ </g>
11
+ <g>
12
+ <circle data-type="point" data-label="U1.3
13
+ x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="308.80000000000007" cy="443.48" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
14
+ </g>
15
+ <g>
16
+ <circle data-type="point" data-label="U1.4
17
+ x-" data-x="-1.2000000000000002" data-y="0.30000000000000004" cx="40" cy="421.08" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
18
+ </g>
19
+ <g>
20
+ <circle data-type="point" data-label="U1.5
21
+ x-" data-x="-1.2000000000000002" data-y="0.10000000000000003" cx="40" cy="443.48" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
22
+ </g>
23
+ <g>
24
+ <circle data-type="point" data-label="U1.6
25
+ x-" data-x="-1.2000000000000002" data-y="-0.09999999999999998" cx="40" cy="465.88" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
26
+ </g>
27
+ <g>
28
+ <circle data-type="point" data-label="U1.7
29
+ x+" data-x="1.2000000000000002" data-y="-0.10000000000000003" cx="308.80000000000007" cy="465.88" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
30
+ </g>
31
+ <g>
32
+ <circle data-type="point" data-label="U1.8
33
+ x+" data-x="1.2000000000000002" data-y="0.30000000000000004" cx="308.80000000000007" cy="421.08" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
34
+ </g>
35
+ <g>
36
+ <circle data-type="point" data-label="J1.1
37
+ x-" data-x="1.6" data-y="2.505" cx="353.6" cy="174.12" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
38
+ </g>
39
+ <g>
40
+ <circle data-type="point" data-label="J1.2
41
+ x-" data-x="1.6" data-y="2.3049999999999997" cx="353.6" cy="196.52000000000004" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
42
+ </g>
43
+ <g>
44
+ <circle data-type="point" data-label="J1.3
45
+ x-" data-x="1.6" data-y="2.1049999999999995" cx="353.6" cy="218.92000000000007" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
46
+ </g>
47
+ <g>
48
+ <circle data-type="point" data-label="anchorPoint
49
+ orientation: y-" data-x="1.6600000000000001" data-y="-0.30100000000000005" cx="360.32000000000005" cy="488.392" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
50
+ </g>
51
+ <g>
52
+ <circle data-type="point" data-label="anchorPoint
53
+ orientation: x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="308.80000000000007" cy="443.48" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
54
+ </g>
55
+ <g>
56
+ <circle data-type="point" data-label="anchorPoint
57
+ orientation: x-" data-x="1.6" data-y="2.3049999999999997" cx="353.6" cy="196.52000000000004" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
58
+ </g>
59
+ <g>
60
+ <circle data-type="point" data-label="anchorPoint
61
+ orientation: y+" data-x="1.611" data-y="0.35100000000000003" cx="354.832" cy="415.368" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
62
+ </g>
63
+ <g>
64
+ <circle data-type="point" data-label="anchorPoint
65
+ orientation: y+" data-x="1.3890000000000002" data-y="2.706" cx="329.9680000000001" cy="151.608" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
66
+ </g>
67
+ <g>
68
+ <polyline data-points="1.2000000000000002,-0.30000000000000004 1.6,2.1049999999999995" data-type="line" data-label="" points="308.80000000000007,488.28000000000003 353.6,218.92000000000007" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
69
+ </g>
70
+ <g>
71
+ <polyline data-points="1.2000000000000002,0.09999999999999998 1.6,2.3049999999999997" data-type="line" data-label="" points="308.80000000000007,443.48 353.6,196.52000000000004" fill="none" stroke="hsl(158, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
72
+ </g>
73
+ <g>
74
+ <polyline data-points="1.2000000000000002,0.30000000000000004 1.6,2.505" data-type="line" data-label="" points="308.80000000000007,421.08 353.6,174.12" fill="none" stroke="hsl(190, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
75
+ </g>
76
+ <g>
77
+ <polyline data-points="1.2000000000000002,-0.30000000000000004 1.4000000000000001,-0.30000000000000004 1.4000000000000001,-0.10000000000000003 1.7810000000000001,-0.10000000000000003 1.7810000000000001,0.3 1.4000000000000001,0.3 1.4000000000000001,2.1049999999999995 1.6,2.1049999999999995" data-type="line" data-label="" points="308.80000000000007,488.28000000000003 331.20000000000005,488.28000000000003 331.20000000000005,465.88 373.87200000000007,465.88 373.87200000000007,421.08 331.20000000000005,421.08 331.20000000000005,218.92000000000007 353.6,218.92000000000007" fill="none" stroke="purple" stroke-width="1" />
78
+ </g>
79
+ <g>
80
+ <polyline data-points="1.4000000000000001,-0.30000000000000004 1.6600000000000001,-0.30000000000000004 1.6600000000000001,-0.30100000000000005" data-type="line" data-label="" points="331.20000000000005,488.28000000000003 360.32000000000005,488.28000000000003 360.32000000000005,488.392" fill="none" stroke="purple" stroke-width="1" />
81
+ </g>
82
+ <g>
83
+ <polyline data-points="1.2000000000000002,0.30000000000000004 1.611,0.30000000000000004 1.611,0.35100000000000003" data-type="line" data-label="" points="308.80000000000007,421.08 354.832,421.08 354.832,415.368" fill="none" stroke="purple" stroke-width="1" />
84
+ </g>
85
+ <g>
86
+ <polyline data-points="1.6,2.505 1.3890000000000002,2.505 1.3890000000000002,2.706" data-type="line" data-label="" points="353.6,174.12 329.9680000000001,174.12 329.9680000000001,151.608" fill="none" stroke="purple" stroke-width="1" />
87
+ </g>
88
+ <g>
89
+ <rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="40" y="398.68" width="268.80000000000007" height="112" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008928571428571428" />
90
+ </g>
91
+ <g>
92
+ <rect data-type="rect" data-label="schematic_component_1" data-x="2.7" data-y="2.3049999999999997" x="353.6" y="151.72000000000003" width="246.39999999999998" height="89.6" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008928571428571428" />
93
+ </g>
94
+ <g>
95
+ <rect data-type="rect" data-label="U1" data-x="-0.68" data-y="0.63" x="84.80000000000003" y="374.04" width="26.88000000000001" height="20.159999999999968" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.008928571428571428" />
96
+ </g>
97
+ <g>
98
+ <rect data-type="rect" data-label="J1" data-x="2.12" data-y="2.835" x="398.40000000000003" y="127.08000000000004" width="26.880000000000052" height="20.159999999999968" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.008928571428571428" />
99
+ </g>
100
+ <g>
101
+ <rect data-type="rect" data-label="netId: GND
102
+ globalConnNetId: connectivity_net0" data-x="1.6600000000000001" data-y="-0.541" x="336.80000000000007" y="488.392" width="47.039999999999964" height="53.76000000000005" fill="#00000066" stroke="#000000" stroke-width="0.008928571428571428" />
103
+ </g>
104
+ <g>
105
+ <rect data-type="rect" data-label="netId: OUT
106
+ globalConnNetId: connectivity_net1" data-x="1.441" data-y="0.09999999999999998" x="308.91200000000003" y="432.28000000000003" width="53.75999999999999" height="22.399999999999977" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008928571428571428" />
107
+ </g>
108
+ <g>
109
+ <rect data-type="rect" data-label="netId: OUT
110
+ globalConnNetId: connectivity_net1" data-x="1.3590000000000002" data-y="2.3049999999999997" x="299.72800000000007" y="185.32000000000005" width="53.75999999999999" height="22.400000000000006" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008928571428571428" />
111
+ </g>
112
+ <g>
113
+ <rect data-type="rect" data-label="netId: VCC
114
+ globalConnNetId: connectivity_net2" data-x="1.611" data-y="0.591" x="331.312" y="361.608" width="47.04000000000002" height="53.75999999999999" fill="#ef444466" stroke="#ef4444" stroke-width="0.008928571428571428" />
115
+ </g>
116
+ <g>
117
+ <rect data-type="rect" data-label="netId: VCC
118
+ globalConnNetId: connectivity_net2" data-x="1.3890000000000002" data-y="2.9459999999999997" x="306.4480000000001" y="97.84800000000001" width="47.039999999999964" height="53.76000000000005" fill="#ef444466" stroke="#ef4444" stroke-width="0.008928571428571428" />
119
+ </g>
120
+ <g id="crosshair" style="display: none">
121
+ <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
122
+ <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>
123
+ </g>
124
+ <script>
125
+ <![CDATA[
126
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
127
+ const svg = e.currentTarget;
128
+ const rect = svg.getBoundingClientRect();
129
+ const x = e.clientX - rect.left;
130
+ const y = e.clientY - rect.top;
131
+ const crosshair = svg.getElementById('crosshair');
132
+ const h = svg.getElementById('crosshair-h');
133
+ const v = svg.getElementById('crosshair-v');
134
+ const coords = svg.getElementById('coordinates');
135
+
136
+ crosshair.style.display = 'block';
137
+ h.setAttribute('x1', '0');
138
+ h.setAttribute('x2', '640');
139
+ h.setAttribute('y1', y);
140
+ h.setAttribute('y2', y);
141
+ v.setAttribute('x1', x);
142
+ v.setAttribute('x2', x);
143
+ v.setAttribute('y1', '0');
144
+ v.setAttribute('y2', '640');
145
+
146
+ // Calculate real coordinates using inverse transformation
147
+ const matrix = {
148
+ "a": 112,
149
+ "c": 0,
150
+ "e": 174.40000000000003,
151
+ "b": 0,
152
+ "d": -112,
153
+ "f": 454.68
154
+ };
155
+ // Manually invert and apply the affine transform
156
+ // Since we only use translate and scale, we can directly compute:
157
+ // x' = (x - tx) / sx
158
+ // y' = (y - ty) / sy
159
+ const sx = matrix.a;
160
+ const sy = matrix.d;
161
+ const tx = matrix.e;
162
+ const ty = matrix.f;
163
+ const realPoint = {
164
+ x: (x - tx) / sx,
165
+ y: (y - ty) / sy // Flip y back since we used negative scale
166
+ }
167
+
168
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
169
+ coords.setAttribute('x', (x + 5).toString());
170
+ coords.setAttribute('y', (y - 5).toString());
171
+ });
172
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
173
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
174
+ });
175
+ ]]>
176
+ </script>
177
+ </svg>
@@ -0,0 +1,129 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": 0,
7
+ "y": 0
8
+ },
9
+ "width": 1.6,
10
+ "height": 1,
11
+ "pins": [
12
+ {
13
+ "pinId": "U1.1",
14
+ "x": 1.2000000000000002,
15
+ "y": -0.30000000000000004
16
+ },
17
+ {
18
+ "pinId": "U1.2",
19
+ "x": -1.2000000000000002,
20
+ "y": -0.30000000000000004
21
+ },
22
+ {
23
+ "pinId": "U1.3",
24
+ "x": 1.2000000000000002,
25
+ "y": 0.09999999999999998
26
+ },
27
+ {
28
+ "pinId": "U1.4",
29
+ "x": -1.2000000000000002,
30
+ "y": 0.30000000000000004
31
+ },
32
+ {
33
+ "pinId": "U1.5",
34
+ "x": -1.2000000000000002,
35
+ "y": 0.10000000000000003
36
+ },
37
+ {
38
+ "pinId": "U1.6",
39
+ "x": -1.2000000000000002,
40
+ "y": -0.09999999999999998
41
+ },
42
+ {
43
+ "pinId": "U1.7",
44
+ "x": 1.2000000000000002,
45
+ "y": -0.10000000000000003
46
+ },
47
+ {
48
+ "pinId": "U1.8",
49
+ "x": 1.2000000000000002,
50
+ "y": 0.30000000000000004
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "chipId": "schematic_component_1",
56
+ "center": {
57
+ "x": 2.7,
58
+ "y": 2.3049999999999997
59
+ },
60
+ "width": 1.4000000000000004,
61
+ "height": 0.7999999999999998,
62
+ "pins": [
63
+ {
64
+ "pinId": "J1.1",
65
+ "x": 1.6,
66
+ "y": 2.505
67
+ },
68
+ {
69
+ "pinId": "J1.2",
70
+ "x": 1.6,
71
+ "y": 2.3049999999999997
72
+ },
73
+ {
74
+ "pinId": "J1.3",
75
+ "x": 1.6,
76
+ "y": 2.1049999999999995
77
+ }
78
+ ]
79
+ }
80
+ ],
81
+ "directConnections": [],
82
+ "netConnections": [
83
+ {
84
+ "netId": "GND",
85
+ "pinIds": ["U1.1", "J1.3"],
86
+ "netLabelWidth": 0.48,
87
+ "netLabelHeight": 0.42
88
+ },
89
+ {
90
+ "netId": "OUT",
91
+ "pinIds": ["U1.3", "J1.2"],
92
+ "netLabelWidth": 0.48
93
+ },
94
+ {
95
+ "netId": "VCC",
96
+ "pinIds": ["U1.8", "J1.1"],
97
+ "netLabelWidth": 0.48,
98
+ "netLabelHeight": 0.42
99
+ }
100
+ ],
101
+ "textBoxes": [
102
+ {
103
+ "chipId": "schematic_component_0",
104
+ "center": {
105
+ "x": -0.68,
106
+ "y": 0.63
107
+ },
108
+ "width": 0.24,
109
+ "height": 0.17999999999999994,
110
+ "text": "U1"
111
+ },
112
+ {
113
+ "chipId": "schematic_component_1",
114
+ "center": {
115
+ "x": 2.12,
116
+ "y": 2.835
117
+ },
118
+ "width": 0.2400000000000002,
119
+ "height": 0.17999999999999972,
120
+ "text": "J1"
121
+ }
122
+ ],
123
+ "availableNetLabelOrientations": {
124
+ "VCC": ["y+"],
125
+ "OUT": ["x-", "x+"],
126
+ "GND": ["y-"]
127
+ },
128
+ "maxMspPairDistance": 2.4
129
+ }
@@ -0,0 +1,105 @@
1
+ import { expect, test } from "bun:test"
2
+ import { getRectBounds } from "lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/geometry"
3
+ import { segmentIntersectsRect } from "lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/collisions"
4
+ import type { NetLabelPlacement } from "lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver"
5
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
6
+ import type { SolvedTracePath } from "lib/solvers/SchematicTraceLinesSolver/SchematicTraceLinesSolver"
7
+ import inputProblem from "./assets/repro51-overlap-junction-crossing.input.json"
8
+ import "tests/fixtures/matcher"
9
+
10
+ const EPS = 1e-6
11
+
12
+ function tracesHavePositiveLengthOverlap(
13
+ a: SolvedTracePath,
14
+ b: SolvedTracePath,
15
+ ) {
16
+ for (let ai = 0; ai < a.tracePath.length - 1; ai++) {
17
+ const a1 = a.tracePath[ai]!
18
+ const a2 = a.tracePath[ai + 1]!
19
+ const aVertical = Math.abs(a1.x - a2.x) < EPS
20
+ const aHorizontal = Math.abs(a1.y - a2.y) < EPS
21
+ if (!aVertical && !aHorizontal) continue
22
+
23
+ for (let bi = 0; bi < b.tracePath.length - 1; bi++) {
24
+ const b1 = b.tracePath[bi]!
25
+ const b2 = b.tracePath[bi + 1]!
26
+ const bVertical = Math.abs(b1.x - b2.x) < EPS
27
+ const bHorizontal = Math.abs(b1.y - b2.y) < EPS
28
+
29
+ if (aVertical && bVertical && Math.abs(a1.x - b1.x) < EPS) {
30
+ const overlap =
31
+ Math.min(Math.max(a1.y, a2.y), Math.max(b1.y, b2.y)) -
32
+ Math.max(Math.min(a1.y, a2.y), Math.min(b1.y, b2.y))
33
+ if (overlap > EPS) return true
34
+ }
35
+
36
+ if (aHorizontal && bHorizontal && Math.abs(a1.y - b1.y) < EPS) {
37
+ const overlap =
38
+ Math.min(Math.max(a1.x, a2.x), Math.max(b1.x, b2.x)) -
39
+ Math.max(Math.min(a1.x, a2.x), Math.min(b1.x, b2.x))
40
+ if (overlap > EPS) return true
41
+ }
42
+ }
43
+ }
44
+
45
+ return false
46
+ }
47
+
48
+ function traceIntersectsDifferentNetLabel(
49
+ trace: SolvedTracePath,
50
+ label: NetLabelPlacement,
51
+ ) {
52
+ if (trace.globalConnNetId === label.globalConnNetId) return false
53
+
54
+ const bounds = getRectBounds(label.center, label.width, label.height)
55
+ for (let i = 0; i < trace.tracePath.length - 1; i++) {
56
+ if (
57
+ segmentIntersectsRect(
58
+ trace.tracePath[i]!,
59
+ trace.tracePath[i + 1]!,
60
+ bounds,
61
+ )
62
+ ) {
63
+ return true
64
+ }
65
+ }
66
+
67
+ return false
68
+ }
69
+
70
+ test.failing("repro51 overlap junction crossing keeps VCC and GND separated", () => {
71
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
72
+ solver.solve()
73
+
74
+ const output = solver.netLabelTraceCollisionSolver!.getOutput()
75
+ const gndNetIds = new Set(
76
+ output.netLabelPlacements
77
+ .filter((label) => label.netId === "GND")
78
+ .map((label) => label.globalConnNetId),
79
+ )
80
+ const vccNetIds = new Set(
81
+ output.netLabelPlacements
82
+ .filter((label) => label.netId === "VCC")
83
+ .map((label) => label.globalConnNetId),
84
+ )
85
+ const gndTraces = output.traces.filter((trace) =>
86
+ gndNetIds.has(trace.globalConnNetId),
87
+ )
88
+ const vccTraces = output.traces.filter((trace) =>
89
+ vccNetIds.has(trace.globalConnNetId),
90
+ )
91
+
92
+ for (const gndTrace of gndTraces) {
93
+ for (const vccTrace of vccTraces) {
94
+ expect(tracesHavePositiveLengthOverlap(gndTrace, vccTrace)).toBe(false)
95
+ }
96
+ }
97
+
98
+ for (const trace of output.traces) {
99
+ for (const label of output.netLabelPlacements) {
100
+ expect(traceIntersectsDifferentNetLabel(trace, label)).toBe(false)
101
+ }
102
+ }
103
+
104
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
105
+ })