@tscircuit/schematic-trace-solver 0.0.47 → 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +51 -1
  3. package/dist/index.js +750 -49
  4. package/lib/solvers/Example28Solver/Example28Solver.ts +182 -0
  5. package/lib/solvers/Example28Solver/geometry.ts +246 -0
  6. package/lib/solvers/Example28Solver/labelMovement.ts +82 -0
  7. package/lib/solvers/Example28Solver/reroute.ts +368 -0
  8. package/lib/solvers/Example28Solver/types.ts +47 -0
  9. package/lib/solvers/Example28Solver/visualize.ts +96 -0
  10. package/lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver.ts +2 -0
  11. package/lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/SingleNetLabelPlacementSolver_visualize.ts +12 -0
  12. package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +16 -0
  13. package/package.json +1 -1
  14. package/site/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2_01-example17-d1_1-u1_1.page.tsx +2 -0
  15. package/site/TraceCleanupSolver/TraceCleanupSolver.page.tsx +23 -0
  16. package/site/TraceLabelOverlapAvoidanceSolver/MergedNetLabelObstacles.page.tsx +18 -0
  17. package/site/TraceLabelOverlapAvoidanceSolver/OverlapAvoidanceStepSolver.page.tsx +24 -0
  18. package/site/TraceLabelOverlapAvoidanceSolver/SingleOverlapSolver.page.tsx +10 -0
  19. package/site/TraceLabelOverlapAvoidanceSolver/TraceLabelOverlapAvoidanceSolver.page.tsx +146 -0
  20. package/site/TraceLabelOverlapAvoidanceSolver/renderComparisonView01.page.tsx +32 -0
  21. package/site/TraceLabelOverlapAvoidanceSolver/renderComparisonView02.page.tsx +32 -0
  22. package/site/TraceLabelOverlapAvoidanceSolver/renderComparisonView03.page.tsx +35 -0
  23. package/site/examples/example01.page.tsx +6 -0
  24. package/site/examples/example02.page.tsx +4 -180
  25. package/site/examples/example03.page.tsx +3 -212
  26. package/site/examples/example04.page.tsx +6 -0
  27. package/site/examples/example05.page.tsx +3 -179
  28. package/site/examples/example06.page.tsx +3 -57
  29. package/site/examples/example07.page.tsx +3 -132
  30. package/site/examples/example08.page.tsx +3 -91
  31. package/site/examples/example09.page.tsx +3 -414
  32. package/site/examples/example10.page.tsx +3 -75
  33. package/site/examples/example11.page.tsx +3 -116
  34. package/site/examples/example12.page.tsx +3 -94
  35. package/site/examples/example13.page.tsx +3 -216
  36. package/site/examples/example14.page.tsx +3 -207
  37. package/site/examples/example15.page.tsx +6 -0
  38. package/site/examples/example16.page.tsx +6 -0
  39. package/site/examples/example17.page.tsx +6 -0
  40. package/site/examples/example18.page.tsx +3 -178
  41. package/site/examples/example19.page.tsx +3 -166
  42. package/site/examples/example20.page.tsx +3 -100
  43. package/site/examples/example21.page.tsx +3 -174
  44. package/site/examples/example22.page.tsx +3 -105
  45. package/site/examples/example23.page.tsx +3 -134
  46. package/site/examples/example24.page.tsx +3 -125
  47. package/site/examples/example25.page.tsx +2 -0
  48. package/site/examples/example26.page.tsx +2 -0
  49. package/site/examples/example27.page.tsx +2 -0
  50. package/site/examples/example28.page.tsx +6 -0
  51. package/site/examples/example29.page.tsx +6 -0
  52. package/site/examples/example30.page.tsx +6 -0
  53. package/site/examples/example31.page.tsx +4 -0
  54. package/tests/assets/example01.json +109 -0
  55. package/tests/assets/example02.json +178 -0
  56. package/tests/assets/example03.json +210 -0
  57. package/tests/assets/example04.json +41 -0
  58. package/tests/assets/example05.json +175 -0
  59. package/tests/assets/example06.json +55 -0
  60. package/tests/assets/example07.json +130 -0
  61. package/tests/assets/example08.json +89 -0
  62. package/tests/assets/example09.json +412 -0
  63. package/tests/assets/example10.json +73 -0
  64. package/tests/assets/example11.json +114 -0
  65. package/tests/assets/example12.json +92 -0
  66. package/tests/assets/example13.json +214 -0
  67. package/tests/assets/example14.json +205 -0
  68. package/tests/assets/example15.json +618 -0
  69. package/tests/assets/example16.json +102 -0
  70. package/tests/assets/example17.json +160 -0
  71. package/tests/assets/example18.json +176 -0
  72. package/tests/assets/example19.json +164 -0
  73. package/tests/assets/example20.json +98 -0
  74. package/tests/assets/example21.json +172 -0
  75. package/tests/assets/example22.json +103 -0
  76. package/tests/assets/example23.json +132 -0
  77. package/tests/assets/example24.json +123 -0
  78. package/tests/assets/example25.json +146 -33
  79. package/tests/assets/example26.json +51 -1134
  80. package/tests/assets/example27.json +151 -91
  81. package/tests/assets/example28.json +56 -0
  82. package/tests/assets/example29.json +1206 -0
  83. package/tests/assets/example30.json +168 -0
  84. package/tests/assets/example31.json +46 -0
  85. package/tests/examples/__snapshots__/example01.snap.svg +12 -6
  86. package/tests/examples/__snapshots__/example02.snap.svg +16 -8
  87. package/tests/examples/__snapshots__/example03.snap.svg +36 -18
  88. package/tests/examples/__snapshots__/example04.snap.svg +8 -4
  89. package/tests/examples/__snapshots__/example05.snap.svg +4 -2
  90. package/tests/examples/__snapshots__/example06.snap.svg +4 -2
  91. package/tests/examples/__snapshots__/example07.snap.svg +20 -10
  92. package/tests/examples/__snapshots__/example08.snap.svg +16 -8
  93. package/tests/examples/__snapshots__/example09.snap.svg +80 -40
  94. package/tests/examples/__snapshots__/example10.snap.svg +16 -8
  95. package/tests/examples/__snapshots__/example11.snap.svg +24 -12
  96. package/tests/examples/__snapshots__/example12.snap.svg +16 -8
  97. package/tests/examples/__snapshots__/example13.snap.svg +32 -16
  98. package/tests/examples/__snapshots__/example14.snap.svg +115 -48
  99. package/tests/examples/__snapshots__/example15.snap.svg +36 -18
  100. package/tests/examples/__snapshots__/example16.snap.svg +16 -8
  101. package/tests/examples/__snapshots__/example17.snap.svg +16 -8
  102. package/tests/examples/__snapshots__/example18.snap.svg +20 -10
  103. package/tests/examples/__snapshots__/example19.snap.svg +16 -8
  104. package/tests/examples/__snapshots__/example20.snap.svg +43 -135
  105. package/tests/examples/__snapshots__/example21.snap.svg +34 -18
  106. package/tests/examples/__snapshots__/example22.snap.svg +37 -23
  107. package/tests/examples/__snapshots__/example23.snap.svg +62 -26
  108. package/tests/examples/__snapshots__/example24.snap.svg +50 -28
  109. package/tests/examples/__snapshots__/example25.snap.svg +175 -49
  110. package/tests/examples/__snapshots__/example26.snap.svg +16 -8
  111. package/tests/examples/__snapshots__/example27.snap.svg +24 -12
  112. package/tests/examples/__snapshots__/example28.snap.svg +29 -189
  113. package/tests/examples/__snapshots__/example29.snap.svg +184 -92
  114. package/tests/examples/__snapshots__/example30.snap.svg +48 -24
  115. package/tests/examples/__snapshots__/example31.snap.svg +88 -0
  116. package/tests/examples/example01.test.ts +2 -2
  117. package/tests/examples/example02.test.ts +2 -2
  118. package/tests/examples/example03.test.ts +2 -2
  119. package/tests/examples/example04.test.ts +2 -2
  120. package/tests/examples/example05.test.ts +2 -2
  121. package/tests/examples/example06.test.ts +2 -2
  122. package/tests/examples/example07.test.ts +2 -2
  123. package/tests/examples/example08.test.ts +2 -2
  124. package/tests/examples/example09.test.ts +2 -2
  125. package/tests/examples/example10.test.ts +2 -2
  126. package/tests/examples/{example11.test.tsx → example11.test.ts} +2 -2
  127. package/tests/examples/{example12.test.tsx → example12.test.ts} +2 -2
  128. package/tests/examples/{example13.test.tsx → example13.test.ts} +2 -2
  129. package/tests/examples/example14.test.ts +12 -0
  130. package/tests/examples/example15.test.ts +12 -0
  131. package/tests/examples/example16.test.ts +12 -0
  132. package/tests/examples/example17.test.ts +12 -0
  133. package/tests/examples/example18.test.ts +12 -0
  134. package/tests/examples/example19.test.ts +12 -0
  135. package/tests/examples/example20.test.ts +12 -0
  136. package/tests/examples/example21.test.ts +12 -0
  137. package/tests/examples/example22.test.ts +12 -0
  138. package/tests/examples/example23.test.ts +12 -0
  139. package/tests/examples/example24.test.ts +12 -0
  140. package/tests/examples/example25.test.ts +12 -0
  141. package/tests/examples/example26.test.ts +12 -0
  142. package/tests/examples/example27.test.ts +3 -232
  143. package/tests/examples/example28.test.ts +1 -2
  144. package/tests/examples/example29.test.ts +1 -2
  145. package/tests/examples/example30.test.ts +2 -2
  146. package/tests/examples/example31.test.ts +12 -0
  147. package/site/examples/example01-basic.page.tsx +0 -105
  148. package/site/examples/example04-single-symbol.page.tsx +0 -46
  149. package/site/examples/example15-rp2040-caps.page.tsx +0 -623
  150. package/site/examples/example16-core-repro51.page.tsx +0 -107
  151. package/site/examples/example17-straight-line-trace.page.tsx +0 -165
  152. package/tests/examples/example14.test.tsx +0 -11
  153. package/tests/examples/example15.test.tsx +0 -629
  154. package/tests/examples/example16.test.tsx +0 -113
  155. package/tests/examples/example17.test.tsx +0 -171
  156. package/tests/examples/example18.test.tsx +0 -187
  157. package/tests/examples/example19.test.tsx +0 -175
  158. package/tests/examples/example20.test.tsx +0 -190
  159. package/tests/examples/example21.test.tsx +0 -183
  160. package/tests/examples/example22.test.tsx +0 -109
  161. package/tests/examples/example23.test.tsx +0 -109
  162. package/tests/examples/example24.test.tsx +0 -114
  163. package/tests/examples/example25.test.tsx +0 -143
  164. package/tests/examples/example26.test.tsx +0 -134
@@ -6,163 +6,223 @@
6
6
  "x": 0,
7
7
  "y": 0
8
8
  },
9
- "width": 0.4,
10
- "height": 2.5999999999999996,
9
+ "width": 1.8,
10
+ "height": 2,
11
11
  "pins": [
12
12
  {
13
- "pinId": "P.1",
14
- "x": -0.6000000000000001,
15
- "y": 1.0999999999999999
13
+ "pinId": "U1.1",
14
+ "x": -0.2,
15
+ "y": 1.4
16
16
  },
17
17
  {
18
- "pinId": "P.2",
19
- "x": -0.6000000000000001,
20
- "y": 0.8999999999999999
18
+ "pinId": "U1.2",
19
+ "x": -1.3,
20
+ "y": 0.09999999999999998
21
21
  },
22
22
  {
23
- "pinId": "P.3",
24
- "x": -0.6000000000000001,
25
- "y": 0.6999999999999998
23
+ "pinId": "U1.3",
24
+ "x": -1.3,
25
+ "y": -0.10000000000000009
26
26
  },
27
27
  {
28
- "pinId": "P.4",
29
- "x": -0.6000000000000001,
30
- "y": 0.4999999999999998
28
+ "pinId": "U1.4",
29
+ "x": -1.3,
30
+ "y": -0.30000000000000004
31
31
  },
32
32
  {
33
- "pinId": "P.5",
34
- "x": -0.6000000000000001,
35
- "y": 0.2999999999999998
33
+ "pinId": "U1.5",
34
+ "x": -1.3,
35
+ "y": -0.5
36
36
  },
37
37
  {
38
- "pinId": "P.6",
39
- "x": -0.6000000000000001,
40
- "y": 0.09999999999999987
38
+ "pinId": "U1.7",
39
+ "x": 0,
40
+ "y": -1.4
41
41
  },
42
42
  {
43
- "pinId": "P.7",
44
- "x": -0.6000000000000001,
45
- "y": -0.10000000000000009
43
+ "pinId": "U1.8",
44
+ "x": -1.3,
45
+ "y": 0.5
46
46
  },
47
47
  {
48
- "pinId": "P.8",
49
- "x": -0.6000000000000001,
50
- "y": -0.30000000000000004
48
+ "pinId": "U1.10",
49
+ "x": 1.3,
50
+ "y": -0.5
51
51
  },
52
52
  {
53
- "pinId": "P.9",
54
- "x": -0.6000000000000001,
55
- "y": -0.5
53
+ "pinId": "U1.11",
54
+ "x": 1.3,
55
+ "y": -0.3
56
56
  },
57
57
  {
58
- "pinId": "P.10",
59
- "x": -0.6000000000000001,
60
- "y": -0.7
58
+ "pinId": "U1.12",
59
+ "x": 1.3,
60
+ "y": -0.09999999999999998
61
61
  },
62
62
  {
63
- "pinId": "P.11",
64
- "x": -0.6000000000000001,
65
- "y": -0.8999999999999999
63
+ "pinId": "U1.13",
64
+ "x": 1.3,
65
+ "y": 0.10000000000000009
66
66
  },
67
67
  {
68
- "pinId": "P.12",
69
- "x": -0.6000000000000001,
70
- "y": -1.0999999999999999
68
+ "pinId": "U1.14",
69
+ "x": 0.2,
70
+ "y": 1.4
71
+ }
72
+ ]
73
+ },
74
+ {
75
+ "chipId": "schematic_component_1",
76
+ "center": {
77
+ "x": -4,
78
+ "y": -0.3
79
+ },
80
+ "width": 0.4,
81
+ "height": 1.6,
82
+ "pins": [
83
+ {
84
+ "pinId": "JP1.1",
85
+ "x": -3.4,
86
+ "y": -0.8999999999999999
71
87
  },
72
88
  {
73
- "pinId": "P.13",
74
- "x": 0.6000000000000001,
75
- "y": -1.0999999999999999
89
+ "pinId": "JP1.2",
90
+ "x": -3.4,
91
+ "y": -0.7
76
92
  },
77
93
  {
78
- "pinId": "P.14",
79
- "x": 0.6000000000000001,
80
- "y": -0.8999999999999999
94
+ "pinId": "JP1.3",
95
+ "x": -3.4,
96
+ "y": -0.49999999999999994
81
97
  },
82
98
  {
83
- "pinId": "P.15",
84
- "x": 0.6000000000000001,
85
- "y": -0.6999999999999998
99
+ "pinId": "JP1.4",
100
+ "x": -3.4,
101
+ "y": -0.2999999999999999
86
102
  },
87
103
  {
88
- "pinId": "P.16",
89
- "x": 0.6000000000000001,
90
- "y": -0.4999999999999998
104
+ "pinId": "JP1.5",
105
+ "x": -3.4,
106
+ "y": -0.09999999999999992
91
107
  },
92
108
  {
93
- "pinId": "P.17",
94
- "x": 0.6000000000000001,
95
- "y": -0.2999999999999998
109
+ "pinId": "JP1.6",
110
+ "x": -3.4,
111
+ "y": 0.10000000000000003
96
112
  },
97
113
  {
98
- "pinId": "P.18",
99
- "x": 0.6000000000000001,
100
- "y": -0.09999999999999987
114
+ "pinId": "JP1.7",
115
+ "x": -3.4,
116
+ "y": 0.3
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "chipId": "schematic_component_2",
122
+ "center": {
123
+ "x": 4,
124
+ "y": -0.3
125
+ },
126
+ "width": 0.4,
127
+ "height": 1.6,
128
+ "pins": [
129
+ {
130
+ "pinId": "JP2.1",
131
+ "x": 3.4,
132
+ "y": -0.8999999999999999
101
133
  },
102
134
  {
103
- "pinId": "P.19",
104
- "x": 0.6000000000000001,
105
- "y": 0.10000000000000009
135
+ "pinId": "JP2.2",
136
+ "x": 3.4,
137
+ "y": -0.7
106
138
  },
107
139
  {
108
- "pinId": "P.20",
109
- "x": 0.6000000000000001,
110
- "y": 0.30000000000000004
140
+ "pinId": "JP2.3",
141
+ "x": 3.4,
142
+ "y": -0.5
111
143
  },
112
144
  {
113
- "pinId": "P.21",
114
- "x": 0.6000000000000001,
115
- "y": 0.5
145
+ "pinId": "JP2.4",
146
+ "x": 3.4,
147
+ "y": -0.3000000000000001
116
148
  },
117
149
  {
118
- "pinId": "P.22",
119
- "x": 0.6000000000000001,
120
- "y": 0.7
150
+ "pinId": "JP2.5",
151
+ "x": 3.4,
152
+ "y": -0.10000000000000003
121
153
  },
122
154
  {
123
- "pinId": "P.23",
124
- "x": 0.6000000000000001,
125
- "y": 0.8999999999999999
155
+ "pinId": "JP2.6",
156
+ "x": 3.4,
157
+ "y": 0.09999999999999998
126
158
  },
127
159
  {
128
- "pinId": "P.24",
129
- "x": 0.6000000000000001,
130
- "y": 1.0999999999999999
160
+ "pinId": "JP2.7",
161
+ "x": 3.4,
162
+ "y": 0.3
131
163
  }
132
164
  ]
133
165
  }
134
166
  ],
135
167
  "directConnections": [
136
168
  {
137
- "pinIds": ["P.1", "P.18"],
138
- "netId": "P.pin1 to P.pin18"
169
+ "pinIds": ["JP1.1", "U1.7"],
170
+ "netId": "pinheader.JP1 > port.pin1 to .U1 > .pin7"
171
+ },
172
+ {
173
+ "pinIds": ["JP1.3", "U1.5"],
174
+ "netId": "pinheader.JP1 > port.pin3 to .U1 > .pin5"
175
+ },
176
+ {
177
+ "pinIds": ["JP1.4", "U1.4"],
178
+ "netId": "pinheader.JP1 > port.pin4 to .U1 > .pin4"
179
+ },
180
+ {
181
+ "pinIds": ["JP1.5", "U1.3"],
182
+ "netId": "pinheader.JP1 > port.pin5 to .U1 > .pin3"
183
+ },
184
+ {
185
+ "pinIds": ["JP1.6", "U1.2"],
186
+ "netId": "pinheader.JP1 > port.pin6 to .U1 > .pin2"
139
187
  },
140
188
  {
141
- "pinIds": ["P.2", "P.17"],
142
- "netId": "P.pin2 to P.pin17"
189
+ "pinIds": ["JP2.3", "U1.10"],
190
+ "netId": "pinheader.JP2 > port.pin3 to .U1 > .pin10"
143
191
  },
144
192
  {
145
- "pinIds": ["P.3", "P.16"],
146
- "netId": "P.pin3 to P.pin16"
193
+ "pinIds": ["JP2.4", "U1.11"],
194
+ "netId": "pinheader.JP2 > port.pin4 to .U1 > .pin11"
147
195
  },
148
196
  {
149
- "pinIds": ["P.4", "P.15"],
150
- "netId": "P.pin4 to P.pin15"
197
+ "pinIds": ["JP2.5", "U1.12"],
198
+ "netId": "pinheader.JP2 > port.pin5 to .U1 > .pin12"
151
199
  },
152
200
  {
153
- "pinIds": ["P.5", "P.14"],
154
- "netId": "P.pin5 to P.pin14"
201
+ "pinIds": ["JP2.6", "U1.13"],
202
+ "netId": "pinheader.JP2 > port.pin6 to .U1 > .pin13"
203
+ }
204
+ ],
205
+ "netConnections": [
206
+ {
207
+ "netId": "V3_3",
208
+ "pinIds": ["U1.1", "JP1.2"],
209
+ "netLabelWidth": 0.4
155
210
  },
156
211
  {
157
- "pinIds": ["P.6", "P.13"],
158
- "netId": "P.pin6 to P.pin13"
212
+ "netId": "GND",
213
+ "pinIds": ["U1.7", "JP1.1", "JP2.1"],
214
+ "netLabelWidth": 0.3
159
215
  },
160
216
  {
161
- "pinIds": ["P.7", "P.19"],
162
- "netId": "P.pin7 to P.pin19"
217
+ "netId": "V5",
218
+ "pinIds": ["U1.14", "JP2.2"],
219
+ "netLabelWidth": 0.2
163
220
  }
164
221
  ],
165
- "netConnections": [],
166
- "availableNetLabelOrientations": {},
167
- "maxMspPairDistance": 2.4
222
+ "availableNetLabelOrientations": {
223
+ "V3_3": ["y+"],
224
+ "V5": ["y+"],
225
+ "GND": ["y-"]
226
+ },
227
+ "maxMspPairDistance": 5
168
228
  }
@@ -0,0 +1,56 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "1",
5
+ "center": {
6
+ "x": 0,
7
+ "y": 0
8
+ },
9
+ "width": 0.6,
10
+ "height": 0.4,
11
+ "pins": [
12
+ {
13
+ "pinId": "IN",
14
+ "x": -0.3,
15
+ "y": 0.1
16
+ },
17
+ {
18
+ "pinId": "GND",
19
+ "x": -0.3,
20
+ "y": 0
21
+ },
22
+ {
23
+ "pinId": "EN",
24
+ "x": -0.3,
25
+ "y": -0.1
26
+ },
27
+ {
28
+ "pinId": "OUT",
29
+ "x": 0.3,
30
+ "y": 0.1
31
+ },
32
+ {
33
+ "pinId": "NC",
34
+ "x": 0.3,
35
+ "y": 0
36
+ }
37
+ ]
38
+ }
39
+ ],
40
+ "directConnections": [],
41
+ "netConnections": [
42
+ {
43
+ "netId": "V5_IN",
44
+ "pinIds": ["IN", "EN"]
45
+ },
46
+ {
47
+ "netId": "V3P3",
48
+ "pinIds": ["OUT"]
49
+ },
50
+ {
51
+ "netId": "GND",
52
+ "pinIds": ["GND"]
53
+ }
54
+ ],
55
+ "availableNetLabelOrientations": {}
56
+ }