@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
@@ -1,182 +1,6 @@
1
- import type { InputProblem } from "lib/index"
2
1
  import { PipelineDebugger } from "site/components/PipelineDebugger"
2
+ import inputProblem from "../../tests/assets/example05.json"
3
3
 
4
- export const inputProblem: InputProblem = {
5
- chips: [
6
- {
7
- chipId: "schematic_component_0",
8
- center: {
9
- x: 0,
10
- y: 0,
11
- },
12
- width: 1,
13
- height: 5,
14
- pins: [
15
- {
16
- pinId: "U1.1",
17
- x: 0.9,
18
- y: 1.2,
19
- },
20
- {
21
- pinId: "U1.2",
22
- x: 0.9,
23
- y: 0.3999999999999999,
24
- },
25
- {
26
- pinId: "U1.3",
27
- x: 0.9,
28
- y: 0.5999999999999999,
29
- },
30
- {
31
- pinId: "U1.4",
32
- x: -0.9,
33
- y: 0.3999999999999999,
34
- },
35
- {
36
- pinId: "U1.5",
37
- x: 0.9,
38
- y: 0.9999999999999998,
39
- },
40
- {
41
- pinId: "U1.6",
42
- x: 0.9,
43
- y: -0.19999999999999996,
44
- },
45
- {
46
- pinId: "U1.7",
47
- x: -0.9,
48
- y: -0.7999999999999998,
49
- },
50
- {
51
- pinId: "U1.9",
52
- x: 0.9,
53
- y: 0.19999999999999996,
54
- },
55
- {
56
- pinId: "U1.10",
57
- x: 0.9,
58
- y: 0,
59
- },
60
- {
61
- pinId: "U1.11",
62
- x: 0.9,
63
- y: 0.7999999999999998,
64
- },
65
- {
66
- pinId: "U1.12",
67
- x: 0.9,
68
- y: -1.2,
69
- },
70
- {
71
- pinId: "U1.13",
72
- x: 0.9,
73
- y: -1,
74
- },
75
- {
76
- pinId: "U1.14",
77
- x: 0.9,
78
- y: -0.7999999999999999,
79
- },
80
- {
81
- pinId: "U1.15",
82
- x: -0.9,
83
- y: 1,
84
- },
85
- {
86
- pinId: "U1.16",
87
- x: -0.9,
88
- y: 1.2,
89
- },
90
- {
91
- pinId: "U1.17",
92
- x: -0.9,
93
- y: 0.5999999999999999,
94
- },
95
- {
96
- pinId: "U1.18",
97
- x: -0.9,
98
- y: -0.9999999999999998,
99
- },
100
- {
101
- pinId: "U1.19",
102
- x: -0.9,
103
- y: -0.19999999999999996,
104
- },
105
- {
106
- pinId: "U1.20",
107
- x: -0.9,
108
- y: 0.7999999999999999,
109
- },
110
- {
111
- pinId: "U1.21",
112
- x: -0.9,
113
- y: -1.2,
114
- },
115
- {
116
- pinId: "U1.22",
117
- x: 0.9,
118
- y: -0.5999999999999999,
119
- },
120
- {
121
- pinId: "U1.23",
122
- x: 0.9,
123
- y: -0.3999999999999999,
124
- },
125
- {
126
- pinId: "U1.25",
127
- x: -0.9,
128
- y: -0.5999999999999999,
129
- },
130
- {
131
- pinId: "U1.26",
132
- x: -0.9,
133
- y: -0.3999999999999999,
134
- },
135
- {
136
- pinId: "U1.27",
137
- x: -0.9,
138
- y: 0.19999999999999996,
139
- },
140
- {
141
- pinId: "U1.28",
142
- x: -0.9,
143
- y: 0,
144
- },
145
- ],
146
- },
147
- {
148
- chipId: "schematic_component_1",
149
- center: {
150
- x: 2,
151
- y: 1,
152
- },
153
- width: 1.0402490999999996,
154
- height: 0.5476905999999993,
155
- pins: [
156
- {
157
- pinId: "LED1.1",
158
- x: 1.4808529,
159
- y: 1.0005122999999987,
160
- },
161
- {
162
- pinId: "LED1.2",
163
- x: 2.5191471,
164
- y: 0.9994877000000013,
165
- },
166
- ],
167
- },
168
- ],
169
- directConnections: [
170
- {
171
- pinIds: ["LED1.2", "U1.20"],
172
- netId: ".LED1 > port.right to .U1 > .pin20",
173
- },
174
- ],
175
- netConnections: [],
176
- availableNetLabelOrientations: {},
177
- maxMspPairDistance: 10,
178
- }
4
+ export { inputProblem }
179
5
 
180
- export default function Example05Page() {
181
- return <PipelineDebugger inputProblem={inputProblem} />
182
- }
6
+ export default () => <PipelineDebugger inputProblem={inputProblem as any} />
@@ -1,60 +1,6 @@
1
1
  import { PipelineDebugger } from "site/components/PipelineDebugger"
2
- import type { InputProblem } from "lib/types/InputProblem"
2
+ import inputProblem from "../../tests/assets/example06.json"
3
3
 
4
- export const inputProblem: InputProblem = {
5
- chips: [
6
- {
7
- chipId: "schematic_component_0",
8
- center: {
9
- x: -3,
10
- y: 0,
11
- },
12
- width: 1.102581400000001,
13
- height: 0.388910699999999,
14
- pins: [
15
- {
16
- pinId: "R1.1",
17
- x: -3.5512907000000005,
18
- y: 0.0002732499999993365,
19
- },
20
- {
21
- pinId: "R1.2",
22
- x: -2.4487092999999995,
23
- y: -0.0002732499999993365,
24
- },
25
- ],
26
- },
27
- {
28
- chipId: "schematic_component_1",
29
- center: {
30
- x: 3,
31
- y: 0,
32
- },
33
- width: 1.102418600000001,
34
- height: 0.8400173000000031,
35
- pins: [
36
- {
37
- pinId: "C1.1",
38
- x: 2.4487906999999995,
39
- y: -0.00027334999999961695,
40
- },
41
- {
42
- pinId: "C1.2",
43
- x: 3.5512093000000005,
44
- y: 0.00027334999999961695,
45
- },
46
- ],
47
- },
48
- ],
49
- directConnections: [
50
- {
51
- pinIds: ["R1.1", "C1.1"],
52
- netId: ".R1 > .pin1 to .C1 > .pin1",
53
- },
54
- ],
55
- netConnections: [],
56
- availableNetLabelOrientations: {},
57
- maxMspPairDistance: 10,
58
- }
4
+ export { inputProblem }
59
5
 
60
- export default () => <PipelineDebugger inputProblem={inputProblem} />
6
+ export default () => <PipelineDebugger inputProblem={inputProblem as any} />
@@ -1,135 +1,6 @@
1
1
  import { PipelineDebugger } from "site/components/PipelineDebugger"
2
- import type { InputProblem } from "lib/types/InputProblem"
2
+ import inputProblem from "../../tests/assets/example07.json"
3
3
 
4
- export const inputProblem: InputProblem = {
5
- chips: [
6
- {
7
- chipId: "schematic_component_0",
8
- center: {
9
- x: 0,
10
- y: 0,
11
- },
12
- width: 2.8,
13
- height: 1.4,
14
- pins: [
15
- {
16
- pinId: "U3.8",
17
- x: -1.4,
18
- y: 0.42500000000000004,
19
- },
20
- {
21
- pinId: "U3.4",
22
- x: -1.4,
23
- y: -0.42500000000000004,
24
- },
25
- {
26
- pinId: "U3.1",
27
- x: 1.4,
28
- y: 0.5,
29
- },
30
- {
31
- pinId: "U3.6",
32
- x: 1.4,
33
- y: 0.30000000000000004,
34
- },
35
- {
36
- pinId: "U3.5",
37
- x: 1.4,
38
- y: 0.10000000000000009,
39
- },
40
- {
41
- pinId: "U3.2",
42
- x: 1.4,
43
- y: -0.09999999999999998,
44
- },
45
- {
46
- pinId: "U3.3",
47
- x: 1.4,
48
- y: -0.3,
49
- },
50
- {
51
- pinId: "U3.7",
52
- x: 1.4,
53
- y: -0.5,
54
- },
55
- ],
56
- },
57
- {
58
- chipId: "schematic_component_1",
59
- center: {
60
- x: -2.3145833,
61
- y: 0,
62
- },
63
- width: 0.5291665999999999,
64
- height: 1.1024186000000005,
65
- pins: [
66
- {
67
- pinId: "C20.1",
68
- x: -2.3148566499999994,
69
- y: 0.5512093000000002,
70
- },
71
- {
72
- pinId: "C20.2",
73
- x: -2.31430995,
74
- y: -0.5512093000000002,
75
- },
76
- ],
77
- },
78
- {
79
- chipId: "schematic_component_2",
80
- center: {
81
- x: 1.7577928249999983,
82
- y: 1.7512907000000002,
83
- },
84
- width: 0.3155856499999966,
85
- height: 1.1025814000000005,
86
- pins: [
87
- {
88
- pinId: "R11.1",
89
- x: 1.7580660749999977,
90
- y: 2.3025814000000002,
91
- },
92
- {
93
- pinId: "R11.2",
94
- x: 1.757519574999999,
95
- y: 1.2,
96
- },
97
- ],
98
- },
99
- ],
100
- directConnections: [
101
- {
102
- pinIds: ["C20.1", "U3.8"],
103
- netId: "capacitor.C20 > port.pin1 to .U3 > .VDD",
104
- },
105
- {
106
- pinIds: ["C20.2", "U3.4"],
107
- netId: "capacitor.C20 > port.pin2 to .U3 > .GND",
108
- },
109
- {
110
- pinIds: ["R11.2", "U3.1"],
111
- netId: "resistor.R11 > port.pin2 to .U3 > .N_CS",
112
- },
113
- ],
114
- netConnections: [
115
- {
116
- netId: "V3_3",
117
- pinIds: ["U3.8", "U3.3", "U3.7", "C20.1", "R11.1"],
118
- },
119
- {
120
- netId: "GND",
121
- pinIds: ["U3.4", "C20.2"],
122
- },
123
- {
124
- netId: "FLASH_N_CS",
125
- pinIds: ["U3.1", "R11.2"],
126
- },
127
- ],
128
- availableNetLabelOrientations: {
129
- V3_3: ["y+"],
130
- GND: ["y-"],
131
- },
132
- maxMspPairDistance: 2,
133
- }
4
+ export { inputProblem }
134
5
 
135
- export default () => <PipelineDebugger inputProblem={inputProblem} />
6
+ export default () => <PipelineDebugger inputProblem={inputProblem as any} />
@@ -1,94 +1,6 @@
1
1
  import { PipelineDebugger } from "site/components/PipelineDebugger"
2
- import type { InputProblem } from "lib/types/InputProblem"
2
+ import inputProblem from "../../tests/assets/example08.json"
3
3
 
4
- export const inputProblem: InputProblem = {
5
- chips: [
6
- {
7
- chipId: "schematic_component_0",
8
- center: {
9
- x: 4,
10
- y: 0,
11
- },
12
- width: 1.1025814,
13
- height: 0.388910699999999,
14
- pins: [
15
- {
16
- pinId: "R1.1",
17
- x: 3.4487093,
18
- y: 0.0002732499999993365,
19
- },
20
- {
21
- pinId: "R1.2",
22
- x: 4.5512907,
23
- y: -0.0002732499999993365,
24
- },
25
- ],
26
- },
27
- {
28
- chipId: "schematic_component_1",
29
- center: {
30
- x: 0,
31
- y: 0,
32
- },
33
- width: 1.2000000000000002,
34
- height: 1,
35
- pins: [
36
- {
37
- pinId: "U1.1",
38
- x: -0.6000000000000001,
39
- y: 0.30000000000000004,
40
- },
41
- {
42
- pinId: "U1.2",
43
- x: -0.6000000000000001,
44
- y: 0.10000000000000003,
45
- },
46
- {
47
- pinId: "U1.3",
48
- x: -0.6000000000000001,
49
- y: -0.09999999999999998,
50
- },
51
- {
52
- pinId: "U1.4",
53
- x: -0.6000000000000001,
54
- y: -0.30000000000000004,
55
- },
56
- {
57
- pinId: "U1.5",
58
- x: 0.6000000000000001,
59
- y: -0.30000000000000004,
60
- },
61
- {
62
- pinId: "U1.6",
63
- x: 0.6000000000000001,
64
- y: -0.10000000000000003,
65
- },
66
- {
67
- pinId: "U1.7",
68
- x: 0.6000000000000001,
69
- y: 0.09999999999999998,
70
- },
71
- {
72
- pinId: "U1.8",
73
- x: 0.6000000000000001,
74
- y: 0.30000000000000004,
75
- },
76
- ],
77
- },
78
- ],
79
- directConnections: [
80
- {
81
- pinIds: ["U1.1", "R1.1"],
82
- netId: "chip.U1 > port.pin1 to R1.1",
83
- },
84
- {
85
- pinIds: ["U1.6", "R1.2"],
86
- netId: "chip.U1 > port.pin6 to R1.2",
87
- },
88
- ],
89
- netConnections: [],
90
- availableNetLabelOrientations: {},
91
- maxMspPairDistance: 5,
92
- }
4
+ export { inputProblem }
93
5
 
94
- export default () => <PipelineDebugger inputProblem={inputProblem} />
6
+ export default () => <PipelineDebugger inputProblem={inputProblem as any} />